Skip to main content
This lab reviews Kubernetes StorageClass, PersistentVolume (PV), and PersistentVolumeClaim (PVC) behaviors—especially how volumeBindingMode affects when a PVC is bound. We’ll inspect StorageClasses, identify which support dynamic provisioning, create a PVC that remains pending due to delayed binding, create a Pod to trigger binding, and then create a no-provisioner StorageClass with delayed binding. Keywords: Kubernetes StorageClass, PersistentVolume, PersistentVolumeClaim, WaitForFirstConsumer, dynamic provisioning, no-provisioner.

1) How many StorageClasses exist in the cluster?

Check the cluster’s StorageClasses:
You can use the short alias:
At this point the cluster has one StorageClass: local-path.

2) Which StorageClass does not support dynamic provisioning?

After creating more StorageClasses, list them again:
The kubernetes.io/no-provisioner provisioner indicates a StorageClass that does not support dynamic provisioning. In this example, local-storage is configured for static provisioning—meaning PVs must be pre-provisioned. StorageClass quick reference:

3) What is the volumeBindingMode used for the local-storage StorageClass?

From the output above, local-storage has:
  • VOLUMEBINDINGMODE: WaitForFirstConsumer
Meaning: binding (and provisioning when applicable) is delayed until a Pod that consumes the PVC is scheduled. This ensures the PV is bound on a node where the Pod can actually run and access the storage.

4) What is the provisioner for portworx-io-priority-high?

From the same output:
  • PROVISIONER for portworx-io-priority-high is kubernetes.io/portworx-volume.
This indicates Portworx is responsible for dynamic provisioning for that StorageClass.

5) Is there a PVC consuming the PV named local-pv?

Inspect PVs and PVCs:
No PVCs are claiming local-pv at this time; local-pv is Available.

6) Create a PersistentVolumeClaim named local-pvc that should bind to local-pv

To bind a PVC to an existing PV you must match capacity, access modes, and storageClassName. Create pvc.yaml:
Create the PVC:
Check PVC status:
The PVC is Pending. Describe it to see why:
Why is it Pending? Because the StorageClass local-storage uses volumeBindingMode: WaitForFirstConsumer. Binding is intentionally delayed until a Pod that consumes the PVC is scheduled.
StorageClasses with volumeBindingMode: WaitForFirstConsumer delay the PV/PVC binding until a Pod that uses the PVC is created and scheduled. This is commonly used for local volumes so the scheduler can place the Pod on a node that has access to the PV.

7) Create a Pod that consumes the PVC (so the PVC can bind)

Create nginx-pod.yaml which mounts the local-pvc at /var/www/html:
Create the Pod:
Check the Pod status:
Now re-check the PVC:
The PVC is now Bound to local-pv. Creating the Pod triggered the binding because of WaitForFirstConsumer. The scheduler decided the Pod’s node and the persistentvolume-controller completed the binding.

8) Create a StorageClass named delayed-volume-sc with no-provisioner and WaitForFirstConsumer

Create delayed-volume-sc.yaml:
Create the StorageClass:
Verify StorageClasses:
delayed-volume-sc is created with provisioner: kubernetes.io/no-provisioner and volumeBindingMode: WaitForFirstConsumer. It expects statically provisioned PVs and will delay binding until a consuming Pod is scheduled.
Summary
  • Use kubectl get sc to list StorageClasses and inspect PROVISIONER and VOLUMEBINDINGMODE.
  • kubernetes.io/no-provisioner indicates static provisioning (no dynamic provisioning).
  • WaitForFirstConsumer delays binding until a Pod using the PVC is scheduled—useful for local volumes.
  • Creating a Pod that references a PVC using a WaitForFirstConsumer StorageClass triggers binding to a matching PV.
Further reading and references

Watch Video