Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to query the total memory available to kubernetes nodes

Many Grafana dashboards use a metric named machine_memory_bytes to query the total memory available to a node. Unfortunatly this metric seems to be deprecated and is not exported any more.

But I can not find any substitute to get the desired information except using node_memory_MemTotal_bytes from the node exporter. But this is not very helpful when it comes to building Grafana dashboards.

Is there any way to query the desired information form the cadvisor?

like image 338
Kimses Avatar asked Sep 15 '20 12:09

Kimses


2 Answers

After a little more resarch I found (Kubernetes 1.19) kube_node_status_allocatable_memory_bytes suitable for the job.

Additionally the kube_node_status_capacity_cpu_cores could be used for the calculation of the CPU utlilisation.

like image 157
Kimses Avatar answered Oct 23 '22 05:10

Kimses


Check out the official list of node metrics Here is example usage:

CPU: kube_node_status_capacity{resource="cpu", unit="core"}
Memory: kube_node_status_capacity{resource="memory", unit="byte"}
like image 44
Irvin Avatar answered Oct 23 '22 04:10

Irvin