Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support rounding of Resource Recommendations in the VPA Recommender #7677

Closed
Pratted opened this issue Jan 9, 2025 · 9 comments
Closed

Support rounding of Resource Recommendations in the VPA Recommender #7677

Pratted opened this issue Jan 9, 2025 · 9 comments
Labels
area/vertical-pod-autoscaler kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Pratted
Copy link

Pratted commented Jan 9, 2025

Which component are you using?:
VPA Recommender

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

Currently the resource recommendations provided by the VPA recommender have no rounding. This makes it particularly difficult to read memory recommendations as the value will often be precisely defined in bytes (e.g. 23490547483) and won't evenly divide into Ki/Mi/Gi. It would be desirable if the recommendations could be configured so that they are rounded to the nearest Ki/Mi/Gi, and/or to the nearest N'th integer (e.g. round millicores to the nearest factor 10/50/100).

Describe the solution you'd like.:
Ideally the user could pass in a CLI argument into the recommender for rounding millicores and bytes respectively. For example --rounding-factor-millicores=50 would round to the nearest factor of 50m. So if the recommender calculates 79m as the target CPU, the rounding would automatically round (or ceil) to 100m. The same goes for memory - there could be another flag that rounds to the nearest Ki,Mi,Gi (e.g. --rounding-unit-memory=Mi for the lack of a better term).

Describe any alternative solutions you've considered.:
An alternative solution could be just automatically rounding/ceiling memory to the nearest Mi since users will rarely if ever need to request less than 1Mi of memory for their container. Losing 1Mi of precision should be negligable.

Additional context.:

image
The bottommost pod is automatically scaled by the VPA, but its resource requests don't align with the other nice round numbers because the VPA has no rounding. This also makes it difficult and time consuming to tell if the memory is ~140Mi, ~1.4Gi, or ~14Gi at face value.

@Pratted Pratted added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 9, 2025
@adrianmoisey
Copy link
Member

/area vertical-pod-autoscaler

@adrianmoisey
Copy link
Member

There is a new feature (that hasn't been released yet) that @omerap12 built to humanise the recommendations, take a look here: https://github.com/kubernetes/autoscaler/blob/5cd491a5a18b4b93f742351e3ebb195e358d2ea3/vertical-pod-autoscaler/docs/features.md#memory-value-humanization

Does that solve your problem?

(side note: we plan on doing another VPA release soon, which should include this feature.)

@Pratted
Copy link
Author

Pratted commented Jan 9, 2025

Ah, thanks for the link - that seems like the same thing minus the rounding support for CPU.

@adrianmoisey
Copy link
Member

🤦 of course, this is memory only.

@omerap12
Copy link
Member

omerap12 commented Jan 9, 2025

I guess we need to have similar feature for CPU. Issue opened: #7678

@adrianmoisey
Copy link
Member

@Pratted are you happy if we close this issue and track the work in #7678 ?

@Pratted
Copy link
Author

Pratted commented Jan 9, 2025

@adrianmoisey Yup, sounds good to me. Please close and mark with whichever tags applicable.

@omerap12
Copy link
Member

omerap12 commented Jan 9, 2025

/close

@k8s-ci-robot
Copy link
Contributor

@omerap12: Closing this issue.

In response to this:

/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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertical-pod-autoscaler kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants