1. What Kubernetes DiskPressure Means During Node Disk Pressure

Kubernetes DiskPressure means the kubelet sees node disk pressure on a filesystem it monitors and has crossed an eviction threshold for available space or free inodes. The node is still reporting, but it is protecting itself. Treat the condition as an active storage incident, not as a cosmetic warning.

Illustrative composite: at 02:40 a worker node begins evicting low-priority batch pods while the API tier stays healthy. The first alert says pods are failing, so the responder checks Deployment rollouts. The node condition tells a sharper story: DiskPressure is True, the disk-pressure taint is present, and kubelet events mention ephemeral storage. A debug job has filled /var/log/pods with verbose output after a retry loop. The fix is not restarting the evicted pods. The fix is freeing node storage in the right order and stopping the writer.

DiskPressure is narrower than the broad verdict covered in the Kubernetes Node NotReady guide. A node can remain Ready while DiskPressure is True, and it can also become NotReady when pressure destabilises the kubelet or runtime. That distinction matters because the first question changes. Instead of asking why the control plane lost trust in the node, ask which filesystem crossed which threshold and what is still writing to it.

The practical risk is eviction churn. The kubelet first tries node-level reclaim, such as deleting unused images or dead containers. If that does not restore enough space or inodes, it fails pods. Controllers recreate those pods, sometimes on the same constrained node pool, and the incident becomes a loop of evictions, image pulls and fresh log writes.


2. How the Kubelet Decides Node Disk Pressure Thresholds

The kubelet decides node disk pressure by comparing eviction signals with soft and hard thresholds. Disk signals include nodefs.available, imagefs.available, containerfs.available and the matching inodesFree values. Hard thresholds act immediately, while soft thresholds wait for a configured grace period before eviction.

Kubernetes documentation describes node-pressure eviction as the kubelet proactively terminating pods to reclaim resources when memory, disk space or filesystem inodes reach consumption levels. For disk, the default hard thresholds on Linux are nodefs.available<10%, imagefs.available<15%, nodefs.inodesFree<5% and imagefs.inodesFree<5%. Those defaults explain why a node can look merely busy at 88 percent disk usage and then flip into eviction once the free-space floor is crossed.

Hard thresholds have no grace period. When one is met, the kubelet kills selected pods immediately to reclaim the starved resource. Soft thresholds are different: they pair a threshold with a grace period, and the kubelet waits until that period is exceeded. Soft thresholds are useful when you want an early warning band, but they only help if alerts and automation react inside the grace window.

A common configuration mistake is changing one threshold and assuming the rest still inherit defaults. Kubernetes warns that custom values need care because unset parameters may not behave as operators expect unless the kubelet configuration merges defaults. Record the effective kubelet configuration on the node before you tune anything. A threshold change made during an incident can hide the signal while the writer keeps filling the disk.


3. Nodefs, Imagefs and Containerfs in Kubernetes DiskPressure

Kubernetes DiskPressure can come from nodefs, imagefs or containerfs, and the cleanup target depends on which filesystem is starved. Nodefs holds kubelet data, logs, local volumes and emptyDir. Imagefs holds image layers. Containerfs, where split, holds writable container layers safely.

The three names describe filesystems as the kubelet observes them, not always three separate mounts. In many clusters everything sits on one root filesystem, so nodefs, imagefs and containerfs point at the same disk. In split layouts, runtime storage lives on a dedicated disk. In split-image layouts, image layers are separate while writable layers remain with nodefs. You cannot choose a cleanup path until you know the layout on the affected node.

Nodefs pressure usually points at /var/lib/kubelet, pod logs, local volumes, emptyDir data, journal files or other node-local writes. Imagefs pressure points at image layers, stale images, image pull churn or runtime storage growth. Containerfs pressure points at writable layers, which often means an application writing inside the container filesystem instead of a volume. The same DiskPressure condition can therefore require three different fixes.

Start with mounts, not guesses. Compare df -h and df -i for /, /var/lib/kubelet, /var/log, /var/lib/containerd and any runtime path used by your platform. If those paths resolve to one filesystem, image cleanup and log cleanup compete for the same free pool. If they are separate, deleting images will not fix a nodefs log flood, and truncating logs will not fix imagefs exhaustion.


