Infrastructure

Azure AKS: diagnose DiskPressure before resizing the node pool

A production runbook for separating disk capacity, inodes, logs, images and ephemeral storage pressure on AKS before choosing cleanup, workload correction, capacity or rollback.

29 Oct 2026 azureakskubernetesdiskpressureephemeral-storagecontainerdobservabilitykqlrunbookrollbackproduction

An AKS node reports DiskPressure. New pods remain Pending, other pods are evicted, and a deployment gradually loses capacity. The OS disk looks almost full on one node while its peers remain healthy. The immediate proposal is usually to enlarge the disk, add nodes, or restart the node pool.

Those actions can restore headroom, but they do not reveal whether logs, image layers, an emptyDir, a writable layer, deleted files held open, or a runtime fault consumed the space. This runbook starts with an observable DiskPressure condition, identifies the filesystem and producer, and ends with a decision: reclaim space through a bounded action, repair the workload, replace the node, add justified capacity, or roll back to the last healthy revision.

Freeze the symptom before evicting anything manually

Record the UTC window, cluster, node pool, node, first DiskPressure transition, evicted pods, application revision, and recent changes. A cluster average can easily hide a single saturated node.

bash 01-capture-diskpressure.sh
kubectl get nodes -o custom-columns='NAME:.metadata.name,READY:.status.conditions[?(@.type=="Ready")].status,DISK:.status.conditions[?(@.type=="DiskPressure")].status,TAINTS:.spec.taints[*].key'

NODE="aks-userpool-12345678-vmss00000a"

kubectl describe node "$NODE" > node-describe.txt
kubectl get events -A --sort-by=.lastTimestamp > kubernetes-events.txt
kubectl get pods -A --field-selector spec.nodeName="$NODE" -o wide > pods-on-node.txt
kubectl get pods -A --field-selector status.phase=Failed -o custom-columns='NAMESPACE:.metadata.namespace,NAME:.metadata.name,NODE:.spec.nodeName,REASON:.status.reason' > failed-pods.txt

Do not immediately delete evicted pods or restart the whole pool. Events often show whether kubelet ran short of bytes or inodes and which pods it selected. A restart can temporarily release files and erase the useful timeline.

Keep the incident statement testable: “between 07:42 and 07:51 UTC, node vmss00000a entered DiskPressure, six pods were evicted, and revision catalog-84d7f had been deployed 18 minutes earlier.”

Identify the filesystem that is actually under pressure

DiskPressure does not only mean “the OS disk is full.” Kubelet can react to available capacity or free inodes on nodefs, imagefs, or, depending on runtime and version, containerfs. Container logs, emptyDir volumes, writable layers, and images do not necessarily share the same filesystem.

Read Kubernetes conditions and events first. If node access is authorized by the incident procedure, inspect mounts without changing the system. A node debug container commonly mounts the host root under /host; prove that behavior in your environment before running any command.

bash 02-read-node-filesystems.sh
NODE="aks-userpool-12345678-vmss00000a"

kubectl debug node/"$NODE" -it --image=mcr.microsoft.com/cbl-mariner/base/core:2.0 -- sh -c 'df -h /host /host/var/lib/kubelet /host/var/lib/containerd /host/var/log; df -i /host /host/var/lib/kubelet /host/var/lib/containerd /host/var/log'

Healthy byte capacity with almost no free inodes points to a large number of small files. A saturated imagefs with a healthy nodefs instead points toward images or runtime layers. Do not collapse those signals into one disk percentage.

Correlate the pressure with Azure Monitor

When Container insights collects disk metrics, InsightsMetrics can compare nodes and paths over the exact incident window. Confirm the collection contract first: some cost-optimized configurations disable the required performance data.

kusto 03-aks-disk-used-percent.kql
let start = datetime(2026-10-29T07:30:00Z);
let stop = datetime(2026-10-29T08:00:00Z);
InsightsMetrics
| where TimeGenerated between (start .. stop)
| where Origin == "container.azm.ms/telegraf"
| where Namespace == "container.azm.ms/disk"
| extend Tags = todynamic(Tags)
| extend Node = tostring(Tags.hostName), Path = tostring(Tags.path)
| where Name in ("used_percent", "free")
| summarize LastValue = arg_max(TimeGenerated, Val) by Node, Path, Name
| order by Node asc, Path asc

Then correlate evictions and node transitions. Exact columns can differ with the collection mode; adapt the project to the workspace schema instead of making the query broadly permissive.

