Matheus Mortari
Matheus Mortari

Reputation: 23

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

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

Upvotes: 2

Views: 2080

Answers (1)

Adiii
Adiii

Reputation: 59986

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

Node Metrics

Total running pods:

sum(kube_pod_status_ready)

cross verification

 k get pods -A | wc

pod-metrics

So you can visualise this in Grafana

enter image description here

Upvotes: 1

Related Questions