Pages

Topics

Tools

↑↓navigate↵openescclose
All guides

Kubernetes: node(s) had untolerated taint

A Pending pod whose event lists node(s) had untolerated taint needs a toleration, a different node pool or the taint removed, not more replicas.

~5 min readKubernetes
#kubernetes#scheduling#taints#pod-pending
Bold white headline reading UNTOLERATED TAINT beside a cyan node crate fenced off by an amber taint gate.

Introduction & Quick Summary

A Deployment stays at zero ready pods and kubectl describe pod shows:

code
Events: Warning FailedScheduling 0/3 nodes are available: 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }. preemption: 0/3 nodes are available: 1 Preemption is not helpful for scheduling.

Quick answer: every node can carry taints, and a pod lands there only if it declares a matching toleration. The scheduler counted three nodes, found a taint it could not tolerate on one of them, and had no other candidate. Add a toleration for that exact key and effect to the pod template, or schedule the workload onto a node pool that is not tainted.

spec: template: spec: tolerations: - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule

In a single-node lab cluster the control-plane taint is the usual culprit. On managed platforms the taint comes from the node pool (GPU nodes, spot instances, dedicated workloads), and the toleration is the intended contract rather than a workaround. This guide covers how taint matching actually works, why a toleration alone can send a pod to the wrong node, and how to tell a taint problem from the node-selector problem that often appears in the same event.

Core Mechanics, Signatures & Reproducible Setup

A taint has three parts: key, optional value, and effect. kubectl describe node lists them:

bash
kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints kubectl describe node gpu-node-1 | grep -A3 Taints # Taints: node-role.kubernetes.io/control-plane:NoSchedule # nvidia.com/gpu=present:NoSchedule

A toleration matches a taint on key and effect, and on value when the operator is Equal:

tolerations: - key: "nvidia.com/gpu" # must match the taint key operator: "Equal" value: "present" effect: "NoSchedule" # omitted means every effect - key: "dedicated" operator: "Exists" # any value, including none effect: "NoExecute" tolerationSeconds: 300 # stay 5 minutes after the taint appears

Exists with no key tolerates everything, which is almost never what a production manifest should say. The narrow form documents the contract: this workload is allowed on GPU nodes, and nothing else changes.

A reproducible setup on a local cluster:

bash
kind create cluster --name taints kubectl taint nodes taints-control-plane workload=batch:NoSchedule kubectl create deployment demo --image=nginx:alpine --replicas=1 kubectl get pods -o wide # Pending kubectl describe pod -l app=demo | sed -n '/Events/,$p'

Removing the taint afterwards restores scheduling without touching the Deployment:

bash
kubectl taint nodes taints-control-plane workload=batch:NoSchedule-

The trailing dash is the removal syntax; forgetting it re-applies the taint instead.

Key Comparison Table

EffectScheduler behaviourRunning pods
NoSchedulenew pods without a toleration are not placedstay running
PreferNoSchedulescheduler avoids the node if possiblestay running
NoExecutenew pods are not placedevicted without a toleration
Toleration formMatchesUse case
key + operator: Equal + value + effectexact taintdedicated node pools
key + operator: Exists + effectany value for that key and effecttaints whose value changes
operator: Exists with no keyevery taintdebugging only
tolerationSeconds with NoExecutetaint added after startgraceful drain window
Event fragmentMeaningFix
had untolerated taint {k: }no toleration for that keyadd a toleration
didn't match Pod's node affinity/selectorselector excluded every nodefix nodeSelector or affinity
Insufficient cpuresources do not fitscale the pool or lower requests
untolerated taint plus preemption is not helpfulno lower-priority pods to evictchange the pod spec, not priorities

Practical Edge Cases, Error Fixes & Deep Dive Code Examples

1. Read the whole event, not the first clause

The scheduler writes one line per reason. A pod can be excluded from one node by a taint and from the others by a selector, and the message then reads 0/3 nodes are available: 1 node(s) had untolerated taint {...}, 2 node(s) didn't match Pod's node affinity/selector. Adding a toleration in that case changes nothing, because the remaining two nodes still reject the pod.

bash
kubectl get events --field-selector involvedObject.name=demo-7c9f8b6d4-abcde \ --sort-by=.lastTimestamp kubectl describe pod demo-7c9f8b6d4-abcde | sed -n '/Node-Selectors/,/Events/p'

