Skip to content

Commit 6fe4406

Browse files
authored
Merge pull request #12571 from sbueringer/pr-improve-migration-doc
📖 Improve v1.10-to-v1.11 migration doc
2 parents ee601cf + 2465898 commit 6fe4406

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

docs/book/src/developer/providers/migrations/v1.10-to-v1.11.md

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Cluster API v1.10 compared to v1.11
22

33
This document provides an overview over relevant changes between Cluster API v1.10 and v1.11 for
4-
maintainers of providers and consumers of our Go API.
4+
all Cluster API users. The document has the following sections:
5+
* A detailed list about [API changes](#api-changes) and [contract changes](#cluster-api-contract-changes)
6+
* Recommendations for different kind of CAPI users:
7+
* [Recommendation for everyone](#recommendation-for-everyone)
8+
* [Suggested changes for clients using Cluster API Go types](#suggested-changes-for-clients-using-cluster-api-go-types)
9+
* [Suggested changes for providers](#suggested-changes-for-providers)
510

611
Any feedback or contributions to improve following documentation is welcome!
712

@@ -41,6 +46,8 @@ proposal because most of the changes described below are a consequence of the wo
4146
* [Deprecations](#deprecations)
4247
* [clusterctl changes](#clusterctl-changes)
4348
* [Removals scheduled for future releases](#removals-scheduled-for-future-releases)
49+
* [Recommendation for everyone](#recommendation-for-everyone)
50+
* [Suggested changes for clients using Cluster API Go types](#suggested-changes-for-clients-using-cluster-api-go-types)
4451
* [Suggested changes for providers](#suggested-changes-for-providers)
4552
* [How to bump to CAPI V1.11 but keep implementing the deprecated v1beta1 contract](#how-to-bump-to-capi-v111-but-keep-implementing-the-deprecated-v1beta1-contract)
4653
* [How to implement the new v1beta2 contract](#how-to-implement-the-new-v1beta2-contract)
@@ -110,7 +117,9 @@ When looking at API changes introduced in the v1beta2 API version for each CRD i
110117
- Additionally, fields inferred from top level objects have been removed, thus getting rid of a common source of confusion/issues.
111118
- Compliance with K8s API guidelines:
112119
- Thanks to the adoption of the [KAL linter](https://github.com/kubernetes-sigs/kube-api-linter) compliance with K8s API guidelines has been greatly improved.
113-
- All Duration fields are now represented as `*int32` fields with units being part of the field name.
120+
- All `metav1.Duration` fields (e.g. `nodeDeletionTimeout`) are now represented as `*int32` fields with units being part of the field name (e.g. `nodeDeletionTimeoutSeconds`).
121+
- A side effect of this is that if durations were specified on a sub-second granularity conversion will truncate to seconds.
122+
E.g. this means if you apply a v1beta1 object with `nodeDeletionTimeout: 1s5ms` only `1s` will be stored and returned on reads.
114123
- All `bool` fields have been changed to `*bool` to preserve user intent.
115124
- Extensive work has been done to ensure `required` and `optional` is explicitly set in the API, and that
116125
both serialization and validation works accordingly:
@@ -2711,7 +2720,14 @@ As documented in [Suggested changes for providers](#suggested-changes-for-provid
27112720
and everything related to the custom Cluster API custom condition type.
27122721
- Compatibility support for the v1beta1 version of the Cluster API contract will be removed tentatively in August 2026
27132722

2714-
## Suggested changes for providers
2723+
## Recommendation for everyone
2724+
2725+
- As a general recommendation we suggest to upgrade first to CAPI v1.10 before moving to CAPI v1.11 / v1beta2.
2726+
- v1.10 introduced additional field validation on API fields.
2727+
- Upgrading to v1.10 allows you to first address potential issues with existing invalid field values
2728+
before picking up CAPI v1.11 / v1beta2, which will start converting v1beta1 objects to v1beta2 objects.
2729+
2730+
## Suggested changes for clients using Cluster API Go types
27152731

27162732
- We highly recommend providers to start using Cluster API v1beta2 types when bumping to CAPI v1.11.
27172733
This requires changing following import:
@@ -2744,7 +2760,37 @@ As documented in [Suggested changes for providers](#suggested-changes-for-provid
27442760
Last but not least, please be aware that given the issues above, this approach was not tested during the implementation,
27452761
and we don't know if there are road blockers.
27462762

2747-
- If providers are using Conditions from Cluster API resources, e.g. by looking at the ControlPlaneInitialized condition
2763+
- If you are using Conditions from Cluster API resources, e.g. by looking at the `ControlPlaneInitialized` condition
2764+
on the Cluster object, we highly recommend clients to use new conditions instead of old ones.
2765+
Utils for working with new conditions ara available in the `sigs.k8s.io/cluster-api/util/conditions` package.
2766+
- To keep using old conditions from the Cluster object, temporarily present under `status.deprecated.v1beta1.conditions`
2767+
it is required to use utils from the `util/conditions/deprecated/v1beta1` package.
2768+
Please note that `status.deprecated.v1beta1.conditions` will be removed tentatively in August 2026.
2769+
2770+
- References on Cluster, KubeadmControlPlane, MachineDeployment, MachinePool, MachineSet and Machine are now using the
2771+
`ContractVersionedObjectReference` type instead of `corev1.ObjectReference`. These references can now be resolved with
2772+
`external.GetObjectFromContractVersionedRef` instead of `external.Get`:
2773+
2774+
```go
2775+
external.GetObjectFromContractVersionedRef(ctx, r.Client, cluster.Spec.InfrastructureRef, cluster.Namespace)
2776+
```
2777+
2778+
- Go clients writing status of core Cluster API objects, should use at least Cluster API v1.9 Go types.
2779+
If that is not possible, avoid updating or patching the entire status field and instead you should patch only individual fields.
2780+
(Cluster API v1.9 introduced `.status.v1beta2` fields that are necessary for lossless v1beta2 => v1beta1 => v1beta2 round trips)
2781+
2782+
- Important! Please pay attention to field removals, e.g. if you are using Go types to write object, either migrate to v1beta2 or make sure
2783+
to stop setting the removed fields. The removed fields won't be preserved even if setting them via v1beta1 Go types.
2784+
2785+
- All `metav1.Duration` fields (e.g. `nodeDeletionTimeout`) are now represented as `*int32` fields with units being part of the field name (e.g. `nodeDeletionTimeoutSeconds`).
2786+
- A side effect of this is that if durations were specified on a sub-second granularity conversion will truncate to seconds.
2787+
E.g. this means if you apply a v1beta1 object with `nodeDeletionTimeout: 1s5ms` only `1s` will be stored and returned on reads.
2788+
2789+
## Suggested changes for providers
2790+
2791+
- All recommendations in [Suggested changes for clients using Cluster API Go types](#suggested-changes-for-clients-using-cluster-api-go-types) also apply to providers.
2792+
2793+
- If providers are using Conditions from Cluster API resources, e.g. by looking at the `ControlPlaneInitialized` condition
27482794
on the Cluster object, we highly recommend providers to use new conditions instead of old ones.
27492795
Utils for working with new conditions ara available in the `sigs.k8s.io/cluster-api/util/conditions` package.
27502796
- To keep using old conditions from the Cluster object, temporarily present under `status.deprecated.v1beta1.conditions`
@@ -2823,10 +2869,12 @@ Please see [Cluster API Contract changes](#cluster-api-contract-changes) and [pr
28232869
We highly recommend providers to start planning the move to the new v1beta2 version of the Cluster API contract as soon
28242870
as possible.
28252871

2826-
Implementing the new v1beta2 contract for providers is a two step operation:
2872+
Implementing the new v1beta2 contract for providers is a multistep operation:
28272873
1. Implement changes defined for a specific provider type; See [Cluster API Contract changes](#cluster-api-contract-changes) and [provider contracts](../contracts/overview.md) for more details.
28282874
- In most cases, v1beta2 contract introduced changes in the `initialization completed`, `conditions`, `terminal failures` rules;
28292875
Also `replicas` rule is changed for control plane providers.
2876+
- If providers are starting to use `api/core/v1beta2/clusterv1.ObjectMeta` in your API types,
2877+
please note that it is necessary to set the `omitzero` JSON marker
28302878
2. While implementing the changes above, It is also highly recommended to check the implementation of all the other rules
28312879
(documentation for contract rules have been improved in recent releases, worth to take a look!).
28322880
3. Change the CRD annotation that document which Cluster API contract is implemented by your Provider. e.g.

0 commit comments

Comments
 (0)