kube-state-metrics cant get some resource?

Created on 11 Jan 2020  ·  7Comments  ·  Source: kubernetes/kube-state-metrics

I deploy a po named curl-xxxx, and I can get the cpu and memory that this pod used by kubectl top,
but I can't get cpu or mem resource by "kube_pod_container_resource_requests_cpu_cores" of kube-state-metrics , why?

image
image

lifecyclrotten

Most helpful comment

You want to scrape the cAdvisor endpoints (/metrics/cadvisor) on the kubelets for this data with Prometheus.

All 7 comments

kubectl top gives you the real usage not the request, which is the metric you are looking for. The resource request metrics will only show up when actually set on the container.

Does kube-state-metrics also provide cpu/memory real usage data? If not, how can I get these data to be scraped by Prometheus?

You want to scrape the cAdvisor endpoints (/metrics/cadvisor) on the kubelets for this data with Prometheus.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings