https://rancher.com/ logo
Title
o

orange-hair-92774

04/16/2023, 2:29 PM
Hey! I am new to k3s; after setting up my k3s cluster with 3 control-plane and 3 worker nodes everything works well except I want a strict separation between the control and data plane... In vanilla Kubernetes only pods in the kubernetes namespace are scheduled on control-plane nodes while all other pods will only be scheduled on worker nodes. I know I can achieve this by adding some node anti-affinity to my yaml files but how can I re-configure K3S to have the same behaviour as vanilla Kubernetes? I want to keep my yaml files agnostic to which kind of cluster they are applied to...
b

bright-fireman-42144

04/16/2023, 2:47 PM
you can edit the k3s config.yaml to add a taint and then add a toleration to ALL your manifests and it will still be agnostic at that point. /I think/ I'm not an expert. kubelet-arg: ["--register-with-taints", "node-role.kubernetes.io/control-plane=:NoSchedule"] tolerations: - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule
o

orange-hair-92774

04/16/2023, 5:51 PM
Thanks! Using the kubelet-arg when initialising the control-plane nodes already solved the issue... The k3s CoreDNS manifest already has the toleration in place.