kubernetes / kube-state-metrics

Add-on agent to generate and expose cluster-level metrics.
https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/
Apache License 2.0
5.4k stars 2.01k forks source link

VPA Resource Request Metric #1665

Closed phillebaba closed 2 years ago

phillebaba commented 2 years ago

What would you like to be added:

Additional VPA metrics containing the resource request and limit made by a Deployment or Statefulset.

Why is this needed:

VPA currently exposes the metric kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target which contains the recommended memory and cpu resource request for each Deployment and Statefulset. Each time series contains the labels target_kind, target_name, and container to identify the Deployment or Statefulset which the recommendation is for. Kube State Metrics on the other hand exposes the metric kube_pod_container_resource_requests which contains the memory and cpu request made by a pod. Merging these time series with each other becomes a difficult process as they reference different resource names and kinds. This means that comparing the recommended value with the actual request is not easily achievable.

Describe the solution you'd like

An optimal solution would be to have VPA expose an additional metric containing the current resource request/limit of the Deployment or Statefulset. I know that this is not an optimal solution as it does not consider updates to Deployments etc. but in this case I think that most people are only interested in the current value set, not if the Deployment has successfully rolled it out or not.

Issue #1536 gives some suggestions of how this can be solved with PromQL. My issue with that solution is that it becomes very complex and difficult to debug in the future.

Additional context

N/A

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes/kube-state-metrics/issues/1665#issuecomment-1159487781): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue or PR with `/reopen` >- Mark this issue or PR as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.