Taints and Tolerations: NoSchedule and NoExecute
A taint is a node saying no. A toleration is a Pod's exemption from one specific no. The part that catches people is that the effect matters as much as the key: NoSchedule only applies to scheduling decisions not yet made, while NoExecute reaches Pods already running and removes them. Both are applied to the same node here, to the same workload, so the difference is a single command apart.
Scheduling and Placement Guide 15 of 46 Intermediate
- Kubernetes1.36.4
- Cluster2 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 16 min
The scheduler's message changed wording across releases. On 1.36 it reports 2 node(s) had untolerated taint(s) without naming which taint - older output quoted the key and value. kubectl describe node remains the reliable way to see what a node is actually carrying.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA3001 | 192.168.0.185 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA3001-NODE01 | 192.168.0.186 | Ubuntu 26.04 LTS | Worker Node (tainted and untainted during this guide) | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when Pods will not schedule onto a node, or when running Pods are suddenly evicted from one. This matters because NoSchedule and NoExecute look almost identical in a manifest and do very different things - one blocks new Pods, the other removes those already running.
- reading a node's existing taints, including the control-plane taint every cluster ships with
- applying
workload=blocked:NoScheduleand watching a Deployment fail to place a single Pod - adding a toleration matching key, value and effect exactly, and seeing the Pod land immediately
- switching the same taint to
NoExecuteand watching a Pod that was already running get thrown off - removing a taint with the trailing
-syntax and confirming the node is clean again
Before you start
- A cluster where you can taint a node. Everything else is built in.
- The session creates namespace
kx-taintand a Deploymentappwith one replica, then taints and untaintscka3001-node01. The node is returned to its original state at the end.
-
A worker with nothing against it
-
Taint it, and nothing can be placed
-
One toleration and it lands
-
The effect that does not wait for next time
-
Put the node back