In traditional IT environments, storage is managed by system administrators. End users only follow instructions to use the storage without worrying about its internal management.
In containerized environments, the same principle should apply. However, given the multiple volume types available, storage management can become complex.
Kubernetes addresses this issue using the Persistent Volume (PV) subsystem.
A Persistent Volume (PV) is a cluster-wide storage resource that allows data to persist beyond the lifecycle of a pod.
Unlike temporary storage on a worker node, PVs rely on external storage solutions such as AWS EBS, NFS, or distributed filesystems like Ceph.
Kubernetes provides APIs for both users and administrators to manage and consume storage effectively.
Kubernetes uses:
PersistentVolume (PV) API to manage storage resources.
PersistentVolumeClaim (PVC) API to request and consume storage.
Understanding PersistentVolumeClaim (PVC) ⇒
Before using a Persistent Volume, you need to claim it through a Persistent Volume Claim (PVC).
A PVC requests a PV with specific attributes like size, access modes, and speed.
Once Kubernetes finds a suitable PV, it binds it to the PVC, making it available for the pod.
The PV can be mounted as a volume inside the pod.
After use, the PVC releases the PV, allowing it to be reclaimed and reused.
AWS EBS (Elastic Block Store) as a Persistent Volume ⇒