Claiming Persistent Volumes

Learn why and how to claim a PersistentVolume.

Usage of Persistent Volume

Kubernetes PersistentVolumes are useless if no one uses them. They exist only as objects with relation to, in our case, specific EBS volumes. They are waiting for someone to claim them through the PersistentVolumeClaim resource.

Just like Pods that can request specific resources like memory and CPU, PersistentVolumeClaims can request particular sizes and access modes. Both are, in a way, consuming resources, even though of different types. Just as Pods should not specify on which node they should run, PersistentVolumeClaims cannot define which volume they should mount. Instead, the Kubernetes scheduler will assign them a volume depending on the claimed resources.

How can we claim PersistentVolumes?

We’ll use pv/pvc.yml to explore how we can claim a PersistentVolume.

Get hands-on with 1200+ tech skills courses.