Skip to content

CKS: scaling down by size ignores nodes added with addNodesToKubernetesCluster #14836

In review

Description

@bhouse-nexthop

Problem

A CKS cluster's size counts worker nodes added with addNodesToKubernetesCluster, but scaleKubernetesCluster with size only counts CKS-created workers when picking nodes to remove.

Step Result
Cluster: 1 control, 4 CKS-created workers, 2 added nodes (size = 6)
scaleKubernetesCluster size=5 Job succeeds, log says No nodes to remove from Kubernetes cluster, no VM removed, size stored as 5
Real cluster still 6 workers; size, cores and memory no longer match the nodes
Later scale-up waits for control + size Ready nodes; the real count is higher, so the job sits in Scaling until the scale timeout

Scaling below the number of added nodes also "succeeds" without removing them.

Expected

  • Scale-down by size removes enough CKS-created workers that created + added workers equals the new size.
  • A size below the number of added nodes is rejected (scaling never removes added nodes; removeNodesFromKubernetesCluster does).

Versions

4.22 (also main). KVM, isolated network.

Related: scaleKubernetesCluster nodeids=<added node> skips the node but still subtracts it from size, with the same result.

Also related:

Case Result
nodeids with a control or etcd node VM removed, but the worker size is lowered instead of the control/etcd count
Autoscaling minsize below the number of added nodes accepted, though the autoscaler can never reach it
Cluster already drifted by the above stays wrong; every later scale works from the wrong count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions