You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CKS treats a lower-id added node as the control node #14830
CKS picks "the control node" in KubernetesClusterActionWorker.fetchControlVmIfMissing by sorting every VM id in kubernetes_cluster_vm_map and taking the one at index etcdNodeCount. It never looks at the control_node flag.
If the cluster holds a VM whose id is lower than the control VM's, that VM is taken as the control node. The easy way to hit it: addNodesToKubernetesCluster with a VM that existed before the cluster was created.
kubeconfig server rewrite looks for the wrong IP and is skipped
Seen on a lab cluster: VMs 4 and 5 added with addNodesToKubernetesCluster (external, worker), control VM is 7. VM 4 was chosen; adding VM 5 afterwards produced a join config pointing at VM 4.
versions
4.22 (also main). Code unchanged since etcd node support.
The steps to reproduce the bug
Create a VM A (CKS template) in the cluster's network.
Create a CKS cluster (VM ids of its nodes are now higher than A's).
addNodesToKubernetesCluster with A; it joins fine (control IP still resolved correctly until A is mapped).
addNodesToKubernetesCluster with another existing VM B.
B's CKS config points at A's IP for the API server and never joins.
What to do about it?
Pick the control VM from rows with control_node set (not etcd, not external), lowest VM id first. Keep a fallback for clusters created before the control_node column existed (all rows 0).
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.
CKS chooses the "control node" in KubernetesClusterActionWorker.fetchControlVmIfMissing by sorting all VM IDs in kubernetes_cluster_vm_map and taking the one at index etcdNodeCount. It does not check the control_node flag. If an externally added VM has a lower ID than the real control VM, that VM is taken as the control node, and later added nodes receive join configuration that points at the wrong API server and never join.
📊 Assessment
Dimension
Value
Reasoning
Type
type:bug
Wrong control node is selected, with reproduction steps
Component
component:cks
KubernetesClusterActionWorker.fetchControlVmIfMissing and join configuration
Severity
Severity:Major
Later nodes cannot join; shared and routed clusters SSH to the wrong VM
Labels
type:bug, component:cks, Severity:Major
Based on the issue text
Coding agent
Suitable
Fix is specified: choose the control VM by the control_node flag, lowest ID first, with a fallback for older rows
Reproduction: create VM A in the cluster's network before creating a CKS cluster, create the cluster, add A, then add another existing VM B and check its join configuration.
The fallback for clusters created before the control_node column existed needs a test.
Activity
github-actions commentedon Dec 1, 2026
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
CKS chooses the "control node" in
KubernetesClusterActionWorker.fetchControlVmIfMissingby sorting all VM IDs inkubernetes_cluster_vm_mapand taking the one at indexetcdNodeCount. It does not check thecontrol_nodeflag. If an externally added VM has a lower ID than the real control VM, that VM is taken as the control node, and later added nodes receive join configuration that points at the wrong API server and never join.📊 Assessment
KubernetesClusterActionWorker.fetchControlVmIfMissingand join configurationcontrol_nodeflag, lowest ID first, with a fallback for older rows🔗 Similar issues
removeNodesFromKubernetesClusteraccepts control and etcd nodes; same control-node identification💡 Notes and suggestions
control_nodecolumn existed needs a test.Add this agentic workflow to your repo
To install this agentic workflow, run