You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
đź“– Chained and efficient upgrades for Clusters with managed topologies (#12199)
* Chained and efficient upgrades for Clusters with managed topologies
* Address feedback
* More feedback
* Tmp
# Conflicts:
# docs/proposals/20210526-cluster-class-and-managed-topologies.md
* Drop changes to user facing docs
* Small fixes
* Fix broken links
* Fix review findings
* More feedback
* More feedback
---------
Co-authored-by: Stefan Bueringer <[email protected]>
Copy file name to clipboardExpand all lines: docs/book/src/tasks/experimental-features/runtime-sdk/implement-lifecycle-hooks.md
+3-20Lines changed: 3 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,9 @@ Following recommendations are especially relevant:
35
35
36
36
## Definitions
37
37
38
+
For additional details about the OpenAPI spec of the lifecycle hooks, please download the [`runtime-sdk-openapi.yaml`]({{#releaselink repo:"https://github.com/kubernetes-sigs/cluster-api" gomodule:"sigs.k8s.io/cluster-api" asset:"runtime-sdk-openapi.yaml" version:"1.11.x"}})
39
+
file and then open it from the [Swagger UI](https://editor.swagger.io/).
40
+
38
41
### BeforeClusterCreate
39
42
40
43
This hook is called after the Cluster object has been created by the user, immediately before all the objects which
@@ -69,8 +72,6 @@ message: "error message if status == Failure"
69
72
retryAfterSeconds: 10
70
73
```
71
74
72
-
For additional details, you can see the full schema in <button onclick="openSwaggerUI()">Swagger UI</button>.
73
-
74
75
(*) The objects which are part of a Cluster topology are the infrastructure Cluster, the Control Plane, the
75
76
MachineDeployments and the templates derived from the ClusterClass.
76
77
@@ -109,8 +110,6 @@ status: Success # or Failure
109
110
message: "error message if status == Failure"
110
111
```
111
112
112
-
For additional details, you can see the full schema in <button onclick="openSwaggerUI()">Swagger UI</button>.
113
-
114
113
### BeforeClusterUpgrade
115
114
116
115
This hook is called after the Cluster object has been updated with a new `spec.topology.version` by the user, and
@@ -153,8 +152,6 @@ message: "error message if status == Failure"
153
152
retryAfterSeconds: 10
154
153
```
155
154
156
-
For additional details, you can see the full schema in <button onclick="openSwaggerUI()">Swagger UI</button>.
157
-
158
155
(*) Under normal circumstances `spec.topology.version` gets propagated to the control plane immediately; however
159
156
if previous upgrades or worker machine rollouts are still in progress, the system waits for those operations
160
157
to complete before starting the new upgrade.
@@ -201,8 +198,6 @@ message: "error message if status == Failure"
201
198
retryAfterSeconds: 10
202
199
```
203
200
204
-
For additional details, you can see the full schema in <button onclick="openSwaggerUI()">Swagger UI</button>.
205
-
206
201
### AfterClusterUpgrade
207
202
208
203
This hook is called after the Cluster, control plane and workers have been upgraded to the version specified in
@@ -237,8 +232,6 @@ status: Success # or Failure
237
232
message: "error message if status == Failure"
238
233
```
239
234
240
-
For additional details, refer to the [Draft OpenAPI spec](https://editor.swagger.io/?url=https://raw.githubusercontent.com/kubernetes-sigs/cluster-api/main/docs/proposals/images/runtime-hooks/runtime-hooks-openapi.yaml).
241
-
242
235
### BeforeClusterDelete
243
236
244
237
This hook is called after the Cluster deletion has been triggered by the user and immediately before the topology
@@ -272,13 +265,3 @@ status: Success # or Failure
272
265
message: "error message if status == Failure"
273
266
retryAfterSeconds: 10
274
267
```
275
-
276
-
For additional details, you can see the full schema in <button onclick="openSwaggerUI()">Swagger UI</button>.
277
-
278
-
<script>
279
-
// openSwaggerUI calculates the absolute URL of the RuntimeSDK YAML file and opens Swagger UI.
280
-
function openSwaggerUI() {
281
-
var schemaURL = new URL("runtime-sdk-openapi.yaml", document.baseURI).href
Copy file name to clipboardExpand all lines: docs/proposals/20210526-cluster-class-and-managed-topologies.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ If instead you are eager to see an example of ClusterClass and how the Cluster o
188
188
189
189
The ClusterClass CRD allows to define a collection of templates that describe the topology for one or more clusters.
190
190
191
-
The detailed definition of this type can be found at [ClusterClass CRD reference](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api/cluster.x-k8s.io/ClusterClass/v1beta1);
191
+
The detailed definition of this type can be found at [ClusterClass CRD reference](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api/cluster.x-k8s.io/ClusterClass/v1beta2);
192
192
at high level the new CRD contains:
193
193
194
194
- The reference to the InfrastructureCluster template (e.g. AWSClusterTemplate) to be used when creating a Cluster using this ClusterClass
@@ -209,6 +209,8 @@ at high level the new CRD contains:
209
209
- A list of patches, allowing to change above templates for each specific Cluster.
210
210
- A list of variable definitions, defining a set of additional values the users can provide on each specific cluster;
211
211
those values can be used in patches.
212
+
- A list of Kubernetes versions to be used when performing chained upgrades for clusters using this Cluster class, see
213
+
[proposal: Chained and efficient upgrades for Clusters with managed topologies](20250513-chained-and-efficient-upgrades-for-clusters-with-managed-topologies.md).
212
214
213
215
The following paragraph provides some additional context on some of the above values; more info can
214
216
be found in [writing a ClusterClass](https://cluster-api.sigs.k8s.io/tasks/experimental-features/cluster-class/write-clusterclass.html).
@@ -241,7 +243,7 @@ providing generic information about the cluster or the template being patched.
241
243
242
244
##### Cluster
243
245
244
-
The [Cluster CRD](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api/cluster.x-k8s.io/Cluster/v1beta1) has been extended
246
+
The [Cluster CRD](https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api/cluster.x-k8s.io/Cluster/v1beta2) has been extended
245
247
with a new field allowing to define and control the cluster topology from a single point.
see [proposal: Chained and efficient upgrades for Clusters with managed topologies](20250513-chained-and-efficient-upgrades-for-clusters-with-managed-topologies.md) for more options
393
+
for configuring Kubernetes version upgrade of clusters using managed topologies.
382
394
383
395
2. User creates a cluster using the class name and defining the topology.
384
396
```yaml
@@ -433,6 +445,9 @@ This section talks about updating a Cluster which was created using a `ClusterCl
433
445
434
446

435
447
448
+
see [proposal: Chained and efficient upgrades for Clusters with managed topologies](20250513-chained-and-efficient-upgrades-for-clusters-with-managed-topologies.md)
449
+
for more considerations about Kubernetes version upgrade of clusters using managed topologies.
450
+
436
451
#### Behavior with patches
437
452
438
453
This section highlights how the basic behavior discussed above changes when patches are used. This is an important use case because without
@@ -485,6 +500,9 @@ like e.g. a different HTTP proxy configuration, a different image to be used for
485
500
valueFrom:
486
501
variable: machineType
487
502
```
503
+
504
+
See [proposal: topology mutation hook](20220330-topology-mutation-hook.md) for a powerful alternative to
505
+
inline patches.
488
506
489
507
##### Create a new Cluster with patches
490
508
@@ -581,7 +599,8 @@ In this cases for ServerSideApply to work properly it is required to ensure the
581
599
type definitions, like +MapType or +MapTypeKey, see [merge strategy](https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy) for more details.
582
600
583
601
Note: in order to allow the topology controller to execute templates rotation only when strictly necessary, it is necessary
584
-
to implement specific handling of dry run operations in the templates webhooks as described in [Required Changes on providers from 1.1 to 1.2](https://release-1-8.cluster-api.sigs.k8s.io/developer/providers/migrations/v1.1-to-v1.2#required-api-changes-for-providers).
602
+
to implement specific handling of dry run operations in the templates webhooks as described in the Cluster API contract, see
603
+
e.g. [InfraMachineTemplate: support for SSA dry run](https://cluster-api.sigs.k8s.io/developer/providers/contracts/infra-machine#inframachinetemplate-support-for-ssa-dry-run).
585
604
586
605
### Risks and Mitigations
587
606
@@ -613,6 +632,7 @@ The initial plan is to rollout Cluster Class and support for managed topologies
613
632
- 10/04/2021: Added support for patches and variables
614
633
- 01/10/2022: Added support for MachineHealthChecks
615
634
- 12/20/2022: Cleaned up outdated implementation details by linking the book's pages instead. This will make it easier to keep the proposal up to date.
635
+
- 05/13/2025: Added support for Upgrade Plans; see [proposal: Chained and efficient upgrades for Clusters with managed topologies](20250513-chained-and-efficient-upgrades-for-clusters-with-managed-topologies.md)
0 commit comments