Hands-on Lab·Certified Kubernetes Administrator
Volumes: emptyDir and hostPath
Two containers share an emptyDir, then the Pod is deleted and the data is gone. A hostPath survives that, and is read back from the node's own filesystem, but the identical path on another node holds nothing at all.
Storage Guide 65 of 103 Beginner
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 30 min
- Reviewed21 August 2026
Written against the versions above. Disk sizes are this lab's. The lifetime rules are properties of the volume types.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
Before you start
- The Pods guide, particularly the multi-container section.
- A cluster with at least two worker nodes, for the last step.
- SSH with
sudoon a worker node, to read the hostPath directory from outside Kubernetes.
-
emptyDir is how two containers share a filesystem
-
Delete the Pod and the emptyDir goes with it
-
hostPath writes to the node, and you can prove it
-
The same hostPath on another node is a different directory