Finding out disk space of Kubernetes node

chuckw87 picture chuckw87 · Jan 11, 2019 · Viewed 19.9k times · Source

This is a total noob Kubernetes question. I have searched for this, but can't seem to find the exact answer. But that may just come down to not having a total understanding of Kubernetes. I have some pods deployed across three nodes, and my questions are simple.

  1. How do I check the total disk space on a node?
  2. How do I see how much of that space each pod is taking up?

Answer

UDIT JOSHI picture UDIT JOSHI · Dec 2, 2019

For calculating total disk space you can use

 kubectl describe nodes

from there you can grep ephemeral-storage which is the virtual disk size This partition is also shared and consumed by Pods via emptyDir volumes, container logs, image layers and container writable layers

If you are using Prometheus you can calculate with this formula

sum(node_filesystem_size_bytes)