Why do we need volumes in K8s
- If two containers in same pod want to share data. These are ephimeral volume ( emptyDir )
- Persistent Volumes : All cloud providers provide u block storage. These can be externally provisioned through K8s.
- When pod needs extra space during execution.
Ephemeral Volumes
- EmptyDir : Type of ephemeral volume that lets container share the file system.
Persistent Volume ( PV ) and Persistent Volume Claim ( PVC )

- Anytime someone needs an external space they can claim for that space.
- Every PVC has an attached PV. PVC lets u find best PV as per requirement
- PVCs can be automatically generated as well as manually provisioned.
Ephemeral Volumes
Persistent Volumes
- can be used in case of self hosted db
- Pods can ask for storage through a PVC on a persistent volume.
Static Persistent Volumes
Automatic Persistent Volumes