Skip to content

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 scp to 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.