skip to content

A teammate runs `kubectl get pods` and sees several pods with the status `Evicted`. What does that status mean in Kubernetes, what typically causes it, and what would you check first?

level: juniorimportance: must knowfreq 55%

answer

  1. Evicted = kubelet reclaimed node resource
  2. phase Failed, tombstone object stays
  3. describe pod → reason; describe node → conditions
  4. controller makes a NEW pod elsewhere
  5. Evicted ≠ OOMKilled (node vs container limit)

basics

~20 s

Evicted means the kubelet killed the pod to reclaim a scarce node resource (memory or disk). The pod object stays as a dead record. Check kubectl describe pod for the reason message and kubectl describe node for MemoryPressure or DiskPressure conditions.

solid answer

~50 s

`Evicted` is a terminal pod phase `Failed` with reason `Evicted`. It means the **kubelet on that node** decided the node was running out of a resource — usually memory or free disk — and killed pods to reclaim it. The pod is not restarted in place; the object stays behind as a tombstone so you can read the reason, and its controller (Deployment/ReplicaSet) creates a replacement pod that the scheduler places somewhere. Triage order: 1. `kubectl describe pod <name>` — the message says which resource ran out, e.g. *The node was low on resource: memory*, and which container exceeded its request. 2. `kubectl describe node <node>` — look at Conditions for `MemoryPressure=True` / `DiskPressure=True` and the recent events. 3. Check whether the app really needs more memory or whether its requests are set too low. Evicted pods are garbage collected eventually, but you can delete them once you have read the reason.

code

bash · 5 lines
bash
kubectl get pods -A --field-selector status.phase=Failed
kubectl describe pod checkout-7d9f-hs2k | sed -n '/Status/,/Events/p'
kubectl describe node ip-10-0-3-14 | grep -A6 Conditions
kubectl top pods --sort-by=memory -n shop
kubectl delete pods -n shop --field-selector status.phase=Failed

go deeper

for a junior

Know the definition: the kubelet removed the pod because the node ran low on memory or disk; check describe pod for the reason and describe node for the condition.

for a middle

Add the mechanics: eviction is node-pressure driven, the pod object is a tombstone, controllers recreate replacements, and the victim is chosen by QoS and usage-versus-request — not by who is at fault.

for a senior

Frame it as a capacity and requests problem: chronic evictions mean requests are unrealistic or the node has no reserve; talk about right-sizing requests, limits, and node headroom rather than deleting tombstones.

for a principal

Discuss fleet policy — reserved node resources, whether the workload mix should be memory-limited, whether to isolate noisy tenants on separate node pools, and what SLO impact repeated evictions have.

## What eviction is Every Kubernetes node runs a **kubelet**, the agent that starts and supervises containers. The kubelet is also responsible for keeping the node itself alive. If a node runs completely out of memory or disk, the Linux kernel starts killing processes arbitrarily — possibly the kubelet, the container runtime, or an SSH daemon — and the node becomes unusable. To avoid that, the kubelet watches a set of resource signals and, before the node hits the wall, proactively kills pods. That proactive killing is called **node-pressure eviction**. An evicted pod ends up in phase `Failed` with `reason: Evicted` and a human-readable message such as `The node was low on resource: memory. Container api was using 1200Mi, which exceeds its request of 256Mi.` ## Why the object sticks around Kubernetes deliberately leaves the evicted pod object in the API as a record — otherwise the eviction would be invisible after the fact. This is why a cluster with a chronic memory problem accumulates dozens of `Evicted` pods. They consume no CPU or memory (no containers are running); they are just API records. The kubelet and the pod garbage collector clean them up once the count passes a threshold, and you can remove them manually: ``` kubectl delete pods --field-selector status.phase=Failed ``` Deleting them fixes nothing — it only tidies output. The actual fix is on the node or in the pod's resource requests. ## What actually gets restarted Eviction deletes the pod's containers, not the workload. If the pod is owned by a Deployment/ReplicaSet, StatefulSet, or Job, the controller notices the replica count is short and creates a **new pod**, which the scheduler places on some node — possibly the same one, if the pressure has cleared. A bare pod (created directly, with no controller) is *not* recreated; it just stays `Evicted`. This is one practical reason to run workloads through controllers. A DaemonSet pod will be recreated on the same node, since that is where it belongs, which is why DaemonSets often show repeated eviction churn on a sick node. ## The common causes - **Memory**: the sum of what pods actually use approaches the node's capacity. Pods that use far more than they requested are the first candidates. - **Disk / ephemeral storage**: logs, images, or files written inside containers or into `emptyDir` volumes fill the node's filesystem, raising `DiskPressure`. - **Inodes**: rarer, but a node can exhaust inodes while still showing free bytes. Crucially, eviction is a *node-level* symptom. Seeing pod A evicted does not mean pod A is the buggy one — the kubelet picks victims by a ranking (Quality of Service class and how far usage exceeds requests), so a well-behaved but low-priority pod can be evicted because a different pod ate the node. ## Distinguishing it from OOMKilled Candidates conflate two different kills: - **`OOMKilled`** — a *container* exceeded its own memory **limit** (or the node kernel OOM killer hit it). The pod stays `Running` and the container restarts; you see it in `kubectl describe pod` under Last State, with restart count climbing. - **`Evicted`** — the *kubelet* removed the whole pod because the **node** was short on a resource. The pod is gone, not restarted. ## First moves in an interview answer Describe the pod to read the eviction message, describe the node to confirm which condition flipped (`MemoryPressure`, `DiskPressure`), check `kubectl top nodes`/`top pods` (or your metrics stack) for who is consuming, and then decide: raise requests so the scheduler stops overpacking the node, fix a leak, add a memory limit, or add capacity. Mentioning that you would also check whether requests are realistic — rather than only blaming the node — is what separates a rote answer from a useful one.

  • Does deleting the Evicted pod objects fix the problem?
    No. They are inert API records with no running containers, so removing them frees nothing on the node. It only cleans up `kubectl get pods` output. The real fix is reducing memory or disk usage on the node, setting realistic requests so the scheduler stops overpacking it, or adding capacity.
  • How is `Evicted` different from a container showing `OOMKilled`?
    `OOMKilled` is per-container: that container exceeded its own memory limit (or was picked by the kernel OOM killer) and the kubelet restarts it inside the same pod, incrementing the restart count. `Evicted` is per-node: the kubelet deleted the entire pod because the node as a whole was short on memory or disk, and a controller must create a replacement pod.

An overbooked flight: the airline (kubelet) bumps some passengers before the plane becomes unsafe. The bumped ticket record stays in the system, and the passenger is rebooked on another flight (a new pod elsewhere) — the passenger did nothing wrong.

saying these in an interview costs you the question

  • Saying an evicted pod "restarts" — it is deleted; a controller creates a new pod, and a bare pod is never recreated
  • Assuming the evicted pod is the one that caused the pressure
  • Confusing Evicted with OOMKilled (node pressure vs container memory limit)
  • Treating `kubectl delete pod` on the Evicted tombstones as the remediation
  • Claiming eviction is done by the scheduler or the control plane rather than the node's kubelet

context