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

✨Make workqueue rate limiter configurable during controller creation #731

Merged

Conversation

rajathagasthya
Copy link
Contributor

Exposes rate limiter as a controller option in case users want to use
a different rate limiter than the default one provided by
controller-runtime.

Fixes #631

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 17, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @rajathagasthya. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 Dec 17, 2019
@rajathagasthya
Copy link
Contributor Author

/assign @DirectXMan12

@DirectXMan12
Copy link
Contributor

This seems reasonable. I'm iffy on the naming, but it currently has the nice property that the signatures match the client-go one, making the cast straightforward.

/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 Jan 8, 2020
Copy link

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

I am wondering why we would create our own RateLimiter interface.

if the client-go one changes we would have to decide:

  1. To update our interface and still make it a copy. If this is the path then why would we have a copy?
  2. Decide to create a shim, which will confirm to our interface and pass through correctly to the DefaultControllerRateLimiter.
  3. Write our own rateLimiter as the default.

If we always choose 1, I think we should just use their interface and deal with the breaking API changes when they are made.

If we choose 2 or 3 don't we have a problem with users using other rate limiters from the work queue package in the option that would no longer compile? I am wondering if this is the more unexpected behavior then having to make a breaking change if this interface changes?

I think my vote is to remove the controller-runtime rate-limiter and use the client-go rate limiter even though we may be exposing an interface that we can not control, and therefore could break compatibility if we do not do a major version bump.

@DirectXMan12 thoughts?

pkg/controller/controller.go Outdated Show resolved Hide resolved
@rajathagasthya
Copy link
Contributor Author

Is just copying and maintaining those client-go rate limiters a bad idea? That way we are insulated from changes to those interfaces and their implementations. But maybe we would like those changes as well?

DirectXMan12 pushed a commit that referenced this pull request Jan 31, 2020
 📖 use real example, fix yaml in markdown
@DirectXMan12
Copy link
Contributor

The idea is that we didn't want a change in client-go to force us to do a major revision.

@rajathagasthya
Copy link
Contributor Author

@DirectXMan12 @shawn-hurley Any thoughts on how to proceed with this change? I'd love to get this merged soon and use it since we sorely need this option.

@vincepri vincepri added this to the v0.5.x milestone Feb 21, 2020
Exposes rate limiter as a controller option in case users want to use
a different rate limiter than the default one provided by
controller-runtime.
@DirectXMan12
Copy link
Contributor

I think we're good to go forward with this the way it is now

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 2, 2020
@vincepri
Copy link
Member

vincepri commented Mar 2, 2020

/assign @DirectXMan12 @gerred

@jimmidyson
Copy link
Member

Was just looking for this... would love to see this merged 🙏 @DirectXMan12. Thank you for adding this @rajathagasthya!

@gerred
Copy link
Contributor

gerred commented Mar 4, 2020

@vincepri @jimmidyson Looking now, I've been in meetings but will turn attention to this in the next hour.

@gerred
Copy link
Contributor

gerred commented Mar 4, 2020

this is great, thank you @rajathagasthya

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gerred, rajathagasthya

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 Mar 4, 2020
@k8s-ci-robot k8s-ci-robot merged commit 2361b05 into kubernetes-sigs:master Mar 4, 2020
@rajathagasthya rajathagasthya deleted the queue-rate-limit branch March 5, 2020 00:13
@mars1024
Copy link
Contributor

@rajathagasthya This is a wonderful PR, could you help to backport this to older versions like 0.4.0 and 0.5.0?

@rajathagasthya
Copy link
Contributor Author

@mars1024 I'm happy to backport. Thoughts @DirectXMan12 @vincepri?

@mars1024
Copy link
Contributor

friendly ping @DirectXMan12 @vincepri , a configurable MakeQueue is strongly needed anywhere ~

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. ok-to-test Indicates a non-member PR verified by an org member that 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.

Allow controller authors to configure queue rate limits
9 participants