1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate
1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate
If you are running a Kubernetes cluster, you might encounter an error message that says "1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate". This error message means that one or more nodes in your cluster have a taint that the pod cannot tolerate.
What is a taint?
In Kubernetes, a taint is a label that is applied to a node to indicate that the node has some characteristic that might make it unsuitable for running certain pods. For example, a node might have a taint that indicates that it has limited resources or that it is reserved for certain types of workloads.
What is a pod?
A pod is the smallest deployable unit in Kubernetes. It consists of one or more containers that share the same network namespace and storage volumes.
What does this error message mean?
This error message means that the pod cannot be scheduled on the node because the node has a taint that the pod cannot tolerate. In other words, the node has a characteristic that makes it unsuitable for running the pod.
How to fix this error?
To fix this error, you need to either remove the taint from the node or add a toleration to the pod. A toleration is a label that is applied to a pod to indicate that it can tolerate a certain taint on a node.
# To remove the taint from the node:
kubectl taint nodes <node-name> node-role.kubernetes.io/master:NoSchedule-
# To add a toleration to the pod:
apiVersion: v1
kind: Pod
metadata:
name: <pod-name>
spec:
tolerations:
- key: node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule
The first command will remove the taint from the node, which will allow the pod to be scheduled on the node. The second command will add a toleration to the pod, which will allow the pod to tolerate the taint on the node.
Conclusion
The "1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate" error message can be fixed by either removing the taint from the node or adding a toleration to the pod. Both solutions will allow the pod to be scheduled on the node.