Pods are being evicted with "The node was low on resource: ephemeral-storage. Container app was using 18Gi, which exceeds its request of 0."
IntermediateTroubleshootingDisk, memory and CPU
Answer
Likely causes → Containers write lots of data to their writable layer or emptyDir: logs written to files inside the container, temp files from uploads or image processing, or a cache. When the node's root disk crosses the kubelet eviction threshold (nodefs.available<10% by default), kubelet evicts the biggest users.
Diagnose →
kubectl get events -A --field-selector reason=Evicted
kubectl describe node <node> | grep -A5 Conditions
kubectl debug node/<node> -it --image=busybox -- du -sh /host/var/lib/containerd /host/var/log/pods
Fix → Log to stdout instead of files, move scratch data to an emptyDir with sizeLimit, and set ephemeral-storage requests and limits:
resources:
requests: { ephemeral-storage: "2Gi" }
limits: { ephemeral-storage: "4Gi" }
Prevent → Larger node root volumes, ephemeral-storage limits in your default LimitRange, and alerts on node DiskPressure.
More on Disk, memory and CPU
The app fails to write with "No space left on device", but `df -h` shows the volume is only 40% used.Beginner`df -h` says `/` is 100% full, but `du -sh /*` only adds up to 30% of the disk.BeginnerA server shows load average 40 on 8 cores, but `top` shows CPU 60% idle and the app is crawling.BeginnerCI build agents running Docker fail with "no space left on device" while pulling images; `/var/lib/docker` is 95% full.IntermediatePostgres on a VM died overnight; `dmesg` shows "Out of memory: Killed process 2314 (postgres) total-vm:..., anon-rss:...".IntermediateA Java pod keeps getting OOMKilled at its 2Gi limit, even though `-Xmx2g` is set and the heap graph never reaches 2 GB.Intermediate