fix: match control-plane nodes by their modern label
Kubernetes 1.20 deprecated the node-role.kubernetes.io/master label and replaced it with node-role.kubernetes.io/control-plane, and 1.24 dropped the legacy label entirely. The scheduler-k3s:cluster:add join path still filtered control-plane nodes with master=true, so on any k3s release built from Kubernetes 1.24+ the lookup matched zero nodes and aborted with "no nodes found in the cluster" before the worker could join.
This commit is contained in:
3 files changed
+121
-3
No files matched your search
@@ -755,7 +755,7 @@ func CommandClusterAdd(profileName string, role string, remoteHost string, serve
|
||||
|
||||
common.LogInfo2Quiet("Ensuring compatible k3s version for node")
|
||||
lowestNodeVersion, err := clientset.GetLowestNodeVersion(ctx, ListNodesInput{
|
||||
LabelSelector: "node-role.kubernetes.io/master=true",
|
||||
LabelSelector: "node-role.kubernetes.io/control-plane=true",
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("Unable to get lowest node version: %w", err)
|
||||
|
||||
Reference in new issue
Block a user