Difficulty: Intermediate
What causes a Pod to be evicted from a node in Kubernetes, and how does the kubelet decide which Pods to evict first?
A Pod is evicted when Kubernetes deliberately terminates it to protect the node or to move work elsewhere. The main causes are node-pressure eviction by the kubelet (the node is running low on memory, disk, inodes or PIDs), API-initiated eviction such as kubectl drain during maintenance, taint-based eviction when a node becomes unreachable, and scheduler preemption in favour of a higher-priority Pod. Evicted Pods end in phase Failed with reason Evicted, and their controller creates replacements on other nodes.
The kubelet monitors eviction signals and compares them to thresholds:
| Signal | Default hard threshold (Linux) |
|---|---|
memory.available | less than 100Mi |
nodefs.available | less than 10% |
nodefs.inodesFree | less than 5% |
imagefs.available | less than 15% |
pid.available can also be configured. Hard thresholds evict immediately; soft thresholds (--eviction-soft plus a grace period) give Pods time to recover. When a threshold is crossed, the node reports a condition such as MemoryPressure or DiskPressure, gets a matching taint, and the scheduler stops placing new Pods there.
For memory pressure the kubelet considers, in order:
priorityClassName).In practice this lines up with QoS classes: BestEffort Pods (no requests or limits) go first, then Burstable Pods using more than they requested, and Guaranteed Pods (requests equal limits for every container) are the last to go. Disk pressure follows similar logic using ephemeral storage. A container exceeding its own ephemeral-storage limit gets its Pod evicted directly.
kubectl drain and cluster upgrades call the Eviction API, which honours PodDisruptionBudgets. If a PDB would be violated, the eviction is refused and drain waits.NotReady or unreachable, the control plane taints it with node.kubernetes.io/not-ready or node.kubernetes.io/unreachable with effect NoExecute. Pods get a default toleration of 300 seconds, after which they are evicted.These are often confused. An OOMKilled container hit its own memory limit and was killed by the kernel; the kubelet restarts it in the same Pod and you see RESTARTS go up. An eviction removes the entire Pod from the node because the node itself is under pressure. The fix differs: raise the container limit for OOMKilled, and set proper requests, add capacity, or clean disk for evictions.
# List evicted Pods across the cluster
kubectl get pods -A --field-selector=status.phase=Failed | grep Evicted
# Why was it evicted?
kubectl describe pod report-worker-6d8f7-abcde -n analytics | grep -A3 -i "reason\|message"
# Message: The node was low on resource: memory. Container worker was using 1.9Gi, request is 512Mi
# Which nodes are under pressure right now?
kubectl describe node ip-10-0-3-17 | grep -E "MemoryPressure|DiskPressure|PIDPressure"
# Clean up old evicted Pods in a namespace
kubectl delete pods -n analytics --field-selector=status.phase=Failed
The eviction message tells you which resource ran out and how far the container exceeded its request, which points straight at the fix: higher requests, a memory leak, or more node capacity.
Node-pressure Eviction, QoS Classes, Eviction API, PodDisruptionBudget, Taint-based Eviction