# List storage classes
kubectl get storageclass
# List PersistentVolumes
kubectl get pv
# List PersistentVolumeClaims
kubectl get pvc -A
# Describe PVC for details
kubectl describe pvc my-app-data
# Check PVC events
kubectl get events --field-selector involvedObject.name=my-app-data
kubectl edit pvc my-app-data
spec:
resources:
requests:
storage: 20Gi # Increased from 10Gi
# Delete pod to trigger remount (for Deployment)
kubectl delete pod <pod-name>
# For StatefulSet
kubectl rollout restart statefulset <statefulset-name>
# Check PVC size
kubectl get pvc my-app-data
# Check from inside pod
kubectl exec <pod-name> -- df -h /data
# Check PVC usage
kubectl exec <pod-name> -- df -h
# Monitor regularly
# Set up alerts for high usage
# ❌ Bad: Multiple replicas with RWO
replicas: 3
volumes:
- persistentVolumeClaim:
claimName: shared-data # RWO - only one can mount
# ✅ Good: Use StatefulSet with volumeClaimTemplates
# Or use single replica with RWO
# Check CSI pods
kubectl get pods -n kube-system | grep csi
# Check PVC events
kubectl describe pvc <pvc-name>
# Check if storage provisioning completed
kubectl get pvc <pvc-name>
# Verify storage class exists
kubectl get storageclass
# Check PVC status
kubectl get pvc
# Check pod events
kubectl describe pod <pod-name>
# Check CSI node plugin on node
kubectl get pods -n kube-system -l app=csi-cinder-nodeplugin -o wide
# If RWO, ensure only one pod uses volume
kubectl get pods -o wide | grep <pvc-name>
# Check current usage
kubectl exec <pod-name> -- df -h /data
# Expand volume (see Expanding Volumes section)
kubectl edit pvc <pvc-name>
# Increase storage size
# Restart pod
# Or clean up data
kubectl exec <pod-name> -- rm -rf /data/old-files