4. First Commands to Confirm Kubernetes DiskPressure

Confirm Kubernetes DiskPressure from the node condition, taints, events and filesystem usage before deleting anything. Read the DiskPressure reason and message, list pods on the node, then check bytes and inodes on the kubelet, log and runtime paths. Evidence first prevents destructive cleanup.

Begin with the node object because it carries the kubelet verdict and the taint that blocks new scheduling. The condition message often names the threshold or resource that triggered pressure. Pair that with recent events for evictions, image garbage collection and failed pod starts. The kubectl master guide is useful when you need the wider command set, but this incident needs a short evidence path.

bash
kubectl describe node <node-name>
kubectl get node <node-name> -o jsonpath='{.status.conditions[?(@.type=="DiskPressure")]}{"
"}'
kubectl get pods -A --field-selector spec.nodeName=<node-name> -o wide
kubectl get events -A --field-selector involvedObject.kind=Node,involvedObject.name=<node-name> --sort-by=.lastTimestamp

On the node, check both capacity and inodes. Bytes alone miss inode exhaustion, and inode counts alone miss a single huge log or image layer. Use df -h for space, df -i for inodes, and findmnt to confirm which mount backs each path. If SSH access is restricted, use your node debug method and keep the session read-only until the consumer is identified.

Record the numbers before cleanup. Note free bytes, free inodes, the largest directories, the runtime image count and the pods recently evicted. Those values become your recovery proof. Without a baseline, a node can clear DiskPressure for five minutes and refill while the team is still declaring the incident over.

For kubernetes diskpressure, the evidence trail should separate condition, filesystem and writer. Node disk pressure is not proven by one full directory alone; it is proven when the starved signal, the mount and the growing path line up. That separation keeps the response from deleting images for a log problem or truncating logs for an imagefs problem. It also gives the post-incident review a clean chain from alert to threshold to consumer to cleanup.


5. Find the Largest Node Disk Pressure Consumers Safely

Find node disk pressure consumers by ranking directories on the starved filesystem, then map the largest paths back to pods, images, logs or node services. Avoid broad deletes until ownership is clear. The largest directory is a lead, not permission to remove it.

Use filesystem-level ranking first. On nodefs, inspect /var/log, /var/log/pods, /var/lib/kubelet/pods, /var/lib/kubelet and any local volume roots. On imagefs, inspect the runtime root and image list. On containerfs, look for writable-layer growth tied to containers that write to their own filesystem. Keep the scan bounded with -x so it stays on one filesystem and does not wander into network mounts.

bash
df -h / /var/lib/kubelet /var/log /var/lib/containerd
df -i / /var/lib/kubelet /var/log /var/lib/containerd
sudo du -xhd1 /var/log /var/lib/kubelet 2>/dev/null | sort -h
sudo du -xhd2 /var/log/pods 2>/dev/null | sort -h | tail -30
sudo crictl images | head -50

Map paths to workloads before acting. Pod log directories include namespace, pod name and container identifiers. Kubelet pod directories map to volumes and container metadata. Runtime image IDs map to images that may still be referenced by running or recently stopped containers. Deleting by size alone can remove evidence, break a container that expects a file handle, or free space that the kubelet would have reclaimed more safely.

Also check deleted-but-open files. A process can keep writing to a rotated or deleted log file, so directory totals fall while the filesystem stays full. lsof +L1 helps identify that pattern on Linux. If a deleted file is held open, restart or signal the owning process through its normal control path instead of hunting for a path that no longer exists.


6. Image Garbage Collection Limits in Kubernetes DiskPressure

Image garbage collection helps Kubernetes DiskPressure only when unused images are the reclaimable space on imagefs. The kubelet deletes unused images before evicting pods, but image GC cannot fix log floods, emptyDir growth or inode exhaustion caused by millions of small files.

Kubernetes states that the kubelet tries to reclaim node-level resources before terminating end-user pods, including removing unused container images when disk resources are starved. That makes image GC the first automatic defence for imagefs pressure. It is not a general disk cleaner. If the starved filesystem is nodefs and the growth is pod logs, image GC may run and still leave the node under pressure.

