Using an emptyDir
In Kubernetes, an emptyDir is a simple ephemeral volume type that provides temporary storage to a pod during its lifetime. It is created when a pod is assigned to a node, and deleted when the pod is removed from that node.
TOC
Example emptyDir
This Pod creates a temporary volume mounted at /data, which is shared with the container.
Optional Medium Setting
You can choose where the data is stored:
Key Characteristics
Common Use Cases
-
Caching intermediate build artifacts
-
Buffering logs
-
Temporary work directories
-
Sharing data between containers in the same pod (like sidecars)