Interview Prep/Kubernetes/Storage and volumes

A PVC sits `Pending` with event `waiting for first consumer to be created before binding`. Is something broken?

BeginnerTroubleshootingStorage and volumes
Answer

Likely causes → No. The StorageClass uses volumeBindingMode: WaitForFirstConsumer, so the volume is provisioned only when a Pod using the PVC is scheduled, in that Pod's zone.

Diagnose →

kubectl get sc gp3 -o jsonpath='{.volumeBindingMode}{"\n"}'
kubectl get pods -A -o json | jq -r '.items[] | select(.spec.volumes[]?.persistentVolumeClaim.claimName=="data") | .metadata.name'

Fix → Create the Pod that uses it. If the Pod exists but is Pending, debug the Pod's scheduling instead; the PVC waits on it.

Prevent → Know this is normal and do not "fix" it by switching to Immediate, which causes zone mismatches.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Storage and volumes