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

KEP-4951: Configurable tolerance for HPA #4954

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

jm-franc
Copy link

@jm-franc jm-franc commented Nov 6, 2024

Add KEP-4951: Configurable tolerance for HPA

Issue link: #4951

@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. labels Nov 6, 2024
@k8s-ci-robot k8s-ci-robot added the kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory label Nov 6, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @jm-franc!

It looks like this is your first PR to kubernetes/enhancements 🎉. 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/enhancements 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
Copy link
Contributor

Hi @jm-franc. 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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 6, 2024
Copy link

@raywainman raywainman left a comment

Choose a reason for hiding this comment

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

This is great! Looking forward to tackling a longstanding user request! :)

Copy link

@pr00se pr00se left a comment

Choose a reason for hiding this comment

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

Excellent work @jm-franc, thank you!

I left some suggestions in the comments, feel free to use them or tweak them further. I skipped the sections that are needed for Beta, since we're still a ways off (even the Alpha ones may be premature).

I think we can merge the end result as-is, and then work with the sig to get it to the implementable state.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Nov 13, 2024
@jm-franc
Copy link
Author

Excellent work @jm-franc, thank you!

I left some suggestions in the comments, feel free to use them or tweak them further. I skipped the sections that are needed for Beta, since we're still a ways off (even the Alpha ones may be premature).

I think we can merge the end result as-is, and then work with the sig to get it to the implementable state.

Thank you for all those suggestions Patryk, I've merged all of them. I'm now sending this KEP for review.

@jm-franc jm-franc marked this pull request as ready for review November 13, 2024 22:43
@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 Nov 13, 2024
@k8s-ci-robot k8s-ci-robot added sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/multicluster Categorizes an issue or PR as relevant to SIG Multicluster. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. labels Nov 13, 2024
@jm-franc jm-franc requested a review from raywainman November 13, 2024 22:54
@jm-franc
Copy link
Author

/assign @gjtempleton

Assigning to Guy for review/approval.

Copy link

@raywainman raywainman left a comment

Choose a reason for hiding this comment

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

/lgtm


- [ ] Events
- Event Reason:
- [ ] API .status

Choose a reason for hiding this comment

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

Small ask - I wonder if we can emit a message in the HPA status when the tolerance level is preventing a scale up or scale down?

(looking at the code, it might be tricky to add but wonder what your thoughts are and whether it would be useful)

Copy link
Author

Choose a reason for hiding this comment

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

I looked it up, but I can't find any straightforward way to do this.

  1. We don't want to emit a message when the HPAs is just in-tolerance (that's almost always the case), but we could emit it only when the computed number of replicas is different from the current one.
  2. The message would still trigger frequently for metrics valued just at the boundary between 2 replicas.
  3. It's not clear what to do when some metrics are in tolerance while others aren't (and even if some are in-tolerance, it doesn't mean that a smaller tolerance would change the final recommendation).

This doesn't look unsolvable: we could for example compute the recommendation both normally and with tolerances set to 0, then warn users if the results are different. (But this would be a large refactoring).

If I'm missing a simpler solution I would be all in favour for this. If it's as complicated as I currently see this, I'd keep this outside of this KEP as this is only tangentially related to the problem addressed here.

Choose a reason for hiding this comment

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

Completely reasonable. Thanks for checking.

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

New changes are detected. LGTM label has been removed.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jm-franc
Once this PR has been reviewed and has the lgtm label, please ask for approval from gjtempleton. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@jm-franc
Copy link
Author

/retest

@k8s-ci-robot
Copy link
Contributor

@jm-franc: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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-sigs/prow repository.

@raywainman
Copy link

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 25, 2024
@jm-franc
Copy link
Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. sig/multicluster Categorizes an issue or PR as relevant to SIG Multicluster. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

10 participants