Docker & Kubernetes · Module 11
Kubernetes Storage and Configuration – Volumes, PV/PVC, ConfigMaps, Secrets
Mount volumes into pods, request durable storage through PVCs and StorageClasses, and keep configuration and secrets out of images with ConfigMaps and Secrets.
What you will learn
- Choose emptyDir, hostPath or other volumes by data lifetime
- Explain PVs, PVCs, access modes and binding
- Use StorageClasses for dynamic provisioning and understand reclaimPolicy and snapshots
- Create and use ConfigMaps and Secrets safely
Lessons
- Volumes in a Pod — emptyDir, hostPath and others
Volumes are declared in spec.volumes and mounted with volumeMounts; emptyDir lives with the pod, hostPath lives on one node.
- PersistentVolumes and PersistentVolumeClaims
A PV is cluster storage, a PVC is an app's request for storage; pods use PVCs, never PVs directly.
- StorageClasses and Volume Snapshots
StorageClasses let PVs be created automatically by storage "type"; reclaimPolicy decides the fate of the real disk; snapshots need a CSI driver.
- ConfigMaps and Secrets
ConfigMaps hold configuration, Secrets hold sensitive data; both reach pods as env vars or volumes. Base64 is not encryption.