Kubernetes Pod Evicted Due to Disk Pressure — Fix
Your pods are getting evicted with 'The node was low on resource: ephemeral-storage'. Here's why disk pressure evictions happen and exactly how to fix them.
Kubernetes evicts pods when a node is running low on disk space. The pod disappears with Evicted status and an event saying The node was low on resource: ephemeral-storage.
Understand What's Happening
Kubernetes has two disk-related eviction thresholds:
nodefs— the node's root filesystem (/var/lib/kubelet)imagefs— where container images are stored (usually/var/lib/dockeror/var/lib/containerd)
When either goes above the eviction threshold (default: 85% full), kubelet starts evicting pods — lowest priority first.
Step 1: Diagnose
# Check node disk pressure condition
kubectl get nodes
# Look for: DiskPressure=True
kubectl describe node <node-name> | grep -A5 "Conditions:"
# Look for: DiskPressure True
# See which pods got evicted
kubectl get pods --all-namespaces | grep Evicted
# Check disk usage on the node
kubectl debug node/<node-name> -it --image=ubuntu -- df -h
# Or SSH into the node if you have accessCase 1: Container Logs Filling Disk
The most common cause. Containers writing massive logs fill /var/log/containers/.
# Check log sizes on node
kubectl debug node/<node-name> -it --image=ubuntu -- \
du -sh /host/var/log/containers/* | sort -rh | head -20
# Check if a specific pod is logging excessively
kubectl logs <pod-name> --tail=10 | wc -cFix 1: Add log rotation to container runtime
# For containerd, edit /etc/containerd/config.toml on each node:
[plugins."io.containerd.grpc.v1.cri".containerd]
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
# Log rotation is handled by docker/containerd log driver
# For dockerd (older setups), /etc/docker/daemon.json:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "3"
}
}Fix 2: Set log limits in pod spec
# Doesn't directly limit log size but limits resources:
resources:
limits:
ephemeral-storage: 2Gi # Limits total ephemeral storage for podCase 2: Container Images Filling Disk
Old, unused images accumulate and fill the imagefs.
# Check image disk usage
kubectl debug node/<node-name> -it --image=ubuntu -- \
crictl images | head -30
# Auto-garbage collection is enabled by default in kubelet
# Check if it's working:
kubectl describe node <node-name> | grep -i "image"Fix: Lower image GC thresholds in kubelet config
# /var/lib/kubelet/config.yaml on each node
imageGCHighThresholdPercent: 75 # Start GC at 75% (default 85%)
imageGCLowThresholdPercent: 60 # GC down to 60% (default 80%)Or force immediate cleanup:
# SSH to node
crictl rmi --prune # Remove unused imagesCase 3: emptyDir Volumes Filling Up
Pods using emptyDir volumes write data to node disk.
# Check emptyDir sizes
kubectl debug node/<node-name> -it --image=ubuntu -- \
du -sh /host/var/lib/kubelet/pods/*/volumes/kubernetes.io~empty-dir/* 2>/dev/null | sort -rh | head -20Fix: Set size limit on emptyDir
volumes:
- name: temp-data
emptyDir:
sizeLimit: 500Mi # Pod evicted if it exceeds thisCase 4: Node Root Filesystem Full
Not container-related — the node OS itself is running out of disk.
# Check root filesystem
df -h /
# If / is > 80% full, it's OS-level disk usage
# Common culprits:
du -sh /var/log/* | sort -rh | head -10
du -sh /tmp/*
journalctl --disk-usageFix:
# Clean journal logs
journalctl --vacuum-size=500M
# Clean apt/yum cache (on nodes you can access)
apt clean # Ubuntu/Debian
yum clean all # RHEL/CentOSLong-Term Fix: Set Ephemeral Storage Requests/Limits
# In every pod spec — prevent runaway disk usage
resources:
requests:
ephemeral-storage: "500Mi"
limits:
ephemeral-storage: "2Gi"When a pod exceeds its ephemeral-storage limit, it gets evicted — but only that pod, not everything on the node.
Prevent It: Monitoring
# Prometheus alert for node disk pressure
- alert: NodeDiskPressure
expr: kube_node_status_condition{condition="DiskPressure",status="true"} == 1
for: 5m
annotations:
summary: "Node {{ $labels.node }} has disk pressure"
# Alert before it gets critical
- alert: NodeFilesystemSpaceFilling
expr: predict_linear(node_filesystem_free_bytes[6h], 24*3600) < 0
annotations:
summary: "Node filesystem will fill up in 24h"Learn Kubernetes storage and resource management at KodeKloud.
Today I Fixed
Short real fixes from production — posted daily
Stay ahead of the curve
Get the latest DevOps, Kubernetes, AWS, and AI/ML guides delivered straight to your inbox. No spam — just practical engineering content.
Related Articles
ArgoCD App of Apps Not Syncing — Every Fix (2026)
Your ArgoCD App of Apps pattern stopped syncing. Child apps aren't created, parent shows OutOfSync, or sync is stuck. Here are every cause and the exact fix.
ArgoCD Image Updater Not Syncing — Fix Guide
ArgoCD Image Updater detects a new image tag but doesn't update the Application. Here's how to diagnose and fix annotation errors, registry auth issues, write-back problems, and sync failures.
AWS EKS Cluster Autoscaler Not Scaling — Every Fix (2026)
Your EKS Cluster Autoscaler isn't scaling up, scale-down isn't working, or nodes spin up but stay empty. Here's every cause and the exact fix.