Interview Prep/Kubernetes/Storage and volumes

A PVC deletion hangs with status `Terminating`.

BeginnerTroubleshootingStorage and volumes
Answer

Likely causes → The kubernetes.io/pvc-protection finalizer: a Pod (even a Completed or Failed one) still references the PVC.

Diagnose →

kubectl get pvc data -o jsonpath='{.metadata.finalizers}{"\n"}'
kubectl get pods -A -o json | jq -r '.items[] | select(any(.spec.volumes[]?; .persistentVolumeClaim.claimName=="data")) | "\(.metadata.namespace)/\(.metadata.name) \(.status.phase)"'

Fix → Delete or scale down the Pods using it; the finalizer is removed automatically and the PVC goes. Do not strip the finalizer while a Pod is using the volume.

Prevent → Scale workloads to zero before deleting their PVCs in runbooks.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Storage and volumes