Module 5: State & Storage
๐๏ธ 1. The Manual Task: Host Path Storage
In a manual setup, stateful applications (like databases) write data to the disk of the server they are running on.
The Problem:
- Node Lock-In: The data is trapped on the server.
- Downtime: If the node catches fire, you must manually restore the data from a backup or use
scpto move it.
๐พ 2. The Kubernetes Abstraction: PVs & PVCs
Kubernetes decouples storage from the lifecycle of the Pod and the node.
- PersistentVolume (PV): A virtual slice of network storage (EBS, NFS).
- PersistentVolumeClaim (PVC): A Podโs โrequestโ to use that storage.
- Dynamic Attachment: If a node fails, Kubernetes automatically detaches the storage and re-attaches it to the new node where the Pod is rescheduled.