A Postgres StatefulSet pod crashed with "could not extend file "base/16384/2619": No space left on device". The PVC is 50Gi.

BeginnerTroubleshootingDisk, memory and CPU
Answer

Likely causes → The persistent volume filled up: data growth, WAL build-up, or bloat from tables that are never vacuumed.

Diagnose →

kubectl exec pg-0 -- df -h /var/lib/postgresql/data
kubectl get pvc data-pg-0 -o jsonpath='{.spec.resources.requests.storage}'
kubectl get storageclass gp3 -o jsonpath='{.allowVolumeExpansion}'

Fix → If the StorageClass has allowVolumeExpansion: true, edit the PVC size and the CSI driver grows the volume and filesystem online:

kubectl patch pvc data-pg-0 -p '{"spec":{"resources":{"requests":{"storage":"100Gi"}}}}'
kubectl get pvc data-pg-0 -w

Also update volumeClaimTemplates in your source of truth so new replicas match (the StatefulSet field itself is immutable; re-create the StatefulSet object with --cascade=orphan if needed).

Prevent → Alert on kubelet_volume_stats_available_bytes / kubelet_volume_stats_capacity_bytes < 0.2 and only use StorageClasses that allow expansion for databases.

All Real-World Interview questions Roadmap: Interview readiness

More on Disk, memory and CPU