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

cluster-autoscaler: allow setting kuberentes client burst and qps to avoid rate limiting #5223

Merged
merged 1 commit into from
Dec 30, 2022

Conversation

grosser
Copy link
Contributor

@grosser grosser commented Sep 29, 2022

Which component this PR applies to?

cluster-autoscaler

What type of PR is this?

/kind feature

What this PR does / why we need it:

CA Waited for 191.285161ms due to client-side throttling, not priority and fairness, request: POST:[https://172.29.4.1:443/api/v1/namespaces/kube-system/events
  • we currently see lots of rate limiting from the kubernetes client of CA, we'd like to give it more QPS to avoid that
  • users might want to reduce the number of queries that CA does against their cluster

Does this PR introduce a user-facing change?

- add `--kube-client-burst` and `--kube-client-qps` to control how many requests CA can do against kubernetes

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 29, 2022
@x13n
Copy link
Member

x13n commented Oct 3, 2022

With this change as-is, the rate limiting will actually be 2x than whatever is configured via flags (assuming there's a lot of load on both events and non-events and rate limiting is the bottleneck). Maybe it would be cleaner to use separate flags for events client?

@grosser
Copy link
Contributor Author

grosser commented Oct 3, 2022

ideally we'd use a single client, since atm it already uses 2x the configured rate, if we hardcode the "there are 2 different clients" into the cli that could be an issue later too

idk if the event or the regular client produces our throttling issues
also if a user sees throttling it would be nice if they only have to turn a single knob and not try 2 different ones

@grosser
Copy link
Contributor Author

grosser commented Oct 3, 2022

ah the throttling is from /eviction so I could only apply it to non-events if that makes this PR merge-able

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2022
@x13n
Copy link
Member

x13n commented Dec 19, 2022

Sorry, I just noticed I missed this one. Assigning so I won't miss it again:

/assign

I think setting the rate limits on a single (non-event) client makes sense. The clients were split on purpose so I think merging them back might be problematic. Perhaps nowadays with API priority and fairness it is doable, but I'd need to better understand the implications first. I'll look into this. Meanwhile, let's apply the limits to just one client.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 26, 2022
@grosser
Copy link
Contributor Author

grosser commented Dec 26, 2022

updated it as requested
... not a big fan of each having their own rate limit, but should be fine

cluster-autoscaler/main.go Outdated Show resolved Hide resolved
@x13n
Copy link
Member

x13n commented Dec 30, 2022

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grosser, x13n

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 Dec 30, 2022
@k8s-ci-robot k8s-ci-robot merged commit 3785a2f into kubernetes:master Dec 30, 2022
a7i pushed a commit to zendesk/autoscaler that referenced this pull request Feb 15, 2023
cluster-autoscaler: allow setting kuberentes client burst and qps to avoid rate limiting
a7i pushed a commit to zendesk/autoscaler that referenced this pull request Jun 9, 2023
cluster-autoscaler: allow setting kuberentes client burst and qps to avoid rate limiting
a7i pushed a commit to zendesk/autoscaler that referenced this pull request Jun 9, 2023
cluster-autoscaler: allow setting kuberentes client burst and qps to avoid rate limiting
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/cluster-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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants