kubernetes / autoscaler

Autoscaling components for Kubernetes
Apache License 2.0
7.98k stars 3.94k forks source link

Maximum CPU recommendation for a pod #6487

Open tenstad opened 7 months ago

tenstad commented 7 months ago

Basically the same as Minimum CPU recommendation for a pod, just an additional upper bound: https://github.com/kubernetes/autoscaler/blob/ed6ebbe8baacab2fe1befd468ffaa049c66b0d73/vertical-pod-autoscaler/pkg/recommender/logic/recommender.go#L29

Which component are you using?:

vertical-pod-autoscaler

Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:

VPA currently suggests cpu too close to / above CPU on node, leading to pods not starting.

Describe the solution you'd like.:

Add pod-recommendation-max-cpu-millicores and pod-recommendation-max-memory-mb flags, and cap recommendation to provided values. Maybe no upper limit by default.

Describe any alternative solutions you've considered.:

Using policies to enforce the upper bound: https://github.com/kubernetes/autoscaler/blob/ed6ebbe8baacab2fe1befd468ffaa049c66b0d73/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L205

Using LimitRange to enforce the upper bound: https://kubernetes.io/docs/concepts/policy/limit-range/

Additional context.:

Would be nice to define upper-bound a central place (controller), and not in policies LimitRanges.

k8s-triage-robot commented 4 months ago

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

This bot triages un-triaged issues according to the following rules:

You can:

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

/lifecycle stale

k8s-triage-robot commented 3 months ago

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

This bot triages un-triaged issues according to the following rules:

You can:

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

/lifecycle rotten

tenstad commented 3 months ago

/remove-lifecycle rotten

adrianmoisey commented 2 months ago

/area vertical-pod-autoscaler