Kubernetes Tolerations - why do we need to defined Effect on the pod
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
In Kubernetes, the effect field on a toleration tells the scheduler or kubelet which kind of taint behavior the pod is willing to tolerate. It exists because the same taint key and value can have different operational meanings depending on whether the effect is NoSchedule, PreferNoSchedule, or NoExecute.
Taints and Tolerations Are Matched as a Set of Fields
A taint is made of:
- key
- value
- effect
For example:
A pod toleration matches a taint only when the relevant fields line up according to the operator:
This pod says, “I tolerate the dedicated=batch taint specifically when its effect is NoSchedule.”
Why effect Matters
The effect changes what Kubernetes should do:
- '
NoSchedule: do not place new pods here unless they tolerate the taint' - '
PreferNoSchedule: try to avoid the node, but do not enforce strictly' - '
NoExecute: evict already running pods that do not tolerate the taint'
Those are different outcomes. A pod might reasonably tolerate one of them but not another.
For example, a workload may be allowed to schedule onto a dedicated node when capacity planning says so, but it may not want to tolerate NoExecute, because that could change eviction behavior during a node condition or policy update.
Example: Same Key, Different Effects
Imagine a node has these taints:
Now consider this pod:
This pod tolerates only the NoSchedule taint. It does not automatically tolerate the NoExecute taint, so the effect field is doing real work here by narrowing the meaning of the toleration.
What Happens If You Omit effect
If the toleration leaves effect empty, Kubernetes treats it as matching taints with that key and value regardless of effect. That can be useful, but it is broader:
This says, “I tolerate matching taints of any effect.” That is convenient, but it is less precise. If your workload should only bypass scheduling restrictions and should not tolerate eviction semantics, you should specify the effect explicitly.
NoExecute Has an Extra Twist
NoExecute is special because it can evict already-running pods, and tolerations for it may include tolerationSeconds:
This means the pod may stay on the node temporarily after the taint appears, but not forever. That behavior would make no sense on NoSchedule, which is another good reason the effect field matters.
Common Pitfalls
The most common mistake is assuming key and value alone are enough to describe the pod’s intent. They are not, because NoSchedule, PreferNoSchedule, and NoExecute change the meaning of the taint.
Another pitfall is omitting effect unintentionally and therefore tolerating more than the workload should. That can make a pod schedulable or non-evictable in situations the author never intended.
It is also easy to forget that NoExecute affects already-running pods, not just placement. That makes its toleration semantics much stronger than the other two effects.
Finally, do not think of tolerations as “forcing” a pod onto a node. A toleration only says the pod is allowed to run there with respect to taints. Node selectors, affinity, and normal scheduling rules still matter.
Summary
- The
effectfield exists because the same taint key and value can imply different behavior. - '
NoSchedule,PreferNoSchedule, andNoExecuteare operationally different and should not be collapsed casually.' - Setting
effecton a toleration makes the pod’s intent precise. - Omitting
effectbroadens the match to taints with the same key and value across effects. - '
NoExecuteis especially important because it influences eviction, not just scheduling.'

