k8s prometheus: which metric in prometheus tells namespace's cpu and memory limit

10/30/2019

We use prometheus(v: 1.7.0) as monitor for a k8s(v: 1.10.11) cluster. In k8s, we have multiple namespaces. Are there in prometheus metric to tell the CPU and memory limit in each namespace?

Or in the other words, how to find metrics in prometheus to read resourcequota's limits.cpu and limits.memory

-- user84592
kubernetes
prometheus

1 Answer

10/30/2019

There are no built-in CPU and memory limits in namespaces, but you can define them with resource quotas.

So, you don't need Prometheus to get this information, but you can just query the ResourceQuota objects through the API server.

If you need this information in Promtheus, you can use the kube-state-metrics Prometheus exporter, which exposes metrics about ResourceQuota objects.

-- weibeld
Source: StackOverflow