Check whether image GC is keeping up. Look at image count, total image size, recent pull activity and kubelet events. A node with rapid image churn can refill imagefs as fast as GC removes old layers, especially when many unique tags land on the same node pool. In that case the durable fix is reducing image size, tightening rollout spread, pre-pulling deliberately, or expanding runtime storage.

Do not manually delete runtime layer directories. Use runtime-aware commands and kubelet behaviour. Manual removal under containerd or Docker storage can corrupt metadata and turn a pressure incident into a node rebuild. If you must force cleanup, cordon the node, confirm which images are unused, and prefer supported runtime pruning paths with a record of what was removed.


7. Inode Exhaustion Behind Node Disk Pressure

Inode exhaustion causes node disk pressure even when gigabytes remain free. The kubelet watches inodesFree signals because filesystems need metadata entries for every file and directory. Millions of small files, cache entries, sessions or logs can exhaust inodes before byte capacity looks dangerous.

Inode pressure is the failure mode that makes df -h look reassuring while pods fail to create files. Applications may report no space left on device even though the filesystem shows free bytes. The kubelet treats low free inodes as a disk eviction signal because the node cannot safely create new files, sockets, logs or container metadata.

Find inode consumers by counting files per directory, not by size. Cache directories, package caches, PHP session stores, build workspaces, log shards and emptyDir scratch areas are common sources. A directory with modest bytes can hold most of the inode table. Rank counts carefully and avoid recursive scans that hammer a distressed node during peak load.

bash
df -i / /var/lib/kubelet /var/log /var/lib/containerd
sudo find /var/log/pods -xdev -type f | wc -l
sudo find /var/lib/kubelet/pods -xdev -type f | wc -l

Cleanup must remove the file factory, not only the files. If a workload creates one file per request and never expires them, deleting the backlog buys minutes. Add retention, rotate by count as well as size, move scratch data to a volume with limits, or fix the application cleanup job. For node-level caches, confirm the owner and regeneration cost before clearing them.


8. Ephemeral Storage and EmptyDir Growth

Ephemeral storage growth drives Kubernetes DiskPressure when pods write logs, caches, scratch files or emptyDir data faster than the node can reclaim space. Requests and limits for ephemeral-storage make that usage visible to scheduling and eviction decisions instead of leaving it as surprise node pressure.

Ephemeral storage is local, temporary and easy to underestimate. Containers write logs to stdout, frameworks write temporary files, sidecars buffer data, and jobs unpack archives into emptyDir. None of that feels like durable storage, yet all of it consumes nodefs or containerfs. When many pods share a node, small local writes become a node-level outage.

Set requests and limits where local disk use is real. A request tells the scheduler the pod needs local storage. A limit gives the kubelet a basis to evict a container that exceeds its local ephemeral storage allowance. That is better than letting one pod consume the shared floor and trigger node-wide DiskPressure for neighbours.

yaml
resources:
  requests:
    ephemeral-storage: "512Mi"
  limits:
    ephemeral-storage: "2Gi"

Use emptyDir.sizeLimit for scratch volumes that should never grow without bound. For large temporary data, prefer a proper volume or object storage workflow. The Kubernetes storage guide covers durable storage choices; DiskPressure work should keep ephemeral data visibly bounded.


9. Container Logs and Journal Pressure

Container logs and journals create node disk pressure when verbose applications, retry loops or debug pods write faster than rotation and retention remove old data. Fix the writer and rotation policy together. Deleting active logs without stopping the source only resets the clock.

Pod logs live on the node filesystem and are part of nodefs pressure. A single container in a tight error loop can write enough output to cross thresholds, especially when log rotation is generous or a debug pod keeps printing stack traces. Node journals add another stream. During an incident, separate pod logs from system journals so the cleanup target is clear.

Check the largest pod log directories and the newest write rate. A static old log is a retention problem. A rapidly growing log is an application or retry problem. If the writer is still active, scale it down, fix the failing dependency, reduce log level, or stop the debug session before cleanup. Otherwise the node will refill while you watch.

