Home > Mobile >  How to get the number of pods that my kubernetes cluster is able to have with prometheus?
How to get the number of pods that my kubernetes cluster is able to have with prometheus?

Time:10-08

In the Rancher I can see the amount of pods I have in the cluster and the total amount I can have. How can I get this maximum amount of pods that my cluster is able to have with prometheus?

Rancher example

CodePudding user response:

You can use visualise based on these two queries

Total allocable pods:

sum(kube_node_status_allocatable {resource="pods"})

you can also cross-verify the result

capacity=$(k get node $(k get node | awk '{if (NR==2) print $1}') -ojsonpath='{.status.capacity.pods}{"\n"}')
$capacity*number-of-nodes

enter image description here

  • Related