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:
Jose Diaz-Gonzalez committed 2026-05-31 16:24:23 -04:00
1 parent 213d89b1e4
commit 099cf10e98
3 files changed
+121 -3

No files matched your search

+1 -1
View File
@@ -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)