Skip to content

Commit b3e756d

Browse files
Address feedback
1 parent 7ad4ddd commit b3e756d

File tree

8 files changed

+46
-19
lines changed

8 files changed

+46
-19
lines changed

docs/book/src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
- [Implementing Runtime Extensions](./tasks/experimental-features/runtime-sdk/implement-extensions.md)
4040
- [Implementing Lifecycle Hook Extensions](./tasks/experimental-features/runtime-sdk/implement-lifecycle-hooks.md)
4141
- [Implementing Topology Mutation Hook Extensions](./tasks/experimental-features/runtime-sdk/implement-topology-mutation-hook.md)
42-
- [Implementing In-Place Update Hooks Extensions](./tasks/experimental-features/runtime-sdk/implement-in-place-update-hooks.md)
42+
- [Implementing In-place Update Hooks Extensions](./tasks/experimental-features/runtime-sdk/implement-in-place-update-hooks.md)
4343
- [Deploying Runtime Extensions](./tasks/experimental-features/runtime-sdk/deploy-runtime-extension.md)
4444
- [Ignition Bootstrap configuration](./tasks/experimental-features/ignition.md)
4545
- [Running multiple providers](./tasks/multiple-providers.md)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ After above steps are completed, the machine controller will take over and compl
634634

635635
<h1>High complexity</h1>
636636

637-
Implementing the in-place update transition in a race condition free, re-entrant way is more complex that it might seem.
637+
Implementing the in-place update transition in a race condition-free, re-entrant way is more complex than it might seem.
638638

639639
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)
640640
carefully.

