Kubernetes ephemeral-storage of containers Kubernetes ephemeral-storage of containers kubernetes kubernetes

Kubernetes ephemeral-storage of containers


You can see the allocated resources by using kubectl describe node <insert-node-name-here> on the node that is running the pod of the deployment.

You should see something like this:

Allocated resources:  (Total limits may be over 100 percent, i.e., overcommitted.)  Resource                       Requests      Limits  --------                       --------      ------  cpu                            1130m (59%)   3750m (197%)  memory                         4836Mi (90%)  7988Mi (148%)  ephemeral-storage              0 (0%)        0 (0%)  hugepages-1Gi                  0 (0%)        0 (0%)  hugepages-2Mi                  0 (0%)        0 (0%)  attachable-volumes-azure-disk  0             0

When you requested 50Mi of ephemeral-storage it should show up under Requests.When your pod tries to use more than the limit (100Mi) the pod will be evicted and restarted.

On the node side, any pod that uses more than its requested resources is subject to eviction when the node runs out of resources. In other words, Kubernetes never provides any guarantees of availability of resources beyond a Pod's requests.

In kubernetes documentation you can find more details how Ephemeral storage consumption management works here.

Note that using kubectl exec with df command might not show actual use of storage.

According to kubernetes documentation:

The kubelet can measure how much local storage it is using. It does this provided that:

  • the LocalStorageCapacityIsolation feature gate is enabled (the feature is on by default), and
  • you have set up the node using one of the supported configurations for local ephemeral storage.

If you have a different configuration, then the kubelet does not apply resource limits for ephemeral local storage.

Note: The kubelet tracks tmpfs emptyDir volumes as container memory use, rather than as local ephemeral storage.