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

[VPA] Configurable upper and lower bounds for memory and cpu recommendations #6660

Merged
merged 5 commits into from
May 8, 2024

Conversation

emla9
Copy link
Contributor

@emla9 emla9 commented Mar 26, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Via flags on the recommender, make memory target percentile and upper/lower bounds for memory and CPU configurable. This allows the target percentile for memory and CPU to be set higher than 0.95 in order to accommodate workloads with significant outlier pods, such as some daemonsets.

Which issue(s) this PR fixes:

Fixes #6420

Does this PR introduce a user-facing change?

Added flags to specify targetMemoryPercentile, lowerBoundMemoryPercentile, upperBoundMemoryPercentile, lowerBoundCPUPercentile, and upperBoundCPUPercentile via command line arguments.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [Usage]: https://github.com/kubernetes/autoscaler/blob/f4c1ca1e38b19df784c360eea4390adbc790d2d9/vertical-pod-autoscaler/FAQ.md#what-are-the-parameters-to-vpa-recommender

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 26, 2024
Copy link

linux-foundation-easycla bot commented Mar 26, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 26, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @emla9!

It looks like this is your first PR to kubernetes/autoscaler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/autoscaler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 26, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @emla9. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 26, 2024
@emla9 emla9 force-pushed the configure-memory-target branch from 0f71fa8 to cdb8269 Compare March 26, 2024 17:36
@Shubham82
Copy link
Contributor

Hi @emla9
you have to sign the CLA before the PR can be reviewed.
See the following document to sign the CLA: Signing Contributor License Agreements(CLA)

@Shubham82
Copy link
Contributor

To check EasyCLA

/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Apr 11, 2024
Copy link
Contributor

@dbenque dbenque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@voelzmo
Copy link
Contributor

voelzmo commented Apr 30, 2024

/lgtm

Thanks!

@emla9: While I appreciate making these things configurable, I'm wondering if this change really fixed the issue you were describing in #6420? I don't think setting a targetMemoryPercentile of 1 should have fixed this, given that memory samples are stored as the maximum per day and this problem seems to arise already on the first day – meaning no samples should be discarded based on the targetPercentile.
If you were seeing this only after the workload ran for about a week, I would understand how increasing the targetMemoryPercentile fixes this.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 30, 2024
@emla9
Copy link
Contributor Author

emla9 commented May 2, 2024

Thanks for the review!

@voelzmo, I retested this with vpa-stress on one of our clusters: setting --target-memory-percentile=1 and --recommendation-upper-bound-memory-percentile=1 does fix the issue.

My understanding was that each container instance's max per day gets added to the aggregate histogram and then the 90th percentile of that is used to calculate the target recommendation, which is different from adding only the max per day across all container instances in the workload.

@voelzmo
Copy link
Contributor

voelzmo commented May 6, 2024

Ah, thanks, I think I understand how setting the target-memory-percentile to 1 will help solving this issue – the high memory measurements caused by the OOMKill events will always be discarded when selecting samples according to a percentile lower than 1.

Thanks!

@voelzmo
Copy link
Contributor

voelzmo commented May 6, 2024

@kwiesmueller This is good to go from my side, could you please /approve?

@kwiesmueller
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: emla9, kwiesmueller

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2024
@k8s-ci-robot k8s-ci-robot merged commit 44b128f into kubernetes:master May 8, 2024
6 checks passed
@prashantkalkar
Copy link

When will this be available? Unless this is release, overriding the target-cpu-percentile seems to be of now use (can't set it to higher than 0.95 if required).

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. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[VPA] Does not respond to OOM for workloads with non-uniform resource utilization
7 participants