Skip to content
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

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

bskiba
Copy link
Member

@bskiba bskiba commented Jan 16, 2020

No description provided.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 16, 2020
@bskiba bskiba changed the title [WIP] Propagate scaling mode to containers. Correctly update ResourcePolicy and UpdatePolicy on update. Propagate scaling mode to containers. Correctly update ResourcePolicy and UpdatePolicy on update. Jan 17, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 17, 2020
@bskiba
Copy link
Member Author

bskiba commented Jan 17, 2020

@kgolab could you review? I know it's XL but the biggest updates are to the tests.
Also, not very urgent.

@@ -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
Copy link
Collaborator

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.

Copy link
Member Author

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.

@kgolab
Copy link
Collaborator

kgolab commented Feb 10, 2020

Sorry for such a delay.

The code looks good, I've left some minor comments and possible test improvements.
What I'm missing though is the context - why do we need this change?
And do we need so much data in AggregateContainerState? For example it looks like maybe we could get rid of UpdateMode, it does not affect how we treat containers in Recommender.

@bskiba
Copy link
Member Author

bskiba commented Mar 3, 2020

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

@bskiba
Copy link
Member Author

bskiba commented Mar 4, 2020

Update mode is needed for quality metrics as well. I've added a comment on this to AggregateContainerState

@kgolab
Copy link
Collaborator

kgolab commented Mar 12, 2020

Thanks, LGTM.

@bskiba bskiba added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 23, 2020
@bskiba bskiba added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 23, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 3b9085c into kubernetes:master Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants