Symptoms
kubectl get podsshows many pods inEvictedorContainerStatusUnknown. TheirmessagesaysThe node was low on resource: ephemeral-storage.- New pods stay
Pendingwith0/N nodes are available: N node(s) had untolerated taint {node.kubernetes.io/disk-pressure: }. - Several nodes go bad within minutes, because evicted pods reschedule onto nodes that are almost full.
- Image pulls fail with
no space left on device.
1. Confirm scope (2 minutes)
kubectl get nodes -o custom-columns='NAME:.metadata.name,DISK:.status.conditions[?(@.type=="DiskPressure")].status,TAINTS:.spec.taints[*].key'
kubectl get pods -A --field-selector status.phase=Failed | grep -c Evicted
kubectl get events -A --field-selector reason=Evicted --sort-by=.lastTimestamp | tail -20
Find the pods that use the most ephemeral storage. The eviction messages name the container that went over:
kubectl get pods -A --field-selector status.phase=Failed \
-o custom-columns='NS:.metadata.namespace,POD:.metadata.name,MSG:.status.message' | grep -i ephemeral | head -20
On one affected node (SSH through Bastion, or kubectl debug node/<node> -it --image=oraclelinux:9-slim then chroot /host):
df -h / /var/lib/containers
sudo du -xh --max-depth=1 /var/lib/containers /var/log /var/lib/kubelet 2>/dev/null | sort -h | tail -10
sudo crictl images | wc -l
sudo crictl ps -a --state exited | wc -l
2. How the kubelet decides
The kubelet evicts pods when free space drops below its hard thresholds. The upstream defaults are nodefs.available<10% and imagefs.available<15%. On OKE nodes the image store and the root filesystem usually share the boot volume, so container images, container logs and emptyDir volumes all compete for the same space. Check your node pool's kubelet settings, because custom cloud-init can change these values.
| What fills the disk | How to spot it | Fix |
|---|---|---|
| Container stdout logs | Large files under /var/log/pods | Lower log volume; set containerLogMaxSize if you manage kubelet config |
emptyDir scratch data | Large directories under /var/lib/kubelet/pods/*/volumes/kubernetes.io~empty-dir | Set sizeLimit on the volume, or move to a PVC |
| Many large images | crictl images lists hundreds of tags | crictl rmi --prune; slim images |
| Exited containers | Big crictl ps -a --state exited count | Remove exited containers |
| Default 50 GB boot volume | Small / on every node | Larger boot volume in the node pool |
3. Stop the bleeding
Stop the workload that is filling disks
If one deployment is writing debug logs or scratch files, scale it down or roll back first. Otherwise every cleanup is undone within minutes.
kubectl -n <ns> rollout undo deployment/<name>
# or, if it is not critical
kubectl -n <ns> scale deployment/<name> --replicas=0
Free space on each affected node
sudo crictl rmi --prune # remove images not used by a running container
sudo crictl rm $(sudo crictl ps -a --state exited -q) # remove exited containers
sudo journalctl --vacuum-size=200M
Warning
Do not delete files under
/var/lib/containersor/var/lib/kubeletby hand. That corrupts the CRI-O store or kubelet state and the node usually has to be replaced. Usecrictland let the kubelet clean up pod directories.
Once free space is above the threshold, the kubelet clears the DiskPressure condition and removes the taint by itself. That usually takes a minute or two.
Clean up evicted pods
Evicted pods keep their objects until they are garbage collected. They don't use node disk, but they clutter every view during the incident:
kubectl delete pods -A --field-selector status.phase=Failed
Replace a node that will not recover
If a node is badly corrupted, drain it and let the node pool replace it:
kubectl cordon <node>
kubectl drain <node> --ignore-daemonsets --delete-emptydir-data --timeout=300s
oci ce node-pool delete-node --node-pool-id $NP --node-id <instance-ocid> --is-decrement-size false --force
Caution
Draining many nodes at once during a capacity incident can leave too few nodes for your PodDisruptionBudgets and critical replicas. Drain one node at a time and wait until its replacement is
Ready.
4. The durable fix: bigger boot volumes and limits
Raise the boot volume size for the node pool. This applies to new nodes. Existing nodes keep their old size until they are replaced.
NP=ocid1.nodepool.oc1..xxxx
oci ce node-pool get --node-pool-id $NP --query 'data."node-source-details"'
oci ce node-pool update --node-pool-id $NP \
--node-source-details '{"sourceType":"IMAGE","imageId":"ocid1.image.oc1..current","bootVolumeSizeInGBs":200}'
Keep the same imageId you got from get, unless you also mean to change the image. The root filesystem does not always grow to fill a boot volume that is bigger than the image's default. To be safe, use a custom cloud-init script for the node pool that runs the default OKE init script and then sudo /usr/libexec/oci-growfs -y. Check the OKE documentation for the init script path your node image uses.
Then cycle the nodes to pick up the change. Recent CLI versions support node pool cycling. Check oci ce node-pool update --help for --node-pool-cycling-details in your build:
oci ce node-pool update --node-pool-id $NP \
--node-pool-cycling-details '{"isNodeCyclingEnabled":true,"maximumSurge":"1","maximumUnavailable":"0"}'
Add ephemeral storage requests and limits to workloads, so the scheduler places them sensibly and a single pod is evicted before it takes a node down:
resources:
requests:
ephemeral-storage: "2Gi"
limits:
ephemeral-storage: "8Gi"
volumes:
- name: scratch
emptyDir:
sizeLimit: 5Gi
Verify
kubectl get nodes
kubectl describe nodes | grep -E "DiskPressure|ephemeral-storage" | sort | uniq -c
kubectl get pods -A | grep -vE "Running|Completed" | head
- No node reports
DiskPressure True, and no node has thedisk-pressuretaint. - Pending pods have scheduled, and application replicas are back to their desired counts.
df -h /on a node shows headroom above the eviction threshold with room to spare.
Prevent it next time
- Size node pool boot volumes for your image footprint plus logs, not the default.
- Require
ephemeral-storagelimits andemptyDir.sizeLimitthrough an admission policy (Gatekeeper or Kyverno) in production namespaces. - Ship logs off the node and keep application logging at
INFOin production. - Alert on node filesystem usage from your Kubernetes metrics stack (for example
node_filesystem_avail_bytesfrom node-exporter) at 75% and 85%. - Keep image counts low with smaller base images and regular rollouts that let the kubelet's image garbage collection do its job.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get