0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

KubernetesクラスタにあとどれくらいPodを起動できるか調査するPromQL

0
Posted at

1core, 1GBのrequestsのPodが何台ぐらい起動できるか調査する場合

sum(floor(min by (node) (
  (
    sum by (node)(kube_node_status_allocatable{resource="cpu"})
    -
    sum by (node)(kube_pod_container_resource_requests{resource="cpu"} and on(namespace,pod) kube_pod_status_phase{phase="Running"} == 1)
  ) / 1,
  (
    sum by (node)(kube_node_status_allocatable{resource="memory"})
    -
    sum by (node)(kube_pod_container_resource_requests{resource="memory"} and on(namespace,pod) kube_pod_status_phase{phase="Running"} == 1)
  ) / (1 * 1024^3)
)))

workerノードだけに絞るラベルがあれば追加してください

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?