-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Which component are you using?
/area vertical-pod-autoscaler
Is your feature request designed to solve a problem? If so describe the problem this feature should solve:
Using the latest VPA code, the updater and the admission controller do not work for Pods when the ownerReferences chain has the following shape:
ParentObject (implements /scale)
-> IntermediateObject (does NOT implement the /scale subresource)
-> Pods
When the VPA object sets targetRef to the topmost object (the ParentObject), the updater and the admission controller cannot resolve the parent object starting from a Pod. In the source code, this object is referred to as controllingVpa (updater, admission controller).
The current logic requires every object in the ownership chain to implement the /scale subresource. Because of this requirement, the following ownership chains works:
ParentObject (implements /scale)
-> Pods
or:
ParentObject (implements /scale)
-> IntermediateObject (implements /scale)
-> Pods
However, the logic fails when the intermediate object (or the parent) does not implement /scale.
The following two recently opened issues report this problem when the intermediate object does not implement the /scale subresource:
Describe the solution you'd like:
At the moment, I can see two possible solutions:
-
Require
/scaleonly on the topmost object: This option changes the code so that only the topmost (parent) object must implement the/scalesubresource, i.e. intermediate objects do not need to implement/scale.The related code path is here. When the code traverses the ownerReferences chain starting from a Pod, it returns a nil owner and a NotFound error if an intermediate object does not implement /scale. -
Re-evaluate the need to require
/scaleresources in VPA: This option may investigates why VPA needs to fetch/scaleresources at all. VPA does not read the replica count and does not modify that field. I can imagine that there are some ownerReferences chains in which/scaleis not used and VPA is still desired (though I'm not sure how common this is). In this case, even if we implement the first option, VPA would not work in their setup.