feat: label nodes with the node profile they joined with

Node profiles controlled how a node joined the cluster but left no trace on the node afterwards, so a profile could not be selected against with `kubectl`, a `nodeSelector`, or a node affinity rule. Nodes joined without a profile are left unlabeled, and the server node created by `scheduler-k3s:initialize` never carries the label since it does not pass through `scheduler-k3s:cluster:add`.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-08-07 02:32:34 -04:00
1 parent 8e17eee653
commit f050726f1a
5 files changed
+117 -4

No files matched your search

+1 -4
View File
@@ -875,10 +875,7 @@ export INSTALL_K3S_VERSION=%s
return fmt.Errorf("Unable to find node after joining cluster, node will not be annotated/labeled appropriately access registry secrets")
}
labels := ServerLabels
if incomingProfile.Role == "worker" {
labels = WorkerLabels
}
labels := nodeLabels(incomingProfile.Role, profileName)
for key, value := range labels {
common.LogInfo2Quiet(fmt.Sprintf("Labeling node %s=%s", key, value))