Setting `md.spec.paused` to `true` should fully pause the MachineDeployment
#8,629 opened on May 10, 2023
Repository metrics
- Stars
- (4,267 stars)
- PR merge metrics
- (PR metrics pending)
Description
What steps did you take and what happened?
- Create a legacy cluster with 1 MD
- Set
.spec.pausedof the MD totrue - Edit the MD to change
md.spec.replicas
The MachineDeployment scales and creates new Machines.
What did you expect to happen?
Pausing the MachineDeployment should fully pause its reconciliation.
Looking at the MachineDeployment reconciler code the following is the piece of code responsible for this behavior. We still sync the MD even if the MD is paused.
/internal/controllers/machinedeployment/machinedeployment_controller.go#L266-L268
if md.Spec.Paused {
return ctrl.Result{}, r.sync(ctx, md, msList)
}
Additional notes:
- Setting
md.spec.pausedtotruewill not create a new MS but will still reconcile changes that do no need a rollout. - Setting the
cluster.x-k8s.io/pausedannotation will pause the MD completely.
It is better to have consistent behavior and and fully pause MD reconciliation if md.spec.paused is set to true.
Cluster API version
main
Kubernetes version
No response
Anything else you would like to add?
No response
Label(s) to be applied
/kind bug One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.