Master tainted - no pods can be deployed
Asked Answered
N

3

8

In my Kubernetes Dashboard i see, that one node has the Label

node-role.kubernetes.io/master:  

The result is, that all my pods are deployed on the cluster except this node. ( When i increase the replica no pod will be deployed on the master node) How can i remove the label, i tried the Kubernetes Trouble Shooting Guide

Following commands did not succeed

kubectl taint nodes --all node-role.kubernetes.io/master:-
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl taint nodes --all node-role.kubernetes.io/master:NoSchedule-

both of them resulted in the message (snip)

taint "node-role.kubernetes.io/master:" not found
taint "node-role.kubernetes.io/master:" not found
taint "node-role.kubernetes.io/master:NoSchedule" not found

Expected output should be:

  • Pods should be deployed on each of the nodes (including the Master)

My Version is v1.14.1

Na answered 16/5, 2019 at 7:22 Comment(3)
Can you try with node name like kubectl taint nodes <node1> <key>:NoSchedule-Eben
syntax is incorrect. just run below command. that is all you need to doMonetta
kubectl taint nodes --all node-role.kubernetes.io/master-Monetta
M
17

First check the taint present or not with nodename

kubectl describe node <nodename> | grep Taints

and you will get something like this (master or worker_node)

node-role.kubernetes.io/master:NoSchedule

To remove taint from node just run like this (here in my case it is master node)

kubectl taint node master node-role.kubernetes.io/master:NoSchedule-

Make sure you add - after NoSchedule

Minette answered 14/5, 2020 at 16:4 Comment(1)
master has been replaced with control-plane for newer versions of K8S.Rothmuller
D
3

Try just kubectl taint nodes --all node-role.kubernetes.io/master- without the : and without the second command.

The NoSchedule is just a result of the taint, it doesn't need to be removed explicitly.

Druci answered 16/5, 2019 at 7:31 Comment(3)
According to docs - kubernetes.io/docs/concepts/configuration/taint-and-toleration kubectl taint nodes <node1> <key>:NoSchedule-Eben
Hi, unfortuenately it is not working kubectl taint nodes --all node-role.kubernetes.io/master- results in taint "node-role.kubernetes.io/master:" not found , i updated the questionNa
The ..not found is to be expected, as it is trying to remove the taint on all nodes that have the master role. But you should get node "<name>" untainted as well. Can you add the output of kubectl get nodes -o json | jq .items[].spec.taints to your post? That should show which taints are still on your nodes.Druci
I
3

I had to run kubectl taint nodes <node-name> node-role.kubernetes.io/control-plane- to remove the taint.

I identified this by first identifying the nodes in the cluster

kubectl get nodes.

Then identify if the node is tainted,

kubectl describe node <node-name> | grep Taints

Output

Taints:             node-role.kubernetes.io/control-plane:NoSchedule

If the node is tainted you can run

kubectl taint nodes <node-name> node-role.kubernetes.io/control-plane-

Isoleucine answered 20/3, 2023 at 10:6 Comment(2)
It may be stating the obvious to others, but then run sudo systemctl restart containerdFeaze
This was the final piece of my jigsaw. My curl to my apache server works. Now I need to go back and understand how I got hereFeaze

© 2022 - 2024 — McMap. All rights reserved.