You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And it fetches the apiObj.Spec.JobTemplate.Spec.Template.Labels value to then do pod selection.
From your example above, you are not setting any labels in your jobTemplate which basically means it is matching all pods in the same namespace (I'd have to confirm in the code to be 100% sure but this is fairly likely).
So now the two VPAs are essentially racing and competing against each-other.
To fix this, you'll need to set some labels in your two CronJob templates to make sure you are differentiating them from each-other.
@raywainman Yep, that seems to be the issue! In the real environment where we were doing experimentation, the CronJob objects did actually have one label, but it was identical for each CronJob. Providing unique labels to each worked around the issue.
Not sure if y'all are considering this a bug, though. If not, at a minimum it would be helpful if this behavior was documented somewhere clearly so that it doesn't confuse others in the same way.
Which component are you using?:
vertical-pod-autoscaler
What version of the component are you using?:
Component version: Not sure; using the one auto-installed by GKE.
What k8s version are you using (
kubectl version
)?:kubectl version
OutputWhat environment is this in?:
Google Cloud Platform's GKE.
What did you expect to happen?:
For the resources to be updated by the correct VPA.
What happened instead?:
The wrong VPA is updating pod resources and failing.
How to reproduce it (as minimally and precisely as possible):
Create the following two VPAs:
Create the following two CronJobs:
Using
describe pod
, see the following annotations on one of the cronjob's pods:When this happens, the other cronjob's pods look correct and have their CPU and memory correctly set by the VPA:
Which one is mixed up changes based on the order in which you create the VPAs it seems.
Anything else we need to know?:
I pared down the two
CronJob
resources to simplify them.The text was updated successfully, but these errors were encountered: