Cluster API v1.3 compared to v1.4
This document provides an overview over relevant changes between Cluster API v1.3 and v1.4 for maintainers of providers and consumers of our Go API.
Minimum Go version
- The Go version used by Cluster API is still Go 1.19.x
Dependencies
Note: Only the most relevant dependencies are listed, k8s.io/ and ginkgo/gomega dependencies in Cluster API are kept in sync with the versions used by sigs.k8s.io/controller-runtime.
- sigs.k8s.io/kind: v0.17.x => v0.20.x
- sigs.k8s.io/controller-runtime: v0.13.x => v0.14.x
- sigs.k8s.io/controller-tools: v0.10.x => v0.11.x
- github.com/joelanford/go-apidiff: 0.5.0 => 0.6.0
Changes by Kind
Deprecation
-
The api versions
v1alpha3andv1alpha4are deprecated and will be removed.v1alpha3will be removed in v1.5v1alpha4will be removed in v1.6
For more information please see the note in the contributors guide.
Removals
util/conversion.GetCRDWithContracthas been removed.clusterctl backuphas been removed.clusterctl restorehas been removed.api/v1beta1.MachineHealthCheckSuccededConditioncondition type has been removed.controller/external/util.CloneTemplateandcontrollers/external/util.CloneTemplateInputhas been removed.- The option
--list-imagesfromclusterctl initsubcommand has been removed. exp/runtime/server.NewServerhas been removed.--disable-no-echooption fromclusterctl describe clustersubcommand has been removedapi/v1beta1.ClusterTopologyManagedFieldsAnnotationfield has been removed.api/v1beta1.PopulateDefaultsMachineDeploymentfunc has been removed.
API Changes
util/conversion.UpdateReferenceAPIContractdropped theAPIReaderparameter because it’s not required anymore as we now only handle CRDs with compliant names.Backup(options BackupOptions) errorin the Client interface has been removed.Restore(options RestoreOptions) errorin the Client interface has been removed.cmd/clusterctl/client.RolloutOptionshas been removed,RolloutRestartOptions,RolloutPauseOptions,RolloutResumeOptions, andRolloutUndoOptionshave been added instead.- Annotation constant
DisableMachineCreatehas been updated toDisableMachineCreateAnnotation - Below Label constant have been updated
ClusterLabelNametoClusterNameLabelClusterTopologyMachineDeploymentLabelNametoClusterTopologyMachineDeploymentNameLabelProviderLabelNametoProviderNameLabelMachineControlPlaneLabelNametoMachineControlPlaneLabelMachineSetLabelNametoMachineSetNameLabelMachineDeploymentLabelNametoMachineDeploymentNameLabel
- Below Condition and Reason constants have been updated
ExternalRemediationTemplateAvailabletoExternalRemediationTemplateAvailableConditionExternalRemediationTemplateNotFoundtoExternalRemediationTemplateNotFoundReasonExternalRemediationRequestAvailabletoExternalRemediationRequestAvailableConditionExternalRemediationRequestCreationFailedtoExternalRemediationRequestCreationFailedReason
api/v1beta1.MachineDeployment.Defaultfunc has been replaced throughapi/v1beta1.MachineDeploymentDefaulter
Other
- clusterctl now emits an error for provider CRDs which don’t comply with the CRD naming conventions. This warning can be skipped for resources not referenced by Cluster API
core resources via the
clusterctl.cluster.x-k8s.io/skip-crd-name-preflight-checkannotation. The contracts specify:The CRD name must have the format produced by sigs.k8s.io/cluster-api/util/contract.CalculateCRDName(Group, Kind)
clusterctl upgrade applyno longer requires a namespace when updating providers. It is now optional and in a future release it will be deprecated. The new syntax is[namespace/]provider:version.WatchDeploymentLogsis changed toWatchDeploymentLogsByName, it works same as before. Another functionWatchDeploymentLogsByLabelSelectoris added to stream logs of deployment by label selector.- Cluster API controllers are now using an explicit security context by default.
- It is recommended to drop usages of
logs.AddFlags(fs, logs.SkipLoggingConfigurationFlags()). It was previously used to configure deprecated logging flags, but with the bump to component-basev0.26.0this function is not configuring any flags anymore. Please note that the following logging flags have been removed: (incomponent-base, but this affects all CAPI controllers):--add-dir-header,--alsologtostderr,--log-backtrace-at,--log-dir,--log-file,--log-file-max-size,--logtostderr,--one-output,--skip-headers,--skip-log-headersand--stderrthreshold. For more information, please see: https://github.com/kubernetes/enhancements/issues/2845 - A new
KCPRemediationSpectest has been added providing better test coverage for KCP remediation most common use cases. As a consequenceMachineRemediationSpechas been renamed toMachineDeploymentRemediationSpecand now only tests remediation of worker machines (NOTE: we plan to improve this test as well in a future iteration). - Package
test/infrastructure/docker/internal/third_party/forked/loadbalancerhas been moved totest/infrastructure/docker/internal/loadbalancerto allow it to diverge from the upstream Kind package.
Suggested changes for providers
- Providers should add an explicit security context to their controllers deployment, see #7831 for reference.