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.
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
kubectl get pod <pod> -o jsonpath='{.status.message}'; echo
kubectl describe node <node> | grep -A5 -i 'Conditions\|pressure'Set requests and cap usage
- Set
requests.ephemeral-storageandrequests.memoryso the scheduler reserves room and eviction ordering protects you. - Cap log/temp growth (rotate logs, write large temp data to a PVC, clean caches).
- Add node capacity or larger disks if the workload legitimately needs more.
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.