kubernetes-sigs/cluster-api
在 GitHub 查看Setting `md.spec.paused` to `true` should fully pause the MachineDeployment
Open
#8,629 建立於 2023年5月10日
help wantedkind/bugpriority/important-longtermtriage/accepted
倉庫指標
- Star
- (4,267 star)
- PR 合併指標
- (PR 指標待抓取)
描述
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.