Use platform-supported rotation and retention. Kubelet container log rotation settings, runtime log options and journal limits should match node size and incident needs. Avoid manual truncation of active container logs unless your platform explicitly supports it. Safer recovery is to stop or restart the offending workload through Kubernetes, let the runtime close files, then clean old logs with ownership recorded.


10. Why Pods Evict During Kubernetes DiskPressure

Pods evict during Kubernetes DiskPressure when node-level reclaim does not restore enough space or inodes. The kubelet ranks pods by usage against requests, priority and relative overuse. Hard eviction is immediate, so prevention depends on requests, priority and early alerts.

Eviction is the kubelet protecting node stability after reclaim falls short. It sets selected pods to Failed and terminates them. Node-pressure eviction is not the same as API-initiated eviction, and hard eviction does not honour PodDisruptionBudgets or normal termination grace. That is why DiskPressure can cause abrupt replica loss even in a cluster that handles voluntary drains politely.

The ranking logic matters for prevention. Pods using more than their requests are exposed earlier, priority changes order, and relative overuse breaks ties. For disk, the kubelet sorts by relevant local usage depending on filesystem layout: local volumes, logs and writable layers can all count. The QoS classes and eviction order guide explains the wider model, but DiskPressure adds a storage-specific twist: ephemeral-storage requests are the signal that makes local disk use legible.

Watch for eviction loops after the first cleanup. Controllers replace evicted pods, replacements pull images and write logs, and the node crosses the threshold again. If replacements land Pending, use the Pod stuck Pending triage guide to separate scheduling shortage from node pressure. The incident ends when free space and inodes stay above thresholds under normal write load.


11. Safe Cleanup Order for Node Disk Pressure

Use a safe cleanup order for node disk pressure: confirm the starved filesystem, stop the writer, reclaim unused images and dead containers, clean owned logs or caches, then verify thresholds stay clear. Expand storage or drain the node when cleanup cannot create durable headroom.

Start by protecting the node from more work if evictions are spreading. Cordoning prevents new pods from landing while you recover space. Drain only when the node cannot be stabilised or when the workload risk of staying is higher than the disruption of moving. A rushed drain during disk pressure can create image pulls and log writes on neighbouring nodes.

Clean in ownership order. First, stop or fix the active writer. Second, let kubelet and runtime reclaim dead containers and unused images. Third, remove old logs, caches or scratch data whose owner and retention rule are clear. Fourth, handle deleted-but-open files by restarting the owning process through its normal path. Fifth, verify df -h, df -i, node conditions and eviction events for several minutes.

Escalate when the node has no durable headroom. Repeated DiskPressure on the same node pool usually means undersized disks, oversized images, unbounded logs or workloads that need real volumes. Expanding the disk, moving runtime storage, or rebuilding the node with a better layout is an engineering fix, not an admission of defeat. Record the threshold crossed, the consumer found and the headroom restored.


12. Prevent Repeat Kubernetes DiskPressure With Requests and Alerts

Prevent repeat Kubernetes DiskPressure by alerting before hard thresholds, setting ephemeral-storage requests and limits, bounding emptyDir, rotating logs, and sizing node disks for image churn. Prevention works when local storage becomes a scheduled resource with an owner, not a shared surprise.

Alert on trend, not only condition. DiskPressure True is already late because hard eviction may be active. Track filesystem available percentage, inodes free percentage, image count, log growth rate and eviction events by node pool. A node moving from 70 percent to 85 percent in an hour needs attention before the 10 percent free floor becomes the incident.

Make workloads declare local storage. Set ephemeral-storage requests for pods that write meaningful local data, limits for pods that must be contained, and emptyDir.sizeLimit for scratch space. Review sidecars and init containers too; they can write caches and logs that the main container never sees. Priority classes should reflect which pods may be sacrificed first when storage pressure still occurs.

Tune kubelet thresholds deliberately. Soft thresholds can create a warning band, and minimum reclaim can reduce repeated small evictions. Those settings belong in node configuration management with tests, not manual edits during an outage. Pair threshold changes with system and kube reserved capacity so the scheduler does not place pods into a node that is already destined to evict them.

