π§΅ Kubernetes Storage β Masterclass Thread ππ From EmptyDir β PV/PVC...

Kubernetes does not store data itself.
It only orchestrates how your Pods claim storage from underlying systems (EBS, NFS, Ceph, local disks, etc.)
This abstraction gives portability.
Pods die β volumes die
Apps need data that outlives pods (DB, MQ, CMS, etc.)
Enter PV + PVC model:
PV β actual storage (NFS, EBS, Ceph, SAN)
PVC β user request for storage
Defines what happens to PV after PVC is deleted:
Delete β storage destroyed
Retain β manual cleanup needed
Recycle (deprecated)
Production DBs often use Retain.
CSI makes storage plugin based.
No more in-tree drivers.
Supports block, file, snapshots, resizing.
Common CSI drivers:
AWS EBS
Azure Disk/File
GCP PD
Ceph RBD / CephFS
Longhorn
OpenEBS
vSphere CSI
NFS CSI
Fastest storage available β local SSDs
But Pod must run on same node β use nodeAffinity.
Great for Kafka, Elastic, Redis.
Backed by NFS or EFS:
accessModes: ["ReadWriteMany"]
Multiple replicas can write to the same folder.
β Using hostPath in production
β Using RWO volumes with multiple pods
β Using local PVs without nodeAffinity
β Forgetting Retain/Delete policy
β Storing DB on emptyDir










