autoscaler icon indicating copy to clipboard operation
autoscaler copied to clipboard

VPA - Support of Static CPU Allocation

Open dbenque opened this issue 3 years ago • 1 comments

Which component are you using?:

Vertical-Pod-Autoscaler/Recommender

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

Feature: as a user of the Static CPU allocation I would like VPA to ensure that CPU value is set as an integer. As a user I should be able to specify if the recommendation should be round/ceil/floor to become an integer and respect static CPU allocation requirement, from the doc:

Only containers that are both part of a Guaranteed pod and have integer CPU requests are assigned exclusive CPUs.

Describe the solution you'd like.:

The user should be able to define which container should have its CPU recommendation amended to be an integer. To start the API can simply be an annotation on the VPA object:

vpa-post-processor.kubernetes.io/{containerName}_integerCPU={round|ceil|floor}

vpa-post-processor.kubernetes.io/kafka_integerCPU=“round” Later when we have more user feedback this annotation can become a structured field in the vpa.Spec.ResourcePolicy

Implementation: Today the VPA recommendation is amended to stay within the minAllowed/maxAllowed We should be able to introduce more post-processing capabilities in the recommender.

Example: The recommender internally delivers a recommendation of 3.85 CPU for container kafka, the recommendation that is written in the VPA object should be 4 CPU if the user has specified vpa-post-processor.kubernetes.io/kafka_integerCPU=“round”

Describe any alternative solutions you've considered.:

Write an entire dedicated custom recommender. I started to do that and realised that I was duplicating 90% of the default recommender code. Plus it will really be an heavy task to operate 2 different recommenders for a small difference in behavior.

Additional context.:

The issue #5212 can be handled in the exact same way from an implementation point of view.

dbenque avatar Oct 07 '22 16:10 dbenque

If we implemented #5237 then you could set N=1 and you would get this behavior. Or is there a difference I missed?

jbartosik avatar Oct 10 '22 12:10 jbartosik