cluster-api: KCP scale broken in capi v0.4.x

What steps did you take and what happened:

Before v0.4.x I can scale kubeadmcontrolplane using kubectl like:

$ kubectl scale kubeadmcontrolplane.controlplane.cluster.x-k8s.io/capg-cluster-control-plane --replicas 3

After v0.4.0-beta.x when scaling kubeadmcontrolplane using kubectl i got an error:

$ kubectl scale kubeadmcontrolplane.controlplane.cluster.x-k8s.io/capg-cluster-control-plane --replicas 3
Error from server: admission webhook "validation.kubeadmcontrolplane.controlplane.cluster.x-k8s.io" denied the request: unable to decode autoscaling/v1, Kind=Scale into *v1alpha4.KubeadmControlPlane

Seem it’s related to subresource validation https://github.com/kubernetes-sigs/cluster-api/pull/4366

What did you expect to happen: kubeadmcontrolplane can be scaled using kubectl as v0.3.x

Anything else you would like to add: This issue only occur when scaling kubeadmcontrolplane through kubectl scale subcommand, otherwise when editing kubeadmcontrolplane .spec.replicas using kubectl edit it works fine

Environment:

  • Cluster-api version: v0.4.0-beta.1
  • Minikube/KIND version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

/kind bug [One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

@sbueringer I don’t think it ever worked. It’s probably best to revert #4366 for now until we can figure out a solution for validating the scale operations.