A PersistentVolumeClaim Requests Storage and a StorageClass Provisions It

In progress Kubernetes

Kubernetes separates asking for storage from providing it. A developer writes a PersistentVolumeClaim (PVC): "100 GiB, read-write, of this class". A PersistentVolume (PV) is the actual storage behind it. With a StorageClass and a provisioner, PVs are created on demand, so nobody has to know which server or disk holds the data.

The Three Objects

Object Written by Represents
PersistentVolume an admin, or a provisioner real storage: an NFS export, a cloud disk, a local path
PersistentVolumeClaim the app's manifest a request: size, access mode, class
StorageClass an admin a kind of storage and the provisioner that creates it

Kubernetes binds each PVC to a PV that satisfies it. With static provisioning an admin creates PVs in advance; with dynamic provisioning the provisioner sees a PVC for its StorageClass, creates the storage, then the PV, then binds them.

Local vs Network Storage

Local (local-path) Network (NFS, Ceph, Longhorn)
Speed the node's own disk: fastest goes over the network
Pod placement tied to that one node any node can mount it
Shared by several pods no possible (ReadWriteMany with NFS)
If the node dies data unreachable data survives

Longhorn, built for bare metal, replicates each volume across several nodes' disks, combining local disks with network-style resilience.

References

Review cards

Flashcard What does a PersistentVolumeClaim describe, and what does it leave out?

What the app needs: size, access mode and StorageClass. Not where the storage lives; Kubernetes binds the claim to a PersistentVolume that satisfies it.

Flashcard How does dynamic provisioning differ from static provisioning?

Static: an admin creates PVs in advance for claims to bind to. Dynamic: the StorageClass's provisioner sees a new PVC, creates the storage and the PV, then binds them.