Skip to content

Commit df98b9c

Browse files
Improve v1.12 migration docs
1 parent 83efbb1 commit df98b9c

File tree

6 files changed

+187
-24
lines changed

6 files changed

+187
-24
lines changed

api/core/v1beta2/machine_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ type MachineReadinessGate struct {
556556
type MachineStatus struct {
557557
// conditions represents the observations of a Machine's current state.
558558
// Known condition types are Available, Ready, UpToDate, BootstrapConfigReady, InfrastructureReady, NodeReady,
559-
// NodeHealthy, Deleting, Paused.
559+
// NodeHealthy, Updating, Deleting, Paused.
560560
// If a MachineHealthCheck is targeting this machine, also HealthCheckSucceeded, OwnerRemediated conditions are added.
561561
// Additionally control plane Machines controlled by KubeadmControlPlane will have following additional conditions:
562562
// APIServerPodHealthy, ControllerManagerPodHealthy, SchedulerPodHealthy, EtcdPodHealthy, EtcdMemberHealthy.

api/core/v1beta2/zz_generated.openapi.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/cluster.x-k8s.io_machines.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
- [Provider contracts](developer/providers/contracts/overview.md)
9696
- [InfraCluster](./developer/providers/contracts/infra-cluster.md)
9797
- [InfraMachine](developer/providers/contracts/infra-machine.md)
98+
- [InfraMachinePool](developer/providers/contracts/infra-machinepool.md)
9899
- [BootstrapConfig](developer/providers/contracts/bootstrap-config.md)
99100
- [ControlPlane](developer/providers/contracts/control-plane.md)
100101
- [clusterctl](developer/providers/contracts/clusterctl.md)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Contract rules for InfraMachinePool
Lines changed: 182 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
# Cluster API v1.11 compared to v1.12
22

33
This document provides an overview over relevant changes between Cluster API v1.11 and v1.12 for
4-
maintainers of providers and consumers of our Go API.
4+
maintainers of providers and consumers of our Go API.
5+
6+
Any feedback or contributions to improve following documentation is welcome!
7+
8+
<!-- TOC -->
9+
* [Cluster API v1.11 compared to v1.12](#cluster-api-v111-compared-to-v112)
10+
* [Go version](#go-version)
11+
* [Dependencies](#dependencies)
12+
* [Implemented proposal](#implemented-proposal)
13+
* [API Changes](#api-changes)
14+
* [Cluster](#cluster-)
15+
* [Machine](#machine)
16+
* [MachineDeployment](#machinedeployment)
17+
* [MachineSet](#machineset)
18+
* [MachinePool](#machinepool)
19+
* [MachineHealthCheck](#machinehealthcheck)
20+
* [ClusterClass](#clusterclass)
21+
* [KubeadmConfig](#kubeadmconfig)
22+
* [KubeadmConfigTemplate](#kubeadmconfigtemplate)
23+
* [KubeadmControlPlane](#kubeadmcontrolplane)
24+
* [KubeadmControlPlaneTemplate](#kubeadmcontrolplanetemplate)
25+
* [Runtime hooks Changes](#runtime-hooks-changes)
26+
* [Cluster API Contract changes](#cluster-api-contract-changes)
27+
* [Deprecation](#deprecation)
28+
* [Removals](#removals)
29+
* [Suggested changes for providers](#suggested-changes-for-providers)
30+
* [Removals scheduled for future releases](#removals-scheduled-for-future-releases)
31+
<!-- TOC -->
532

633
## Go version
734

@@ -13,36 +40,170 @@ maintainers of providers and consumers of our Go API.
1340
- The Controller Runtime version used by Cluster API is v0.22.x
1441
- The version of the Kubernetes libraries used by Cluster API is v1.34.x
1542

16-
## Changes by Kind
43+
## Implemented proposal
1744

18-
### Deprecation
45+
The following proposal have been implemented in the Cluster API v1.12 release:
46+
- [In-place updates](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240807-in-place-updates.md)
47+
- [Chained and efficient upgrades](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20250513-chained-and-efficient-upgrades-for-clusters-with-managed-topologies.md)
48+
- [Taint propagation](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20250513-propogate-taints.md) (Only phase 1)
1949

20-
### Removals
50+
## API Changes
2151

22-
* The `controlplane.cluster.x-k8s.io/kubeadm-cluster-configuration` annotation that KCP was previously setting on Machines has been removed.
23-
KCP used this annotation to detect if a Machine requires a rollout, this is now done via the KubeadmConfig of the Machine instead.
52+
### Cluster
2453

25-
### API Changes
54+
- The new `spec.topology.controlPlane.healthCheck.checks.unhealthyMachineConditions` field has been added
55+
- The new `spec.topology.workers.machineDeployments[].healthCheck.checks.unhealthyMachineConditions` field has been added
56+
- The `TopologyReconciled` condition reports new `ClusterCreating` and `ClusterUpgrading` reasons
57+
- The following reasons for the `TopologyReconciled` condition are now deprecated
58+
- `ControlPlaneUpgradePending`
59+
- `MachineDeploymentsCreatePending`
60+
- `MachineDeploymentsUpgradePending`
61+
- `MachinePoolsUpgradePending`
62+
- `MachinePoolsCreatePending`
63+
- `LifecycleHookBlocking`
64+
65+
### Machine
2666

27-
### Other
67+
- The new `spec.taint` field has been added.
68+
- The `HealthCheckSucceeded` condition reports a new `UnhealthyMachine` reason when `unhealthyMachineConditions` checks fail
69+
- The `UpToDate` condition reports a new `Updating` reason when a machine is performing in-place updates
70+
- The new `Updating` condition has been added. It reports status `true` when a machine is performing in-place updates.
71+
- Supported reasons are `NotUpdating`, `InPlaceUpdating`, `InPlaceUpdateFailed`
72+
- The field `status.phases` reports a new `Updating` phase when a machine is performing in-place updates
2873

29-
* `util.IsOwnedByObject`, `util.IsControlledBy` and `collections.OwnedMachines` now also require `schema.GroupKind` as input parameter.
30-
`schema.GroupKind` is needed for cases where typed objects are passed in because controller-runtime does not guarantee that GVK is set on typed objects.
31-
* Various Cluster API e2e tests with Kubernetes upgrades now use the `wait-control-plane-upgrade` and `wait-machine-deployment-upgrade` timeouts.
32-
If you are running Cluster API e2e tests with upgrades you have to configure the timeouts in your e2e test configuration file, otherwise
33-
the e2e tests will use `1s` timeout which will lead to test failures. Example:
34-
```yaml
35-
default/wait-control-plane-upgrade: ["15m", "10s"]
36-
default/wait-machine-deployment-upgrade: ["10m", "10s"]
37-
```
74+
### MachineDeployment
75+
76+
MachineDeployment `spec.template.spec` has been aligned to changes in the [Machine](#machine) `spec` struct
77+
78+
### MachineSet
79+
80+
MachineSet `spec.template.spec` has been aligned to changes in the [Machine](#machine) `spec` struct
81+
82+
### MachinePool
83+
84+
MachinePool `spec.template.spec` has been aligned to changes in the [Machine](#machine) `spec` struct
85+
86+
### MachineHealthCheck
87+
88+
- The new `spec.checks.unhealthyMachineConditions` field has been added
89+
90+
### ClusterClass
91+
92+
- The new `spec.controlPlane.healthCheck.checks.unhealthyMachineConditions` field has been added
93+
- The new `spec.workers.machineDeployments[].healthCheck.checks.unhealthyMachineConditions` field has been added
94+
- The new `spec.upgrade` field has been added
95+
- The new `spec.kubernetesVersions` field has been added
96+
97+
### KubeadmConfig
98+
99+
- The new `spec.clusterConfiguration.encryptionAlgorithm` field has been added
100+
101+
### KubeadmConfigTemplate
102+
103+
KubeadmConfigTemplate `spec.template.spec` has been aligned to changes in the [KubeadmConfig](#kubeadmconfig) `spec` struct
104+
105+
### KubeadmControlPlane
106+
107+
KubeadmControlPlane `spec.kubeadmConfigSpec` has been aligned to changes in the [KubeadmConfig](#kubeadmconfig) `spec` struct
38108

39-
### Suggested changes for providers
109+
### KubeadmControlPlaneTemplate
40110

41-
* For providers that copied the core Cluster API v1beta1 `APIEndpoint` struct and used it in their InfraCluster Go type
42-
it is recommended to now make the `Host` and `Port` fields optional (they already have been made optional in
111+
KubeadmControlPlaneTemplate `spec.template.spec` has been aligned to changes in the [KubeadmControlPlane](#kubeadmcontrolplane) `spec` struct
112+
113+
## Runtime hooks Changes
114+
115+
- Lifecycle hooks
116+
- The request message for the `BeforeClusterUpgrade` hook has been extended to include info about the upgrade plan.
117+
- The new `BeforeControlPlaneUpgrade` hook has been added; the hook is called before each "upgrade control plane" step;
118+
- The request message for the `AfterControlPlaneUpgrade` hook have been extended to include info about the upgrade plan.
119+
- The `AfterControlPlaneUpgrade` hook is now called after each "upgrade control plane" step.
120+
- The new `BeforeWorkersUpgrade`, `AfterWorkersUpgrade` hooks have been added; the hooks are called before/after each "upgrade workers" step
121+
- The `AfterClusterUpgrade` has been transformed into a blocking hook (it blocks next upgrade)
122+
- Upgrade plan hooks (new!)
123+
- The new `GenerateUpgradePlan` has been added; the hook is called by the topology controller when it is required
124+
to compute the upgrade plan for a cluster.
125+
- In-place extension hooks (new!)
126+
- the new `CanUpdateMachine` hook has been added; the hook is called by the KubeadmControlPlane controller to perform the
127+
"can update in-place" decision for a machine that is not up-to-date.
128+
- the new `CanUpdateMachineSet` hook has been added; the hook is called by the MachineDeployment controller to perform the
129+
"can update in-place" decision for a MachineSet that is not up-to-date.
130+
- the new `UpdateMachine` hook has been added; the hook is called by the Machine controller to perform in-place upgrades.
131+
- Some optimization have been implemented to ensure that hooks are called only when necessary.
132+
- e.g. if a lifecycle hook response, e.g. the `BeforeClusterUpgradeResponse`, informs CAPI to retry after X seconds,
133+
CAPI is going to not call the runtime extension until X expires, no matter if the underlying controller reconciles
134+
one or more times in the between.
135+
- `GenerateUpgradePlan`, `CanUpdateMachine`, `CanUpdateMachineSet` hooks will use slightly different caching strategy.
136+
137+
## Cluster API Contract changes
138+
139+
- Documentation for the [MachinePool](../contracts/infra-machinepool.md) contract has been aligned to the documentation
140+
of other contracts.
141+
- We strongly recommend all the MachinePool providers to read carefully this document and check compliance with
142+
the updated definition of the contract rules.
143+
144+
## Deprecation
145+
146+
- The following reasons for the `TopologyReconciled` condition on the `Cluster`object are now deprecated
147+
- `ControlPlaneUpgradePending`
148+
- `MachineDeploymentsCreatePending`
149+
- `MachineDeploymentsUpgradePending`
150+
- `MachinePoolsUpgradePending`
151+
- `MachinePoolsCreatePending`
152+
- `LifecycleHookBlocking`
153+
154+
## Removals
155+
156+
- The `controlplane.cluster.x-k8s.io/kubeadm-cluster-configuration` annotation that KCP was previously setting on Machines has been removed.
157+
KCP used this annotation to detect if a Machine requires a rollout, this is now done via the KubeadmConfig of the Machine instead.
158+
159+
## Suggested changes for providers
160+
161+
- For providers that copied the core Cluster API v1beta1 `APIEndpoint` struct and used it in their InfraCluster
162+
or ControlPlane Go type it is recommended to now make the `Host` and `Port` fields optional (they already have been made optional in
43163
`clusterv1beta1.APIEndpoint` in Cluster API v1.12).
44164
tl;dr The fields were previously required, but due to side effects that validation was never enforced. These side
45165
effects might go away which then makes the fields suddenly required. To avoid issues we recommend making the fields
46166
optional. Similar to how they are optional in the v1beta2 `APIEndpoint` struct and v1beta2 InfraCluster contract.
47167
For more details, please see: https://github.com/kubernetes-sigs/cluster-api/pull/12634#discussion_r2275468291.
48-
But this might look differently depending on how your InfraCluster Go type and corresponding mutating webhook evolved over time.
168+
But this might look differently depending on how your InfraCluster/ControlPlane Go type and corresponding
169+
mutating webhook evolved over time.
170+
171+
- We strongly recommend all the MachinePool providers to read carefully the [MachinePool](../contracts/infra-machinepool.md) contract
172+
and check compliance with the updated definition of the contract rules.
173+
174+
- We strongly recommend providers to start moving to the new v1beta2 version of the Cluster API contract as soon as possible.
175+
- v1beta1 version of the Cluster API contract is now deprecated and it will be removed tentatively in August 2026:
176+
- In order to ease the transition to the new v1beta2 version of the Cluster API contract, v1beta2 version
177+
will implement temporarily compatibility with the deprecated v1beta1 version of the Cluster API contract
178+
- Compatibility is only intended to ease the transition for providers, and it has some limitations; please
179+
read details in following paragraphs.
180+
- Compatibility support for the v1beta1 version of the Cluster API contract will be removed tentatively in August 2026
181+
- After compatibility support for the v1beta1 version of the Cluster API contract is removed, providers
182+
which are implementing the v1beta1 contract will stop to work (they will work only with older versions of Cluster API).
183+
184+
- Various Cluster API e2e tests with Kubernetes upgrades now use the `wait-control-plane-upgrade` and `wait-machine-deployment-upgrade` timeouts.
185+
If you are running Cluster API e2e tests with upgrades you have to configure the timeouts in your e2e test configuration file, otherwise
186+
the e2e tests will use `1s` timeout which will lead to test failures. Example:
187+
```yaml
188+
default/wait-control-plane-upgrade: ["15m", "10s"]
189+
default/wait-machine-deployment-upgrade: ["10m", "10s"]
190+
```
191+
192+
- Reconciler rate limiting feature has been introduced ([#13006](https://github.com/kubernetes-sigs/cluster-api/pull/13006))
193+
- Can be enabled with the new `ReconcilerRateLimiting` feature gate
194+
- It rate-limits all reconcilers to at most 1 request per second
195+
196+
- `util.IsOwnedByObject`, `util.IsControlledBy` and `collections.OwnedMachines` now also require `schema.GroupKind` as input parameter.
197+
`schema.GroupKind` is needed for cases where typed objects are passed in because controller-runtime does not guarantee that GVK is set on typed objects.
198+
199+
## Removals scheduled for future releases
200+
201+
As documented in [Suggested changes for providers](#suggested-changes-for-providers), it is highly recommended to start planning for future removals:
202+
203+
- v1beta1 API version will be removed tentatively in August 2026
204+
- Starting from the CAPI release when v1beta1 removal will happen (tentative Aug 2026), the Cluster API project
205+
will remove the Cluster API condition type, the `util/conditions/deprecated/v1beta1` package,
206+
the `util/deprecated/v1beta1` package, the code handling old conditions in `util/patch.Helper`
207+
and everything related to the custom Cluster API custom condition type.
208+
- All the `status.deprecated` fields will be removed tentatively in August 2026.
209+
- Compatibility support for the v1beta1 version of the Cluster API contract will be removed tentatively in August 2026

0 commit comments

Comments
 (0)