Storage class

StorageClass ← defines how storage is provisioned (provisioner, params) │ ▼ PV ← actual piece of storage (disk, NFS share, cloud volume) │ ▼ PVC ← a claim by a namespace saying "I need X GB, this class, this access mode" │ ▼ Pod ← mounts the PVC as a volume

Two flows

Static: Admin pre-creates the PV. PVC comes in, Kubernetes finds a matching PV (by size, access modes, class, selector) and binds them. StorageClass may not even be needed, use storageClassName: "" on both sides.

Dynamic: PVC comes in with a storageClassName. Kubernetes looks up that StorageClass, uses its provisioner to create a PV on the fly, binds it to the PVC. No manual PV needed.

Matching rules (what must line up for binding)

storageClassName -> same for PV and PVC accessModes -> PV must include what PVC is asking for capacity -> PV >= to PVC request volumeMode -> same for PV and PVC

PV + PVC both say storageClassName: standard, but no StorageClass object called standard exists in the cluster.

Run:

kubectl get pv kubectl get pvc kubectl describe pvc