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

Activity

  1. github-actions commented on Dec 1, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    On scaleKubernetesCluster with size, the worker count only includes CKS-created workers, so nodes added with addNodesToKubernetesCluster are ignored. The scale-down log then says "No nodes to remove", the stored size changes, and the real node count no longer matches. Later scale-ups can wait for a Ready count that is never reached. The reporter also describes the same drift for nodeids with control or etcd nodes and for autoscaling minsize below the number of added nodes.

    📊 Assessment

    Dimension Value Reasoning
    Type type:bug Scale-down counts the wrong nodes, with reproduction steps and a worked example
    Component component:cks Scale worker node counting
    Severity Severity:Major Stored size drifts and breaks later scaling
    Labels type:bug, component:cks, Severity:Major Based on the issue text
    Coding agent Suitable Expected behaviour is specified: count added workers, and reject sizes below the added-node count

    🔗 Similar issues

    💡 Notes and suggestions
    • Open PR Count added nodes when scaling a Kubernetes cluster down #14837 is linked to this issue ("Count added nodes when scaling a Kubernetes cluster down"). Review it against the cases above, including the nodeids and autoscaling cases.
    • Reproduction: 1 control, 4 CKS workers, 2 added nodes (size = 6), then scaleKubernetesCluster size=5.

    Generated by Daily Issue Triage · copilot · haiku55 · ~9 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
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