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).
Activity