How do you monitor persistent volume usage for StatefulSets?
BeginnerScenarioGrafana, Dashboards and Kubernetes Monitoring
Answer
Situation read → PVs fill silently; databases crash when full.
What I'd do →
- Use kubelet volume metrics:
kubelet_volume_stats_used_bytesandkubelet_volume_stats_capacity_bytes. - Alert predictively:
predict_linear(kubelet_volume_stats_available_bytes{namespace="prod"}[6h], 24*3600) < 0
- Also alert on inode exhaustion (
kubelet_volume_stats_inodes_free). - Enable
allowVolumeExpansionon the StorageClass for quick fixes.
Why → Predictive alerts give time to expand before the outage.
Interview tip → Mention inodes; many forget them.
More on Grafana, Dashboards and Kubernetes Monitoring
Grafana has 900 dashboards and nobody can find anything. How do you clean it up?IntermediateHow do you manage Grafana dashboards as code?IntermediateDesign a service overview dashboard that an on-call engineer can read in 10 seconds.BeginnerYou need to show deploy events on every Grafana graph. How?BeginnerPods are being OOMKilled but the memory graph never reaches the limit. Why?IntermediateHow do you detect CPU throttling hurting latency in Kubernetes?Intermediate