Skip to content

Commit 66f9925

Browse files
Add new Rule in the ControlPlane contract
1 parent 595ae83 commit 66f9925

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

docs/book/src/developer/providers/contracts/control-plane.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ repo or add an item to the agenda in the [Cluster API community meeting](https:/
6868
| [ControlPlane: version] | No | Mandatory if control plane allows direct management of the Kubernetes version in use; Mandatory for cluster class support. |
6969
| [ControlPlane: machines] | No | Mandatory if control plane instances are represented with a set of Cluster API Machines. |
7070
| [ControlPlane: initialization completed] | Yes | |
71+
| [ControlPlane: in-place updates] | No | Only supported for control plane providers with control plane machines |
7172
| [ControlPlane: conditions] | No | |
7273
| [ControlPlane: terminal failures] | No | |
7374
| [ControlPlaneTemplate, ControlPlaneTemplateList resource definition] | No | Mandatory for ClusterClasses support |
@@ -616,8 +617,34 @@ the ControlPlane resource will be ignored.
616617

617618
</aside>
618619

619-
### ControlPlane: conditions
620+
### ControlPlane: in-place updates
621+
622+
In case a control plane provider would like to provide support for in-place updates, please check the [proposal](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/20240807-in-place-updates.md).
623+
624+
Supporting in-place updates requires:
625+
- implementing the call for the registered `CanUpdateMachine` hook when performing the "can update in-place" decision.
626+
- when it is decided to perform the in-place decision:
627+
- the machine spec must be updated to the desired state, as well as the spec for the corresponding infrastructure machine and bootstrap config
628+
- while updating those objects also the `in-place-updates.internal.cluster.x-k8s.io/update-in-progress` annotation must be set
629+
- once all objects are updated the `UpdateMachine` hook must be set as pending on the machine object
630+
631+
After above steps are completed, the machine controller will take over and complete the in-place upgrade.
632+
633+
<aside class="note warning">
634+
635+
<h1>High complexity</h1>
620636

637+
Implementing the in-place update transition in a race condition free, re-entrant way is more complex that it might seem.
638+
639+
Please read the proposal's [implementation notes](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240807-in-place-updates-implementation-notes.md)
640+
carefully.
641+
642+
Also, it is highly recommended to use the KCP implementation as a reference.
643+
644+
</aside>
645+
646+
647+
### ControlPlane: conditions
621648

622649
According to [Kubernetes API Conventions], Conditions provide a standard mechanism for higher-level
623650
status reporting from a controller.
@@ -873,7 +900,8 @@ is implemented in ControlPlane controllers:
873900
[ControlPlane: machines]: #controlplane-machines
874901
[In place propagation of changes affecting Kubernetes objects only]: https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20221003-In-place-propagation-of-Kubernetes-objects-only-changes.md
875902
[ControlPlane: version]: #controlplane-version
876-
[ControlPlane: initialization completed]: #controlplane-initialization-completed
903+
[ControlPlane: initialization completed]: #controlplane-initialization-completed
904+
[ControlPlane: in-place updates]: #controlplane-in-place-updates
877905
[ControlPlane: conditions]: #controlplane-conditions
878906
[Kubernetes API Conventions]: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties
879907
[Improving status in CAPI resources]: https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md

0 commit comments

Comments
 (0)