get metrics aggregate by all deployment avaliable?

5/6/2021

Given a kubernetes cluster with: 1. prometheus 2. node-exporter 3. kube-state-metrics

I like to get some metrics for example container_memory_usage_bytes but aggregate by all deployments instead of namespace.

for example:

I have the following query sum by (namespace) (irate(container_cpu_usage_seconds_total[2m])) how can I get that for deployments and not namespace ?

The same I'd like to achieve instead of deployments with aggregation by statefuleset .

found this question but its for a specific deployment I need to get that for all deployments, Is there a way to achieve this?

-- Moshe D
kubernetes
metrics
prometheus

0 Answers