-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Which component are you using?:
/area cluster-autoscaler
What version of the component are you using?:
Component version: cluster-autoscaler-1.33.0
What k8s version are you using (kubectl version
)?: 1.33
What environment is this in?:
clusterapi, with the cluster-api vsphere provider.
What did you expect to happen?:
scale from zero should work.
What happened instead?:
it did not scale from zero. no new nodes were made.
How to reproduce it (as minimally and precisely as possible):
configure cluster-api provider for CA, then create a MachineDeployment with 0 replicas. add a workload that targets the nodes created by the MachineDeployment.
Anything else we need to know?:
this is happening because of a difference between how a Machine's infrastructureRef
field has changed from v1beta1 to v1beta2.
v1beta1 definition uses the core ObjectRef, see https://github.com/kubernetes-sigs/cluster-api/blob/main/api/core/v1beta1/machine_types.go#L396
v1beta2 definition uses an internal type for the reference, see https://github.com/kubernetes-sigs/cluster-api/blob/main/api/core/v1beta2/common_types.go#L361-L387
whereas the current code in CA does not account for this difference, see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_unstructured.go#L378