Interview Prep/Kubernetes/Storage and volumes

A Pod that mounts a large PVC takes 10 minutes to start, stuck in ContainerCreating with no errors.

IntermediateTroubleshootingStorage and volumes
Answer

Likely causes → fsGroup is set and the kubelet recursively changes ownership and permissions of every file on the volume at each mount. Millions of files means minutes.

Diagnose →

kubectl get pod data-x -o jsonpath='{.spec.securityContext}{"\n"}'
# On the node, look for kubelet logging the volume ownership change
journalctl -u kubelet | grep -i 'SetVolumeOwnership'

Fix → Set fsGroupChangePolicy: OnRootMismatch so the chown only runs when the root directory ownership is wrong.

Prevent → Default OnRootMismatch in all stateful charts.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Storage and volumes