How to monitor disk usage of kubernetes persistent volumes?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Monitoring persistent-volume usage in Kubernetes is harder than watching CPU or memory because the volume exists below the application and outside normal pod resource metrics. The practical answer is to combine storage metrics from the cluster with in-pod checks so you can see both what Kubernetes thinks the volume can hold and what the filesystem is actually consuming.
Start with PVC and kubelet volume metrics
If your storage driver supports volume stats, kubelet exposes metrics such as:
- '
kubelet_volume_stats_used_bytes' - '
kubelet_volume_stats_available_bytes' - '
kubelet_volume_stats_capacity_bytes'
Prometheus can scrape these and Grafana can visualize them per PVC. A useful PromQL query is:
That gives percentage usage. From there, alerts are straightforward, such as warning at 80 percent and paging at 90 percent.
Spot-check usage from inside a pod
Metrics pipelines are great for dashboards, but df is still the fastest way to verify what the mounted filesystem looks like from the workload's point of view.
df shows filesystem capacity and free space. du shows how much data a directory tree is actually using. Both matter because sparse files, deleted-but-open files, and filesystem overhead can make them differ.
Example dashboard strategy
A practical monitoring setup usually tracks:
- percentage used for each PVC
- raw used bytes
- recent growth rate
- alerts for low available space
Growth rate is especially useful because a volume at 60 percent usage may still be urgent if it has doubled in size over the last day.
It also helps to correlate PVC usage with the application that owns it. A full volume is rarely just a storage problem. It is often a symptom of runaway logs, retention mistakes, stuck compaction, or a batch job that suddenly started writing more data than expected.
Watch the storage class and driver behavior
Not every storage backend reports usage the same way. Some CSI drivers expose accurate stats. Others do not. Thin-provisioned backends can also make the numbers confusing because Kubernetes capacity, backend allocation, and filesystem usage are not always identical.
That is why you should validate your monitoring path on the actual storage class you use rather than assuming every PVC metric is trustworthy.
Example alert rule
A simple Prometheus alert might look like this:
This gives you time to expand the volume, clean data, or rotate logs before the application fails.
Common Pitfalls
- Assuming
kubectl topshows PVC usage. It does not. - Trusting PV capacity alone without checking actual used bytes.
- Ignoring whether the CSI driver exposes kubelet volume stats at all.
- Monitoring only total usage and not growth rate, which hides approaching exhaustion.
- Forgetting to check in-pod filesystem usage when the metrics look suspicious.
Summary
- Use kubelet volume metrics such as
kubelet_volume_stats_used_byteswhen your driver supports them. - Build Prometheus and Grafana views around percentage used, free space, and growth rate.
- Use
dfandduinside a pod for fast reality checks. - Validate the behavior of your actual storage backend instead of assuming all PVC metrics are equal.
- Alert before volumes are full so remediation happens before the application starts failing.
Related reading
- How to mount a Host folder in minikube VM
- How to mount a postgresql volume using Aws EBS in Kubernete
- How to mount /dev/kvm in a non-privileged pod?
- How to mount multiple files / secrets into common directory in kubernetes?
- How to mount a host directory in a Docker container
- How to mount a host directory in a Docker container
- How to monitor EC2 instances by memory?
- How to mount EFS on a Lambda function?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.