Skip to content

[CA] [clusterapi] propagated labels from MachineDeployments and MachineSets are not reflected in node templates #8712

@elmiko

Description

@elmiko

Which component are you using?:

/area cluster-autoscaler

What version of the component are you using?:

Component version: main/1.33

What k8s version are you using (kubectl version)?:

1.32/1.33

What environment is this in?:

cluster-api (all capi providers)

What did you expect to happen?:

i expect labels defined by the cluster-api metadata propagation rules to be present in node templates when scaling from zero.

What happened instead?:

my workloads did not cause the autoscaler to scale out as the predicates did not match, this was directly related to the propagated labels not matching (as detected in logs).

How to reproduce it (as minimally and precisely as possible):

  1. setup a MachineDeployment to use a propagated label to the nodes as described here.
  2. configure the MD for scaling from zero, see the readme
  3. set its replicas to 0
  4. create a workload with a node selector on the propagated label
  5. observe

Anything else we need to know?:

these labels are also not specifically added when scaling from 1+ but, they would be on a node in that case. i think we probably need to ensure that the propagated labels are always processed.

this function needs to be updated, https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_unstructured.go#L199-L214

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions