One of the most critical workloads is the one that has a Persistent volume (PV), PV resources belong to the cluster and exist independently of pods. Any disks and data represented by a PV continues existing even as the cluster changes and pods are deleted and recreated.
It's critical because you want always to make sure this PV always has enough space, you always need to do an analysis and take the right decision, what do you have today and what should be the volume size to meet the future requirements?
Today we will talk about the easy way to see PV utilization which will make you in the right position to take the right decision.
Using Prometheus To Monitor Your PV
One of the most common ways to monitor your K8s resources is to use Prometheus, and Grafana has a very nice dashboard to visualize that.
And here are the steps That you need to follow.
Deploy and install Prometheus Using the Prometheus Stack helm chart from here
Once you have this ready for your cluster install Grafana from Grafana helm chart from here
The last step is to use the Mixin dashboard to visualize the usage of PV, you can get it from here
Now you will have a very nice dashboard that you can have a quick look into it and take your decision.
Very cool, but what about if I don't have monitoring and I still want to make the right decision, here the 2nd solution come.
PV Utilization Using Kubectl-df-pv
A very cool kuectl plugin that you will install and start using to see the utilization of your PV.
- Install Kubectl-df-pv Plugin using krew.
curl https://krew.sh/df-pv | bash
# . ~/.bashrc # run if you use bash shell
# . ~/.zshrc # run if you use zsh shell
- After installing it use this command to see the utilization of the PV.
kubectl df-pv
- The result will be something like the following.
Very cool, now you can see the utilization of your PV and take the right decision.
Hope that can help you and see you next time
Top comments (0)