How to query the total memory available to kubernetes nodes

9/15/2020

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?

-- Kimses
grafana
kubernetes
prometheus

2 Answers

9/15/2020

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.

-- Kimses
Source: StackOverflow

6/18/2021

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"}
-- Irvin
Source: StackOverflow