Practical guide

Kubernetes Ephemeral Storage: Requests, Limits, and Node Capacity

Learn what Kubernetes ephemeral storage includes, estimate pod requests and limits, and avoid confusing it with persistent volume capacity.

By StackCalcs · Updated · Sources checked

Kubernetes ephemeral storage is the node-local space used by container writable layers, logs, and disk-backed emptyDir volumes. It is different from persistent volume capacity and should be planned separately. An emptyDir with medium: Memory consumes memory instead, so include it in the container’s memory budget.

Quick answer

Multiply the number of replicas by the per-pod request to estimate scheduled ephemeral-storage capacity. Multiply by the per-pod limit to estimate the maximum configured allowance. The Kubernetes ephemeral storage calculator performs both conversions in GiB and MiB.

For example, six pods requesting 2 GiB each need 12 GiB of requested ephemeral storage. A 4 GiB limit per pod creates a 24 GiB aggregate limit.

Requests and limits: a configuration example

Set ephemeral-storage in each container’s resource requests and limits. The request informs scheduling; a limit is an eviction threshold, not a preallocated disk partition. This illustrative fragment belongs inside a container specification:

resources:
  requests:
    ephemeral-storage: "2Gi"
  limits:
    ephemeral-storage: "4Gi"

For two regular containers requesting 2 GiB and 512 MiB, the per-pod request is 2.5 GiB. Six replicas therefore request 15 GiB, rather than the 12 GiB obtained by counting only the main container. Include sidecars when entering the per-pod figure in the calculator.

Turn replica totals into a node budget

Consider a planning scenario with 40 GiB of allocatable ephemeral storage on one node. Existing pod requests total 18 GiB; your operational policy holds another 7 GiB of spare capacity. That leaves 40 − 18 − 7 = 15 GiB for the new workload’s requested capacity. Six 2.5 GiB pods exactly consume that planning allowance, leaving no room for an extra rollout replica within it.

The 7 GiB reserve is an example assumption, not a Kubernetes default. Replace it with your own headroom and avoid subtracting a reservation twice if it is already excluded from the node’s allocatable figure. CPU, memory, pod slots, and placement constraints must also fit; compare those separately with the pod capacity calculator.

Investigate ephemeral-storage eviction

Read the pod’s events and node conditions before raising a limit:

kubectl describe pod POD_NAME -n NAMESPACE
kubectl describe node NODE_NAME

Distinguish a container exceeding its limit from node-wide DiskPressure. Check writable-layer growth, log retention, and disk-backed temporary volumes. A larger limit does not create disk space. Confirm that the node’s filesystem layout supports kubelet storage accounting; otherwise the expected enforcement may not apply. Use Gi or Mi intentionally: lowercase m means millibytes, not megabytes.

What the estimate leaves out

The arithmetic does not prove that a node can safely host the workload. Compare the result with node allocatable ephemeral storage, kubelet eviction thresholds, image-layer usage, system logs, and DaemonSets. A pod can also be evicted when the node is under disk pressure even when its configured limit has not been reached.

Use the result as a capacity-planning input, then verify it against observed disk usage and the node’s eviction behavior.

Official sources

Related calculators

Continue reading