Is Kubernetes ephemeral storage elastic?

4/4/2019

In Kubernetes pods have requests and limit for ephemeral storage. But it isn't clear whether this is an elastic resource i.e. if you save a file inside a K8S pod and then delete it, does the ephemeral storage usage go up and then back down again? Or once you have consumed any ephemeral storage, does that usage count towards the overall usage for the lifetime of the pod?

-- Phyxx
kubernetes

1 Answer

5/30/2019

As you mentioned, Kubernetes Ephemeral storage can be managed by implementing requests and limits for the containers inside a Pod, that is quite well described in the official k8s documentation.

Although, on Pod level local storage consists of a sum of entire container consumers, the main capacitor here is Node where the Pod actually resides on. Node level represents a mechanism of Allocation compute resources between a Pods which are spawned on this Node as per K8s scheduler Decision. The way how the compute resources are distributed between underlying Pods on the particular Node is nicely described in this Example.

Generally, when the Pod successfully assigned to a Node it obtains emptyDir as a part of local ephemeral storage volume as well as container logs, image layers and container writable layers; furthermore container disaster does not affect parent Pod emptyDir data.

Basically, Ephemeral storage is persistent during life of the Pod, although it counts resources shared by all containers in the Pod, the most common usage would be for storing temporary or caching data.

-- mk_sta
Source: StackOverflow