[英]I need to get number of Pods in a Kubernetes Cluster with kubernetes python client
[英]How to get the number of pods that my kubernetes cluster is able to have with prometheus?
您可以使用基于这两个查询的可视化
可分配的 Pod 总数:
sum(kube_node_status_allocatable {resource="pods"})
您还可以交叉验证结果
capacity=$(k get node $(k get node | awk '{if (NR==2) print $1}') -ojsonpath='{.status.capacity.pods}{"\n"}')
$capacity*number-of-nodes
总运行 pod:
sum(kube_pod_status_ready)
交叉验证
k get pods -A | wc
所以你可以在 Grafana 中将其可视化
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.