3

kube-state-metrics allows me to find the number of pods running on each node by running

sum by (node) (kube_pod_info)

I can get the number of containers in every pod by running

sum by (pod) (kube_pod_container_info)

However, the kube_pod_container_info doesn't tell me the node the containers are running on.

However, I can't find a way to get the total number of containers on each node by chaining these two queries together. Is there an existing query that already does this for me?

Jatinshravan
  • 435
  • 3
  • 16
  • Update, I was able to use kubelet's prometheus metrics to get this information kubelet_running_container_count holds this information in case anyone's interested – Jatinshravan Mar 17 '20 at 17:21
  • 5
    it would be great if you post your answer here – Vit Mar 18 '20 at 12:59

0 Answers0