taint
What is taint?
taint: A mark on a node that repels Pods. Only Pods with a matching toleration may schedule there. Used to reserve nodes (e.g. GPU nodes). A taint in Kubernetes is a mark on a node that keeps pods away, unless a pod has a matching toleration. kubectl taint nodes gpu-1 dedicated=gpu:NoSchedule reserves that node for pods that explicitly accept it.
Frequently asked questions about taint
How is taint used in practice?
It is used to reserve expensive or special nodes, such as machines with GPUs or extra memory, for the workloads that need them. Kubernetes itself also taints nodes that have problems, such as running low on memory or disk, so new pods avoid them.
What should you keep in mind with taint?
A taint only keeps other pods out; it does not attract the pods that tolerate it. To make sure your GPU workload actually lands on the GPU node, combine the toleration with node affinity or a node selector. The NoExecute effect goes further and evicts running pods that do not tolerate the taint.
What does an example of taint look like?
kubectl taint nodes gpu-1 \ dedicated=gpu:NoSchedule At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |