-
Notifications
You must be signed in to change notification settings - Fork 1.5k
📖 document ClusterClass rotation behavior for MachinePool objects #13280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bnallapeta
wants to merge
1
commit into
kubernetes-sigs:main
Choose a base branch
from
bnallapeta:mp/contract
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+70
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,7 @@ To provide feedback or open a discussion about the provider contract please [ope | |
| | [InfraMachinePool: terminal failures] | No | | | ||
| | [InfraMachinePoolTemplate, InfraMachineTemplatePoolList resource definition] | No | Mandatory for ClusterClasses support | | ||
| | [InfraMachinePoolTemplate: support for SSA dry run] | No | Mandatory for ClusterClasses support | | ||
| | [ClusterClass topology controller behavior] | No | Mandatory for ClusterClasses support | | ||
| | [Multi tenancy] | No | Mandatory for clusterctl CLI support | | ||
| | [Clusterctl support] | No | Mandatory for clusterctl CLI support | | ||
|
|
||
|
|
@@ -495,6 +496,36 @@ The implementation requires to use controller runtime's `CustomValidator`, avail | |
| This will allow to skip the immutability check only when the topology controller is dry running while preserving the | ||
| validation behavior for all other cases. | ||
|
|
||
| ### ClusterClass topology controller behavior | ||
|
|
||
| When using ClusterClass and managed topologies, the topology controller creates InfraMachinePool objects from InfraMachinePoolTemplates. | ||
| Unlike templates (which are immutable), these InfraMachinePool objects have mutable specs, but the topology controller | ||
| handles spec changes through a **rotation strategy** rather than in-place updates. | ||
|
|
||
| When the topology controller detects that the InfraMachinePoolTemplate has changed (e.g., from template updates in ClusterClass), it performs | ||
| a **rotation**: | ||
|
|
||
| 1. Creates a new InfraMachinePool object with a new name | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AndiDog @mboersma @richardcase Do we have consensus across InfraMachinePool providers that rotation is the right thing to do here? I would have expected that just in-place updating the InfraMachinePool is much easier to implement for infra providers |
||
| 2. Copies `spec.providerIDList` from the old InfraMachinePool to the new one (to preserve instance tracking) | ||
| 3. Updates the MachinePool's `spec.template.spec.infrastructureRef` to reference the new object | ||
| 4. The old InfraMachinePool is garbage collected when no longer referenced | ||
|
|
||
| <aside class="note"> | ||
|
|
||
| <h1>Provider expectations for rotation</h1> | ||
|
|
||
| Providers SHOULD watch for changes to the MachinePool's `spec.template.spec.infrastructureRef.name` field. | ||
| When the reference name changes, this indicates a rotation has occurred and the provider SHOULD: | ||
|
|
||
| - Use the `spec.providerIDList` from the new InfraMachinePool to identify existing instances | ||
| - Trigger any necessary rollout or reconciliation based on the spec changes | ||
|
|
||
| This pattern is consistent with how MachineDeployments handle InfrastructureMachineTemplate rotations. | ||
|
|
||
| </aside> | ||
|
|
||
| Metadata-only changes (labels, annotations) MUST NOT trigger rotation; they are patched in-place on the existing object. | ||
|
|
||
| ### Multi tenancy | ||
|
|
||
| Multi tenancy in Cluster API defines the capability of an infrastructure provider to manage different credentials, | ||
|
|
@@ -532,6 +563,7 @@ The clusterctl command is designed to work with all the providers compliant with | |
| [InfraMachinePool: terminal failures]: #inframachinepool-terminal-failures | ||
| [InfraMachinePoolTemplate, InfraMachineTemplatePoolList resource definition]: #inframachinepooltemplate-inframachinetemplatepoollist-resource-definition | ||
| [InfraMachinePoolTemplate: support for SSA dry run]: #inframachinepooltemplate-support-for-ssa-dry-run | ||
| [ClusterClass topology controller behavior]: #clusterclass-topology-controller-behavior | ||
| [MachinePoolMachines support]: #machinepoolmachines-support | ||
| [Multi tenancy]: #multi-tenancy | ||
| [Clusterctl support]: #clusterctl-support | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This page here is a description of the contract for bootstrap providers. I think we should not specify the infrastructure provider contract on this page