rke2: taint control-plane nodes NoSchedule #517
Reference in New Issue
Block a user
Delete Branch "benvin/rke2-control-plane-taint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
roles::infra::k8s::control) carry NO taints, so regular workloads schedule onto the controllers.How
node-taint: "node-role.kubernetes.io/control-plane=true:NoSchedule"torke2::config_hashinhieradata/roles/infra/k8s/control.yaml— control role only; compute/agent nodes untouched.rke2::config_hashis a deep-merge key, so the taint layers onto the existing control config and renders into the/etc/rancher/rke2/config.yamlnode-taint:list.Operational nuances (read before converging)
Stagger the control-plane restart — one node at a time. Puppet's
rke2::servicesubscribes toFile[config_file], so changingconfig.yamlrestartsrke2-server. On a 3-node etcd control plane a near-simultaneous restart of all three risks a brief quorum loss. Let Puppet converge/restart the controllers one at a time, confirming etcd quorum (e.g.rke2 etcd-snapshothealth /etcdctl endpoint health) between each.A one-time manual taint IS required. RKE2
node-taint(kubelet--register-with-taints) is applied only at node registration — per the RKE2 docs the option "only add[s] labels and/or taints at registration time, and can only be added once and not removed after that through rke2 commands." The RKE2 version in use (1.33.13~rke2r2, pinned inmodules/rke2/manifests/params.pp) does not reconcile the taint onto already-registered nodes on restart. The config change only guarantees the taint on any future re-registration (node rebuilt/removed+rejoined). Apply the taint once, from a privileged kubeconfig context:Confirm the exact node names first with
kubectl get nodes(RKE2 uses the node hostname; may be short or FQDN).NoSchedule, not NoExecute. Running pods are not evicted; only new scheduling is blocked. Workloads already on the controllers stay until they are rescheduled elsewhere.
Nothing critical gets stranded. The static control-plane pods (etcd/kube-apiserver/controller-manager/scheduler) bypass scheduling and are unaffected by taints; the canal CNI DaemonSet tolerates all taints (
operator: Exists) so it still runs on the controllers. Everything else (CoreDNS, ingress, metrics-server, estate workloads) has compute/agent nodes to land on. Operators should verify any per-node DaemonSet they care about on controllers (e.g. metrics exporters) carries the standardnode-role.kubernetes.io/control-plane:NoScheduletoleration, or it will stop scheduling to the controllers.