Description
Changing a topology variable that patches a CloudscaleMachineTemplate field (e.g. cloudscaleWorkerMachineFlavor) breaks CAPI reconciliation on ClusterClass-based clusters.
Error
error reconciling the Cluster topology: failed to reconcile MachineDeployment dev/dev-01-md-0-xxxxx: failed to create patch helper for CloudscaleMachineTemplate dev/dev-01-md-0-xxxxx: server side apply dry-run failed for modified object: admission webhook "vcloudscalemachinetemplate-v1beta2.kb.io" denied the request: CloudscaleMachineTemplate.infrastructure.cluster.x-k8s.io "dev-01-md-0-xxxxx" is invalid: spec.template.spec: Forbidden: field is immutable
Environment
- CAPCS version: v1.0.1
- CAPI version: v1.13.4
- Kubernetes version: v1.35.6
Steps to reproduce
- Create a cluster.
- After the cluster is fully provisioned, change the variable value in Cluster.spec.topology.variables (e.g. change flavor from flex-8-4 to flex-16-8) and apply.
- Observe the CAPI controller log — it immediately enters a retry loop with the error above.
No new CloudscaleMachineTemplate is created; no MachineDeployment rollout is triggered.
Expected behavior
CAPI creates a new CloudscaleMachineTemplate, updates the MachineDeployment reference, and triggers a rolling node replacement automatically.
Actual behavior
Cluster is not being reconciled and no new nodes are provisioned.
Notes
You mentioned some limitations here: https://github.com/cloudscale-ch/cluster-api-provider-cloudscale/blob/main/docs/troubleshooting.md#webhook-validation-common-rejections
Should this also apply to CloudscaleMachineTemplate? And if yes, how can I change the Flavor of a running Cluster?
Description
Changing a topology variable that patches a CloudscaleMachineTemplate field (e.g. cloudscaleWorkerMachineFlavor) breaks CAPI reconciliation on ClusterClass-based clusters.
Error
error reconciling the Cluster topology: failed to reconcile MachineDeployment dev/dev-01-md-0-xxxxx: failed to create patch helper for CloudscaleMachineTemplate dev/dev-01-md-0-xxxxx: server side apply dry-run failed for modified object: admission webhook "vcloudscalemachinetemplate-v1beta2.kb.io" denied the request: CloudscaleMachineTemplate.infrastructure.cluster.x-k8s.io "dev-01-md-0-xxxxx" is invalid: spec.template.spec: Forbidden: field is immutableEnvironment
Steps to reproduce
No new CloudscaleMachineTemplate is created; no MachineDeployment rollout is triggered.
Expected behavior
CAPI creates a new CloudscaleMachineTemplate, updates the MachineDeployment reference, and triggers a rolling node replacement automatically.
Actual behavior
Cluster is not being reconciled and no new nodes are provisioned.
Notes
You mentioned some limitations here: https://github.com/cloudscale-ch/cluster-api-provider-cloudscale/blob/main/docs/troubleshooting.md#webhook-validation-common-rejections
Should this also apply to CloudscaleMachineTemplate? And if yes, how can I change the Flavor of a running Cluster?