kusto 04-diskpressure-events.kql
let start = datetime(2026-10-29T07:30:00Z);
let stop = datetime(2026-10-29T08:00:00Z);
KubeEvents
| where TimeGenerated between (start .. stop)
| where Reason has_any ("DiskPressure", "Evicted", "EvictionThresholdMet", "FreeDiskSpaceFailed")
| project TimeGenerated, Computer, Namespace, Name, Reason, Message
| order by TimeGenerated asc

No rows do not prove that no pressure occurred. Confirm that KubeEvents and node metrics were collected during the window.

Find the producer

Classify the cause before cleaning anything:

  • logs: a new revision loops, emits large stack traces, or bypasses rotation;
  • emptyDir: an export, cache, batch, or temporary file grows without a bound;
  • writable layer: the application writes to its container filesystem instead of the intended volume;
  • images: numerous tags, large images, repeated pulls, or garbage collection that cannot recover enough headroom;
  • deleted but open files: space remains allocated while a process holds the descriptor;
  • runtime or host: system logs, containerd state, corruption, or inconsistency that should be treated as a node fault.

Start with Kubernetes. ephemeral-storage requests and limits, emptyDir size limits, and pod placement often explain why one node carries more risk than its peers.

bash 05-inventory-ephemeral-storage.sh
NODE="aks-userpool-12345678-vmss00000a"

kubectl get pods -A --field-selector spec.nodeName="$NODE" -o json | jq -r '.items[] | [.metadata.namespace,.metadata.name,([.spec.containers[].resources.requests["ephemeral-storage"] // "0"] | join(",")),([.spec.containers[].resources.limits["ephemeral-storage"] // "0"] | join(","))] | @tsv'

kubectl get pods -A --field-selector spec.nodeName="$NODE" -o yaml > node-pods.yaml
kubectl get events -A --field-selector involvedObject.kind=Pod --sort-by=.lastTimestamp > pod-events.txt

If host inspection is authorized, use bounded read-only commands against /var/log, /var/lib/kubelet, and runtime storage. Avoid an unbounded filesystem-wide du on a node already under pressure. Never delete directories managed by kubelet or containerd directly: the on-disk state can diverge from the runtime’s view.

Separate immediate recovery from the durable fix

A containment action should reduce pressure without hiding the producer: suspend a faulty CronJob, scale a revision to zero, reduce concurrency, or disable a recently enabled debug log level. Preserve the previous image and evidence before changing anything.

For the workload, set realistic ephemeral-storage requests and limits, bound emptyDir, move durable data off the node, and verify log rotation. A limit protects the node, but it also turns uncontrolled growth into a repeatable eviction. Test how the application recovers.

yaml 06-ephemeral-storage-budget.yaml
resources:
requests:
  cpu: 250m
  memory: 256Mi
  ephemeral-storage: 1Gi
limits:
  memory: 512Mi
  ephemeral-storage: 3Gi
volumeMounts:
- name: scratch
  mountPath: /work
volumes:
- name: scratch
  emptyDir:
    sizeLimit: 2Gi

If the node remains unstable, cordon it before maintenance, prove that the remaining capacity can absorb its pods, and respect PodDisruptionBudgets. Replacing the node can be safer than deep manual cleanup. It will not fix a workload that fills its replacement in the same way.

Increasing disk size or moving to a VM SKU with more local storage is a capacity decision, not a universal repair. Justify it with expected peaks, kubelet headroom, growth rate, image count, and ephemeral-storage budgets. Also verify the pool’s OS disk type: an ephemeral OS disk does not behave like a managed disk, and node replacement must be treated as destructive for local data.

Validate, expand, or roll back

Validate the correction on one workload or canary node pool. DiskPressure must remain False, free bytes and inodes must keep headroom through a representative peak, no new eviction should appear, and the workload must complete its functional journey.

Expand a workload correction when disk growth is bounded and requests reflect observed use. Expand a capacity change when consumption is legitimate, the model includes images, logs, and deployment peaks, and the canary confirms recovery time.

Roll back the image or configuration when pressure started with higher log volume, a new cache, or an unbounded emptyDir. Roll back the node-pool change when the new disk profile, ephemeral mode, or rotation process differs from the approved plan. If a node shows corruption, runtime instability, or unexplained divergence, isolate it and open a platform investigation instead of standardizing manual cleanup.

Conclusion

DiskPressure is a kubelet protection signal, not a capacity diagnosis by itself. A useful runbook connects the node transition to one filesystem, one consumption type, and one revision before changing the pool.

The production decision is then explicit: contain the producer, bound ephemeral storage, replace a degraded node, add measured capacity, or roll back the revision that created the pressure. Validation covers disk headroom, the absence of evictions, and service recovery.