kubernetes-sigs/cluster-api

Setting `md.spec.paused` to `true` should fully pause the MachineDeployment

开放

#8,629 创建于 2023年5月10日

 (20 条评论) (0 个反应) (0 位负责人)Go (1,532 个派生)auto 404
help wantedkind/bugpriority/important-longtermtriage/accepted

仓库指标

星标
 (4,267 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

What steps did you take and what happened?

  • Create a legacy cluster with 1 MD
  • Set .spec.paused of the MD to true
  • 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.paused to true will not create a new MS but will still reconcile changes that do no need a rollout.
  • Setting the cluster.x-k8s.io/paused annotation 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.

贡献者指南