2. A toleration does not choose the node

Tolerations permit scheduling; they do not prefer or require a node. A pod that tolerates the GPU taint can still be placed on a CPU node, and on a busy cluster it usually is. Combine the toleration with a selector or affinity when the workload needs the pool:

spec: template: spec: nodeSelector: cloud.google.com/gke-nodepool: gpu-pool tolerations: - key: nvidia.com/gpu operator: Exists effect: NoSchedule containers: - name: trainer image: registry.example.com/trainer:2.3.0

The mirror-image mistake is a nodeSelector that targets a tainted pool with no toleration: the pod is pinned to nodes it cannot use, and the event lists only taints.

3. Managed node pools and autoscaler templates

On EKS, GKE and AKS, pool taints are applied by the platform, and node autoscaling copies them from the node template. A pod that tolerates nothing will not trigger scale-up on a tainted pool, and the autoscaler log says the pod does not fit any node group:

bash
kubectl get nodes -l eks.amazonaws.com/nodegroup=batch -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.taints}{"\n"}{end}'

If the pool was created with --node-taints (EKS) or taints in the node pool spec (GKE), the toleration belongs in the workload manifest and in any Job or CronJob that runs there. Editing nodes by hand is undone by the next replacement.

4. NoExecute taints evict running pods

A NoExecute taint affects pods that are already running. Kubernetes adds such taints automatically for node.kubernetes.io/not-ready and node.kubernetes.io/unreachable, and the default tolerations give pods 300 seconds before eviction. A custom NoExecute taint added to a live node evicts everything without a matching toleration:

tolerations: - key: maintenance operator: Exists effect: NoExecute tolerationSeconds: 600

A workload that tolerates NoExecute with a bounded tolerationSeconds keeps serving during a short maintenance window and then moves, which is usually better than an instant eviction during a rolling change.

5. Should the taint be removed instead?

On a lab cluster where everything should run anywhere, removing the control-plane taint is legitimate:

bash
kubectl taint node kind-control-plane node-role.kubernetes.io/control-plane:NoSchedule-

On a production cluster the taint is protecting the control plane, and removing it lets ordinary workloads compete for its resources. Do not disable it to make one pod schedule; fix the pod. Check what a cluster actually carries before assuming a default:

bash
kubectl get nodes -o json | jq '.items[] | {name: .metadata.name, taints: .spec.taints}'

The YAML checker catches indentation mistakes in the tolerations block, which otherwise surface as a schema error rather than a scheduling event, and the diff checker shows what changed between two revisions of a manifest before you apply it.

6. DaemonSets and system workloads

DaemonSets get default tolerations for the standard node-condition taints so they can run on unhealthy nodes, but not for custom keys. A logging DaemonSet that must run on GPU nodes needs the GPU taint added explicitly:

tolerations: - key: nvidia.com/gpu operator: Exists effect: NoSchedule - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule

Without them the DaemonSet reports desired 8 and ready 5, with no error message other than the scheduler events of the missing pods.

Common Compilation/Runtime Mistakes & Version Gotchas

  • operator: Exists with no key. It tolerates every taint, including future ones, and silently defeats the isolation the taints were created for.
  • Expecting a toleration to pin the pod. Add nodeSelector or node affinity as well; otherwise the pod may run anywhere that accepts it.
  • Editing nodes instead of manifests. Hand-applied taints disappear when a node is replaced by the autoscaler, and the workload breaks hours later.
  • Ignoring the second clause of the event. didn't match Pod's node affinity/selector is a different fix in the same message.
  • Version notes. The node-role.kubernetes.io/master taint was renamed to node-role.kubernetes.io/control-plane in Kubernetes 1.20 and clusters upgraded since then can carry either; tolerations written for master do not match control-plane, which is why some pods stop scheduling after an upgrade.
  • Taints on the wrong object. Taints belong to nodes, tolerations to pods. A toleration placed on a Node has no effect and is rejected as an unknown field.

Official documentation: Taints and Tolerations and the scheduling and eviction overview.

Official references

primary documentation

The Kubernetes documentation that defines the behaviour this guide explains.

Try matching browser tools

All tools

Small utilities that fit Kubernetes work — they run entirely in this browser tab, so nothing you paste leaves your device.

All Kubernetes guides

More in Kubernetes

All Kubernetes guides

The guides filed next to this one in Kubernetes, in library order.