|
1 | 1 | # Cluster API v1.10 compared to v1.11
|
2 | 2 |
|
3 | 3 | 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) |
5 | 10 |
|
6 | 11 | Any feedback or contributions to improve following documentation is welcome!
|
7 | 12 |
|
@@ -41,6 +46,8 @@ proposal because most of the changes described below are a consequence of the wo
|
41 | 46 | * [Deprecations](#deprecations)
|
42 | 47 | * [clusterctl changes](#clusterctl-changes)
|
43 | 48 | * [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) |
44 | 51 | * [Suggested changes for providers](#suggested-changes-for-providers)
|
45 | 52 | * [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)
|
46 | 53 | * [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
|
110 | 117 | - Additionally, fields inferred from top level objects have been removed, thus getting rid of a common source of confusion/issues.
|
111 | 118 | - Compliance with K8s API guidelines:
|
112 | 119 | - 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. |
114 | 123 | - All `bool` fields have been changed to `*bool` to preserve user intent.
|
115 | 124 | - Extensive work has been done to ensure `required` and `optional` is explicitly set in the API, and that
|
116 | 125 | both serialization and validation works accordingly:
|
@@ -2711,7 +2720,14 @@ As documented in [Suggested changes for providers](#suggested-changes-for-provid
|
2711 | 2720 | and everything related to the custom Cluster API custom condition type.
|
2712 | 2721 | - Compatibility support for the v1beta1 version of the Cluster API contract will be removed tentatively in August 2026
|
2713 | 2722 |
|
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 |
2715 | 2731 |
|
2716 | 2732 | - We highly recommend providers to start using Cluster API v1beta2 types when bumping to CAPI v1.11.
|
2717 | 2733 | This requires changing following import:
|
@@ -2744,7 +2760,37 @@ As documented in [Suggested changes for providers](#suggested-changes-for-provid
|
2744 | 2760 | Last but not least, please be aware that given the issues above, this approach was not tested during the implementation,
|
2745 | 2761 | and we don't know if there are road blockers.
|
2746 | 2762 |
|
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 |
2748 | 2794 | on the Cluster object, we highly recommend providers to use new conditions instead of old ones.
|
2749 | 2795 | Utils for working with new conditions ara available in the `sigs.k8s.io/cluster-api/util/conditions` package.
|
2750 | 2796 | - 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
|
2823 | 2869 | We highly recommend providers to start planning the move to the new v1beta2 version of the Cluster API contract as soon
|
2824 | 2870 | as possible.
|
2825 | 2871 |
|
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: |
2827 | 2873 | 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.
|
2828 | 2874 | - In most cases, v1beta2 contract introduced changes in the `initialization completed`, `conditions`, `terminal failures` rules;
|
2829 | 2875 | 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 |
2830 | 2878 | 2. While implementing the changes above, It is also highly recommended to check the implementation of all the other rules
|
2831 | 2879 | (documentation for contract rules have been improved in recent releases, worth to take a look!).
|
2832 | 2880 | 3. Change the CRD annotation that document which Cluster API contract is implemented by your Provider. e.g.
|
|
0 commit comments