Review node disk pressure by node pool, not only by cluster average. Averages hide the one pool with small disks, heavy image churn or chatty sidecars. For kubernetes diskpressure prevention, track the worst nodes, the fastest-growing log paths and the pods with no ephemeral-storage request. That turns a vague storage concern into owned work: resize the pool, bound the writer, or move the data.


13. Troubleshooting Matrix and Final Checklist for Kubernetes DiskPressure

Use this Kubernetes DiskPressure matrix to match the signal you see with the filesystem, likely consumer and first safe action. Finish only when DiskPressure clears, inodes recover, evictions stop and the writer is controlled. A cleared condition without headroom is a pause, not recovery.

The matrix keeps the response narrow. DiskPressure is one condition with several storage causes, and each cause has a different first move. Read the signal, identify the filesystem, name the consumer, then clean with ownership. If the evidence points back to broad node failure rather than storage, return to the Node NotReady runbook instead of forcing this playbook to fit.

Signal Likely filesystem First check Safe first action
DiskPressure True, bytes low nodefs or imagefs df -h on kubelet, log and runtime paths Stop writer, rank directories, reclaim owned data
DiskPressure True, bytes free nodefs, imagefs or containerfs inodes df -i and file counts Find small-file factory, add retention, clear owned backlog
Evicted for ephemeral-storage nodefs or containerfs Pod usage, logs, emptyDir and writable layer Bound ephemeral storage, fix writer, verify headroom
Image GC running repeatedly imagefs Image count, size and pull churn Reduce image churn, expand runtime disk, prune safely
Disk fills after log cleanup nodefs Deleted-but-open files and active writers Restart owner through Kubernetes, fix rotation
Pods Pending after evictions Node pool capacity Node taints, conditions and allocatable storage Restore headroom before uncordoning

Final checklist: confirm DiskPressure is False, free bytes and free inodes are above thresholds with margin, eviction events have stopped, the largest consumer has an owner, logs and scratch data have bounds, image churn is understood, and alerts would fire before the hard threshold next time. Uncordon only after the node stays clear under normal load.

Frequently Asked Questions

What does Kubernetes DiskPressure mean?

Kubernetes DiskPressure means the kubelet has crossed a disk space or inode eviction threshold on nodefs, imagefs or containerfs. The node may reclaim images and dead containers first, then evict pods if reclaim is not enough. Treat it as an active node storage incident.

How do I fix node disk pressure quickly?

Fix node disk pressure by confirming the starved filesystem, stopping the active writer, reclaiming unused images and dead containers, then cleaning owned logs, caches or scratch data. Verify free bytes and inodes stay above thresholds before uncordoning the node.

Why does Kubernetes DiskPressure happen when disk space looks free?

Kubernetes DiskPressure can happen with free bytes when inodes are exhausted. The kubelet watches inodesFree signals because the filesystem needs metadata entries for files and directories. Millions of small files can trigger pressure before byte capacity looks dangerous.

What are the default Kubernetes DiskPressure thresholds?

The default hard thresholds include nodefs.available below 10 percent, imagefs.available below 15 percent, nodefs.inodesFree below 5 percent and imagefs.inodesFree below 5 percent on Linux. Hard thresholds act immediately without a grace period.

Does image garbage collection fix Kubernetes DiskPressure?

Image garbage collection fixes Kubernetes DiskPressure only when unused images are the reclaimable space on imagefs. It cannot fix pod log floods, emptyDir growth, writable-layer abuse or inode exhaustion from small files. Match cleanup to the starved filesystem.

Why are pods evicted for ephemeral-storage during node disk pressure?

Pods are evicted for ephemeral-storage when local disk use contributes to node pressure or exceeds local storage limits. The kubelet ranks pods by usage against requests, priority and relative overuse after node-level reclaim falls short.

How can I prevent Kubernetes DiskPressure from returning?

Prevent Kubernetes DiskPressure by alerting on disk and inode trends before hard thresholds, setting ephemeral-storage requests and limits, bounding emptyDir, rotating logs, controlling image churn and sizing node disks for the workload. Local storage needs an owner and a limit.

⚡ KUBERNETES SCENARIO INTERVIEW PREP

Preparing for Senior Platform & SRE Interviews

Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.

Explore Interview Scenarios →