✨feat: Add machineNaming support to ClusterClass and Cluster topology - #13701
✨feat: Add machineNaming support to ClusterClass and Cluster topology#13701sats-23 wants to merge 4 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Expose the machineNaming field from MachineDeploymentSpec in ClusterClass and Cluster topology to allow topology-managed clusters to customize Machine names within MachineDeployments. Changes: - Add machineNaming field to v1beta1 MachineDeploymentClass and MachineDeploymentTopology - Add machineNaming field to v1beta2 MachineDeploymentClass and MachineDeploymentTopology - Implement v1beta1 ↔ v1beta2 conversion logic for machineNaming fields - Add controller logic to compute and apply machineNaming from topology/class to MachineDeployments Signed-off-by: Sathvik <Sathvik.S@ibm.com>
topology webhooks to ensure templates are valid before resources are created.
Changes:
- Add validateMachineNamingStrategies() to ClusterClass webhook
- Add validateTopologyMachineNaming() to Cluster webhook
- Validate template contains required {{ .random }} variable
- Validate generated names are valid DNS-1123 subdomains
- Integrate validation into existing webhook flows
The validation ensures that machineNaming templates defined in
MachineDeploymentClass (ClusterClass defaults) and MachineDeploymentTopology
(Cluster overrides) will generate valid Kubernetes object names.
Signed-off-by: Sathvik <Sathvik.S@ibm.com>
Signed-off-by: Sathvik <Sathvik.S@ibm.com>
Signed-off-by: Sathvik <Sathvik.S@ibm.com>
|
/cc @fabriziopandini |
|
@sats-23 Could you please clarify whether this PR or your replies were written using an AI tool? If yes, please follow: kubernetes.dev/docs/guide/pull-requests#ai-guidance |
Hey @sbueringer, the PR was curated with the help of Bob, but I have thoroughly reviewed and tested the code myself. |
|
PR needs rebase. DetailsInstructions 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-sigs/prow repository. |
What this PR does / why we need it:
Adds support for customizing Machine names within topology-managed MachineDeployments by exposing the
machineNamingfield from MachineDeploymentSpec in ClusterClass and Cluster topology.Changes
API Changes
machineNamingfield to v1beta1 and v1beta2MachineDeploymentClassandMachineDeploymentTopologymachineNamingfieldsController Changes
machineNamingfrom topology/class to MachineDeploymentsValidation
validateMachineNamingStrategies()to ClusterClass webhookvalidateTopologyMachineNaming()to Cluster webhook{{ .random }}variableTesting & Documentation
The validation ensures that machineNaming templates defined in MachineDeploymentClass (ClusterClass defaults) and MachineDeploymentTopology (Cluster overrides) will generate valid Kubernetes object names before resources are created.
Which issue(s) this PR fixes:
Fixes #13540
/area clusterclass
/area machinedeployment
This PR was curated with the help of Bob (AI IDE)