docs/book/src/reference/glossary.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ see [Server](#server)
278278

279279
A resource that does not mutate. In Kubernetes we often state the instance of a running pod is immutable or does not change once it is run. In order to make a change, a new pod is run. In the context of [Cluster API](#cluster-api) we often refer to a running instance of a [Machine](#machine) as being immutable, from a [Cluster API](#cluster-api) perspective.
280280

281+
Note: Cluster API also have extensibility points that make it possible to perform [in-place updates](#in-place-update) of machines.
282+
281283
### IPAM provider
282284

283285
Refers to a [provider](#provider) that allows Cluster API to interact with IPAM solutions.

docs/book/src/tasks/experimental-features/experimental-features.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ temporary location for features which will be moved to their permanent locations
55

66
Currently Cluster API has the following experimental features:
77
* `ClusterTopology` (env var: `CLUSTER_TOPOLOGY`): [ClusterClass](./cluster-class/index.md)
8+
* `InPlaceUpdates` (env var: `EXP_IN_PLACE_UPDATES`):
9+
* Allows users to execute changes on existing machines without deleting the machines and creating a new one.
10+
* See the [proposal](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/20240807-in-place-updates.md) for more details.
811
* `KubeadmBootstrapFormatIgnition` (env var: `EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION`): [Ignition](./ignition.md)
912
* `MachinePool` (env var: `EXP_MACHINE_POOL`): [MachinePools](./machine-pools.md)
1013
* `MachineSetPreflightChecks` (env var: `EXP_MACHINE_SET_PREFLIGHT_CHECKS`): [MachineSetPreflightChecks](./machineset-preflight-checks.md)

docs/book/src/tasks/experimental-features/runtime-sdk/implement-in-place-update-hooks.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Please note Runtime SDK is an advanced feature. If implemented incorrectly, a fa
1010

1111
## Introduction
1212

13-
The proposal for [n-place updates in Cluster API](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/20240807-in-place-updates.md)
13+
The proposal for [in-place updates in Cluster API](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/20240807-in-place-updates.md)
1414
introduced extensions allowing users to execute changes on existing machines without deleting the machines and creating a new one.
1515

1616
Notably, the Cluster API user experience remain the same as of today no matter of the in-place update feature is enabled
@@ -19,7 +19,7 @@ or not e.g. in order to trigger a MachineDeployment rollout, you have to rotate
1919
Users should care ONLY about the desired state (as of today).
2020

2121
Cluster API is responsible to choose the best strategy to achieve desired state, and with the introduction of
22-
update extensions, Cluster API is expanding the set of tools Cluster API can use to achieve the desired state.
22+
update extensions, Cluster API is expanding the set of tools that can be used to achieve the desired state.
2323

2424
If external update extensions can not cover the totality of the desired changes, CAPI will fall back to Cluster API’s default,
2525
immutable rollouts.
@@ -35,7 +35,17 @@ options like MaxSurge/MaxUnavailable. With this regard:
3535
is “buffer” for in-place, in-place update can proceed.
3636
- When in-place is possible, the system should try to in-place update as many machines as possible.
3737
In practice, this means that maxSurge might be not fully used (it is used only for scale up by one if maxUnavailable=0).
38-
- No in-place updates are performed for workers machines when using rollout strategy on delete.
38+
- No in-place updates are performed for workers machines when using rollout strategy `OnDelete`.
39+
40+
<aside class="note warning">
41+
42+
<h1>Important!</h1>
43+
44+
Cluster API will call the in-place extensions only if the `InPlaceUpdates` feature flag is enabled.
45+
46+
Also, please note that the current implementation of the [in-place updates proposal](https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/20240807-in-place-updates.md) only allows registering one extension for the `CanUpdateMachine`, `CanUpdateMachineSet` and `UpdateMachine` hooks.
47+
48+
</aside>
3949

4050
<!-- TOC -->
4151
* [Implementing in-place update hooks](#implementing-in-place-update-hooks)
@@ -74,7 +84,7 @@ file and then open it from the [Swagger UI](https://editor.swagger.io/).
7484

7585
This hook is called by KCP when performing the "can update in-place" for a control plane machine.
7686

77-
Example request
87+
Example request:
7888

7989
```yaml
8090
apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
@@ -117,9 +127,9 @@ desired:
117127
Note:
118128
- All the objects will have the latest API version known by Cluster API.
119129
- Only spec is provided, status fields are not included
120-
- When more than one extension will be supported, the current state will already include changes that can handle in-place by other runtime extensions.
130+
- In a future release, when registering more than one extension for the `CanUpdateMachine` will be supported, the current state will already include changes that can be handled in-place by other runtime extensions.
121131

122-
Example Response
132+
Example Response:
123133

124134
```yaml
125135
apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
@@ -145,7 +155,7 @@ Note:
145155
This hook is called by the MachineDeployment controller when performing the "can update in-place" for all the Machines controlled by
146156
a MachineSet.
147157

148-
Example request
158+
Example request:
149159

150160
```yaml
151161
apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
@@ -188,9 +198,9 @@ desired:
188198
Note:
189199
- All the objects will have the latest API version known by Cluster API.
190200
- Only spec is provided, status fields are not included
191-
- When more than one extension will be supported, the current state will already include changes that can handle in-place by other runtime extensions.
201+
- In a future release, when registering more than one extension for the `CanUpdateMachineSet` will be supported, the current state will already include changes that can be handled in-place by other runtime extensions.
192202

193-
Example Response
203+
Example Response:
194204

195205
```yaml
196206
apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
@@ -215,7 +225,7 @@ Note:
215225

216226
This hook is called by the Machine controller when performing the in-place updates for a Machine.
217227

218-
Example request
228+
Example request:
219229

220230
```yaml
221231
apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1
@@ -252,7 +262,7 @@ Note:
252262
- Only desired is provided (the external updater extension should know current state of the Machine).
253263
- Only spec is provided, status fields are not included
254264

255-
Example Response
265+
Example Response:
256266

257267
```yaml
258268
apiVersion: hooks.runtime.cluster.x-k8s.io/v1alpha1

docs/book/src/tasks/experimental-features/runtime-sdk/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ Additional documentation:
3131
* [Implementing Runtime Extensions](./implement-extensions.md)
3232
* [Implementing Lifecycle Hook Extensions](./implement-lifecycle-hooks.md)
3333
* [Implementing Topology Mutation Hook Extensions](./implement-topology-mutation-hook.md)
34-
* [Implementing In-Place Update Hooks Extensions](./implement-in-place-update-hooks.md)
34+
* [Implementing In-place Update Hooks Extensions](./implement-in-place-update-hooks.md)
3535
* For Cluster operators:
3636
* [Deploying Runtime Extensions](./deploy-runtime-extension.md)

docs/book/src/user/concepts.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,24 @@ A "Machine" is the declarative spec for an infrastructure component hosting a Ku
4949

5050
Common fields such as Kubernetes version are modeled as fields on the Machine's spec. Any information that is provider-specific is part of the `InfrastructureRef` and is not portable between different providers.
5151

52-
#### Machine Immutability (In-place Update vs. Replace)
52+
#### Machine Immutability (In-place update vs. Replace)
5353

5454
From the perspective of Cluster API, all Machines are immutable: once they are created, they are never updated (except for labels, annotations and status), only deleted.
5555

5656
For this reason, MachineDeployments are preferable. MachineDeployments handle changes to machines by replacing them, in the same way core Deployments handle changes to Pod specifications.
5757

58+
Over time several improvement have been applied to Cluster API in oder to perform machine rollout only when necessary and
59+
for minimizing risks and impacts of this operation on users workloads.
60+
61+
Starting from Cluster API v1.12, users can intentionally trade off some of the benefits that they get of Machine immutability by
62+
using Cluster API extensions points to add the capability to perform in-place updates under well-defined circumstances.
63+
64+
Notably, the Cluster API user experience will remain the same no matter of the in-place update feature is enabled
65+
or not, because ultimately users should care ONLY about the desired state.
66+
67+
Cluster API is responsible to choose the best strategy to achieve desired state, and with the introduction of
68+
update extensions, Cluster API is expanding the set of tools that can be used to achieve the desired state.
69+
5870
### MachineDeployment
5971

6072
A MachineDeployment provides declarative updates for Machines and MachineSets.

docs/proposals/20240807-in-place-updates.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The responsibility to determine which Machine/MachineSet should be updated, the
165165

166166
We propose to extend KCP and MachineDeployment rollout workflows to call External Update Extensions, if defined.
167167

168-
Initially, this feature will be implemented without making API changes in the current core Cluster API objects. It will follow Kubernetes' feature gate mechanism. All functionality related to In-Place Updates will be available only if the `InPlaceUpdates` feature flag is set to true. It is disabled unless explicitly configured.
168+
Initially, this feature will be implemented without making API changes in the current core Cluster API objects. It will follow Kubernetes' feature gate mechanism. All functionality related to in-place Updates will be available only if the `InPlaceUpdates` feature flag is set to true. It is disabled unless explicitly configured.
169169

170170
This proposal introduces three new Lifecycle Hooks named `CanUpdateMachine`, `CanUpdateMachineSet` and `UpdateMachine` for communication between CAPI and external update implementers.
171171

@@ -269,7 +269,7 @@ With `InPlaceUpdates` feature gate enabled, CAPI controllers will go through the
269269

270270
As a first step, CAPI controllers will compute the set of desired changes (current and desired state).
271271

272-
Then CAPI controllers will then iterate over the registered external updaters, requesting to each updater if it can handle required changes through the `CanUpdateMachineSet` (MachineDeployment) and `CanUpdateMachine` (KCP).
272+
Then CAPI controllers will iterate over the registered external updaters, requesting each updater if it can handle required changes through the `CanUpdateMachineSet` (MachineDeployment) and `CanUpdateMachine` (KCP).
273273

274274
The changes supported by an updater can be the complete set of desired changes, a subset of them or an empty set, signaling it cannot handle any of the desired changes.
275275

@@ -431,11 +431,11 @@ However, in-place updates might cause Nodes to become unhealthy while the update
431431

432432
### Examples
433433

434-
This section aims to showcase our vision for the In-Places Updates end state. It shows a high level picture of a few common use cases, specially around how the different components interact through the API.
434+
This section aims to showcase our vision for the in-place update end state. It shows a high level picture of a few common use cases, specially around how the different components interact through the API.
435435

436436
Note that these examples don't show all the low level details, the examples here are just to help communicate the vision.
437437

438-
Let's imagine a vSphere cluster with a KCP control plane that has two fictional In-Place update extensions already deployed and registered through their respective `ExtensionConfig`.
438+
Let's imagine a vSphere cluster with a KCP control plane that has two fictional in-place update extensions already deployed and registered through their respective `ExtensionConfig`.
439439
1. `vsphere-vm-memory-update`: The extension uses vSphere APIs to hot-add memory to VMs if "Memory Hot Add" is enabled or through a power cycle.
440440
2. `kcp-version-update`: Updates the kubernetes version of KCP machines by using an agent that first updates the kubernetes related packages (`kubeadm`, `kubectl`, etc.) and then runs the `kubeadm upgrade` command. The In-place Update extension communicates with this agent, sending instructions with the kubernetes version a machine needs to be updated to.
441441

0 commit comments

Comments
 (0)