-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Propagate scaling mode to containers. Correctly update ResourcePolicy and UpdatePolicy on update. #2745
Conversation
@kgolab could you review? I know it's XL but the biggest updates are to the tests. |
vertical-pod-autoscaler/pkg/recommender/model/aggregate_container_state.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/recommender/model/aggregate_container_state.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/recommender/model/aggregate_container_state_test.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/recommender/model/aggregate_container_state_test.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/recommender/model/aggregate_container_state.go
Outdated
Show resolved
Hide resolved
@@ -38,6 +38,7 @@ type VerticalPodAutoscalerBuilder interface { | |||
WithLowerBound(cpu, memory string) VerticalPodAutoscalerBuilder | |||
WithTargetRef(targetRef *autoscaling.CrossVersionObjectReference) VerticalPodAutoscalerBuilder | |||
WithUpperBound(cpu, memory string) VerticalPodAutoscalerBuilder | |||
WithAnnotations(map[string]string) VerticalPodAutoscalerBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I missed something, this change looks unrelated and unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to the change in cluster_test addVpa function - I started using builder and that function sets annotations as well.
Sorry for such a delay. The code looks good, I've left some minor comments and possible test improvements. |
Addressed comments. This change is needed so that we can correctly report if container is autoscaled. This in turn is used by quality metrics to report missing recommendations correctly. This mostly comes from the fact that when we add a usage sample, we add it to container state and we don't have a direct link to the VPA object that is governing it (legacy of the fact that this used to be a 1:n relation - on aggregate could contribute to multiple VPA). Getting rid of this is possible if we refactor the code to reflect the 1:1 relationship, but it is a major change. Let me double check why UpdateMode was needed. I can also add comments in aggregateContainerState why we need those fields |
… and UpdatePolicy on update.
Update mode is needed for quality metrics as well. I've added a comment on this to AggregateContainerState |
Thanks, LGTM. |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.