-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 ClusterClass: add ref and controlPlane name builtin variables #6208
🌱 ClusterClass: add ref and controlPlane name builtin variables #6208
Conversation
/cc @CecileRobertMichon @enxebre @fabriziopandini @vincepri @shysank /cherry-pick release-1.1 |
@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.1 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Tested it locally with my limited CAPZ knowhow. Looks like it works, e.g. KCP:
|
8dd9951
to
4001401
Compare
/test pull-cluster-api-e2e-full-main |
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.
only one nit
internal/controllers/topology/cluster/patches/variables/variables_test.go
Show resolved
Hide resolved
Signed-off-by: Stefan Büringer [email protected]
4001401
to
4b91d22
Compare
Tested it locally, it works. Thanks @sbueringer ! |
/lgtm |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@sbueringer: new pull request created: #6215 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Stefan Büringer [email protected]
What this PR does / why we need it:
While writing ClusterClasses for CAPZ, we discovered that additional builtin variables are needed.
CAPZ has a controller which generates secrets which are eventually used for Machines. These secrets then have to be configured in KCP.spec..kubeadmConfigSpec and in KubeadmConfigTemplates.
The secrets are generated with the names of the corresponding current AzureMachineTemplates. So essentially CAPZ has to be able to take the name of the currently referenced AzureMachineTemplate of KCP/MD and then patch KCP / the KubeadmConfigTemplate accordingly.
To make this possible we introduce builtin variables for all references in KCP / MD.
We additionally add
builtin.controlPlane.name
because it seems to be a good variable to have.For additional context, please see this Slack thread: https://kubernetes.slack.com/archives/CEX9HENG7/p1645731252682719
The plan is to cherry-pick this PR to release-1.1 too. This way it will be possible to experiment
with CAPZ ClusterClasses after the next CAPZ and CAPI core release.
This does not block the CAPZ release (because the next CAPZ release won't include cluster-templates using ClusterClasses)
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #