https://rancher.com/ logo
#k3s
Title
# k3s
m

microscopic-king-50617

01/16/2023, 5:42 PM
Hi everyone I'm trying to set a node taint but it doesn't seem to be working I'm currently passing the following argument:
--node-taint <http://node-role.kubernetes.io/master=true:NoSchedule|node-role.kubernetes.io/master=true:NoSchedule>
but my master nodes still show
Taints: <none>
when I check the node annotations
<http://k3s.io/node-args|k3s.io/node-args>
contains
[..., "--node-taint", "<http://node-role.kubernetes.io/master=true:NoSchedule|node-role.kubernetes.io/master=true:NoSchedule>"]
l

late-needle-80860

01/16/2023, 6:47 PM
I use
--node-taint CriticalAddonsOnly=true:NoExecute
to block regular workloads from going to the control-plane nodes.
m

microscopic-king-50617

01/16/2023, 6:48 PM
cool I'll give it a go thanks
hmmm weird still no taint applied 😕
c

creamy-pencil-82913

01/17/2023, 4:23 AM
https://docs.k3s.io/advanced#node-labels-and-taints
K3s agents can be configured with the options --node-label and --node-taint which adds a label and taint to the kubelet. The two options only add labels and/or taints at registration time, so they can only be set when the node is first joined to the cluster
As the docs make clear, you can't change them on an existing node by adding flags after the fact.
l

late-needle-80860

01/17/2023, 5:48 AM
Yeah sorry I wasn’t clear about that fact. Of course not 🙏
So roll the node again @microscopic-king-50617
m

microscopic-king-50617

01/17/2023, 12:24 PM
yeah I did that and it worked thanks
🎯 1
👍 1
307 Views