Skip to content
Latchkey

Kubernetes Pod "Evicted: The node was low on resource" in CI

The kubelet evicted the pod to reclaim a node resource under pressure - most often ephemeral-storage (disk) or memory. Eviction is a node-level defense, distinct from an OOMKill of a single container.

What this error means

A pod shows STATUS: Evicted and kubectl describe pod gives Reason: Evicted, Message: The node was low on resource: ephemeral-storage. Container ... was using ..., which exceeds its request. Evicted pod objects linger until cleaned up.

kubectl describe pod
Status:   Failed
Reason:   Evicted
Message:  The node was low on resource: ephemeral-storage. Container api was
using 4096Mi, which exceeds its request of 0.

Common causes

Ephemeral storage / disk pressure

Logs, temp files, or an image filling the node’s disk trip the kubelet’s disk-pressure threshold, and it evicts pods (those over their ephemeral-storage request first).

Memory pressure with no/low requests

Under node memory pressure the kubelet evicts pods exceeding their memory request; pods with no request are the first candidates.

How to fix it

Identify the pressured resource

Terminal
kubectl get pod <pod> -o jsonpath='{.status.message}'; echo
kubectl describe node <node> | grep -A5 -i 'Conditions\|pressure'

Set requests and cap usage

  1. Set requests.ephemeral-storage and requests.memory so the scheduler reserves room and eviction ordering protects you.
  2. Cap log/temp growth (rotate logs, write large temp data to a PVC, clean caches).
  3. Add node capacity or larger disks if the workload legitimately needs more.
deployment.yaml
resources:
  requests:
    memory: "512Mi"
    ephemeral-storage: "1Gi"
  limits:
    ephemeral-storage: "2Gi"

How to prevent it

  • Always set memory and ephemeral-storage requests so eviction ordering favors your pods.
  • Rotate logs and avoid writing large data to the container filesystem.
  • Monitor node disk/memory pressure and scale before thresholds trip.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →