liveBook · Manning

Emptydir volume

An emptyDir volume is a Kubernetes volume that starts empty, is available to containers in a Pod, and is deleted when the Pod leaves its node.

How 3 Manning books explain it

Kubernetes in Action, Second Edition

An emptyDir volume is a Kubernetes volume that starts empty, persists for the lifetime of its pod, and can be shared by containers in that pod.

How it is used
Provides temporary writable storage, preserves files across container restarts, and shares files between containers in one pod.
How deep it goes
Works through pod volume and container mount definitions, storage options, restart verification, and init-container initialization; does not detail persistent storage setup.
Examples
Uses a MongoDB pod manifest, database checks before and after a restart, and an init container that copies a startup script.
What you can do after
Build it from scratch in a Pod manifest, mount it in containers, and verify that files survive a container restart.

Read how Kubernetes in Action, Second Edition explains emptydir volume →

Kubernetes for Developers

emptyDir is a Kubernetes volume type that provides temporary node-backed storage for a Pod and is deleted when the Pod leaves the node.

How it is used
Shares temporary files between containers and retains cache or setup data across individual container restarts.
How deep it goes
Defines node-backed storage, lifecycle loss, restart persistence, and mounting patterns, but defers scratch-space alternatives.
Examples
Uses a cache mount and Redis configuration copied from a ConfigMap into shared emptyDir storage.
What you can do after
Apply it by declaring an emptyDir volume and mounting it wherever Pod containers need temporary shared storage.

Read how Kubernetes for Developers explains emptydir volume →

Acing the Certified Kubernetes Administrator Exam, Second Edition

An emptyDir volume is a Kubernetes volume type that provides initially empty storage for a pod and is deleted when the pod is deleted.

How it is used
Provides temporary pod-local storage for sidecars, log collection, and ephemeral application data.
How deep it goes
Defines YAML placement, mounts it into a container, verifies EmptyDir with kubectl describe, and contrasts it with persistent storage.
Examples
Uses a BusyBox log-collector mounted at /var/log and a Redis pod with ephemeral data.
What you can do after
Build it from scratch with kubectl and YAML, then verify the pod and mounted volume.

Read how Acing the Certified Kubernetes Administrator Exam, Second Edition explains emptydir volume →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.