How Do VPA Recommendations, Requests, Limits, and Allowed Ranges Work Together?
Asked by
phase diagram
I understand CPU requests, limits, VPA recommendations, minAllowed, maxAllowed, and controlledValues individually, but I'm having trouble understanding how they interact when the Vertical Pod Autoscaler updates a Pod. For example, suppose a Pod currently has a CPU request of 100m and a limit of 500m. If the VPA recommends 600m and maxAllowed is set to 800m, what request and limit will ultimately be applied?
Answers
The exact result also depends on controlledValues. With RequestsAndLimits, VPA updates both values and maintains the request-to-limit ratio from the Pod specification. With RequestsOnly, VPA changes only the request, leaving the existing 500m limit unchanged. In that configuration, a 600m request would exceed the 500m limit, so choosing the control mode carefully is important.
Reply to this answer
VPA primarily adjusts resource requests. The recommendation is first constrained by minAllowed and maxAllowed, so a 600m recommendation remains 600m when the allowed range is up to 800m. If the VPA is configured to control both requests and limits, it preserves the original request-to-limit ratio. Since the original values were 100m request and 500m limitโa 1:5 ratioโthe resulting values would be a 600m request and a 3000m limit. The limit does not remain at 500m in that mode.
Reply to this answer
Add your answer
Answers are reviewed before publication.
!rotate the globe~: So the request would not be rejected just because it becomes larger than the original limit. The limit is recalculated from the original ratio, which keeps it above the updated request.