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

Add --burst-limit option for client-side throttling limit configuration #10842

Merged
merged 6 commits into from May 17, 2022

Conversation

isutton
Copy link
Contributor

@isutton isutton commented Apr 7, 2022

What this PR does / why we need it:

Client-side throttling seems to be an issue in larger environments such as OpenShift clusters, where it is common to have several hundreds CRDs out-of-the-box.

From this view point, it is fair that clients should be able to fine tune this accordingly should the environment they work on evolves, which is currently not possible, and quite frustrating.

This change introduces the --burst-limit option to helm (and its counterpart HELM_BURST_LIMIT environment variable) to address that issue, allowing clients to properly tune their client usage as their environment evolves.

Special notes for your reviewer:

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

Closes #10560

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 7, 2022
@isutton isutton force-pushed the configurable-default-burst-limit branch from dbc354e to 7ddea4e Compare April 7, 2022 15:39
@yxxhero
Copy link
Member

yxxhero commented Apr 8, 2022

@isutton Please create a issue this PR. Thanks very much.

@yxxhero
Copy link
Member

yxxhero commented Apr 8, 2022

--default-burst-limit --> --burst-limit or --kube-burst-limit
when --burst-limit not set. it will be set defaultBurstLimit.

@isutton
Copy link
Contributor Author

isutton commented Apr 8, 2022

--default-burst-limit --> --burst-limit or --kube-burst-limit
when --burst-limit not set. it will be set defaultBurstLimit.

Fixed in b2ba745.

@isutton isutton force-pushed the configurable-default-burst-limit branch from 75398fc to b2ba745 Compare April 8, 2022 13:06
@isutton
Copy link
Contributor Author

isutton commented Apr 8, 2022

@isutton Please create a issue this PR. Thanks very much.

This PR closes #10560.

@isutton isutton force-pushed the configurable-default-burst-limit branch from b2ba745 to 651e5d4 Compare April 8, 2022 14:09
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 8, 2022
pkg/cli/environment.go Outdated Show resolved Hide resolved
@yxxhero
Copy link
Member

yxxhero commented Apr 8, 2022

unittest?

@isutton isutton changed the title Add --default-burst-limit option for client-side throttling limit configuration Add --burst-limit option for client-side throttling limit configuration Apr 8, 2022
@isutton
Copy link
Contributor Author

isutton commented Apr 8, 2022

unittest?

There are no unit tests as the value is only kept to be forwarded to the client using the appropriate API; additionally there are evidences through the change in oc that this value works reasonably well with OpenShift out-of-the-box.

@isutton isutton force-pushed the configurable-default-burst-limit branch from 651e5d4 to c8236fb Compare April 8, 2022 14:46
cmd/helm/root.go Outdated
@@ -67,6 +67,7 @@ Environment variables:
| $HELM_KUBEASUSER | set the Username to impersonate for the operation. |
| $HELM_KUBECONTEXT | set the name of the kubeconfig context. |
| $HELM_KUBETOKEN | set the Bearer KubeToken used for authentication. |
| $HELM_DEFAULT_BURST_LIMIT | set the default burst limit in the case the server contains many CRDs |
Copy link
Member

Choose a reason for hiding this comment

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

HELM_DEFAULT_BURST_LIMIT --> HELM_BURST_LIMIT is right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been fixed.

@yxxhero yxxhero added the feature label Apr 9, 2022
@yxxhero
Copy link
Member

yxxhero commented Apr 9, 2022

add your test case into TestEnvSettings @isutton

@yxxhero
Copy link
Member

yxxhero commented Apr 9, 2022

pkg/cli/environment_test.go

@isutton isutton force-pushed the configurable-default-burst-limit branch from c8236fb to 606c700 Compare April 11, 2022 10:26
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 11, 2022
@isutton isutton force-pushed the configurable-default-burst-limit branch from 606c700 to 0a8e7e4 Compare April 11, 2022 10:26
@isutton
Copy link
Contributor Author

isutton commented Apr 11, 2022

add your test case into TestEnvSettings @isutton

TestEnvSettings has been amended to consider HELM_BURST_LIMIT environment variable and --burst-limit option.

@yxxhero
Copy link
Member

yxxhero commented Apr 12, 2022

@isutton I think all is ok. need a core maintainer to review this.

1 similar comment
@yxxhero
Copy link
Member

yxxhero commented Apr 12, 2022

@isutton I think all is ok. need a core maintainer to review this.

Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

This looks good. A few comments

cmd/helm/root.go Outdated
@@ -67,6 +67,7 @@ Environment variables:
| $HELM_KUBEASUSER | set the Username to impersonate for the operation. |
| $HELM_KUBECONTEXT | set the name of the kubeconfig context. |
| $HELM_KUBETOKEN | set the Bearer KubeToken used for authentication. |
| $HELM_BURST_LIMIT | set the default burst limit in the case the server contains many CRDs |
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's both call out the default value as well how it can be disabled (-1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 14daf80


"helm.sh/helm/v3/pkg/helmpath"
)

// defaultMaxHistory sets the maximum number of releases to 0: unlimited
const defaultMaxHistory = 10

// defaultBurstLimit sets the default client-side throttling limit
const defaultBurstLimit = 250
Copy link
Contributor

Choose a reason for hiding this comment

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

Recommend setting the value to 100 as the default. The default in the Kubernetes rest client is 10 and 250 seems to be a dramatic change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 3760853

@isutton isutton force-pushed the configurable-default-burst-limit branch from 13597f9 to 3760853 Compare May 17, 2022 08:31
Igor Sutton added 6 commits May 17, 2022 10:53
Client-side throttling seems to be an issue in larger environments such as OpenShift clusters, where
it is common to have several hundreds CRDs out-of-the-box.

From this view point, it is fair that clients should be able to fine tune this accordingly should the
environment they work on evolves, which is currently not possible, and quite frustrating.

This change introduces the --default-burst-limit option to helm (and its counterpart
HELM_DEFAULT_BURST_LIMIT environment variable) to address that issue, allowing clients to properly
tune their client usage as their environment evolves.

Signed-off-by: Igor Sutton <isuttonl@redhat.com>
Signed-off-by: Igor Sutton <isuttonl@redhat.com>
Signed-off-by: Igor Sutton <isuttonl@redhat.com>
Signed-off-by: Igor Sutton <isuttonl@redhat.com>
Signed-off-by: Igor Sutton <isuttonl@redhat.com>
…ions

Signed-off-by: Igor Sutton <isuttonl@redhat.com>
@isutton isutton force-pushed the configurable-default-burst-limit branch from 3760853 to 5392281 Compare May 17, 2022 08:54
@yxxhero yxxhero requested a review from sabre1041 May 17, 2022 10:21
Copy link
Contributor

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

@sabre1041 sabre1041 merged commit 823d929 into helm:main May 17, 2022
@mattfarina mattfarina added this to the 3.10.0 milestone May 17, 2022
yong-jie-gong pushed a commit to yong-jie-gong/helm that referenced this pull request Jun 20, 2022
…on (helm#10842)

* feat: add configuration for client-side throttling limit

Client-side throttling seems to be an issue in larger environments such as OpenShift clusters, where
it is common to have several hundreds CRDs out-of-the-box.

From this view point, it is fair that clients should be able to fine tune this accordingly should the
environment they work on evolves, which is currently not possible, and quite frustrating.

This change introduces the --default-burst-limit option to helm (and its counterpart
HELM_DEFAULT_BURST_LIMIT environment variable) to address that issue, allowing clients to properly
tune their client usage as their environment evolves.

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: change DefaultBurstLimit to BurstLimit

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: add HELM_BURST_LIMIT to golden file

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: add burst limit tests

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* docs: add burst limit default value to documentation

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* refactor: change burst limit default value to 100 per review instructions

Signed-off-by: Igor Sutton <isuttonl@redhat.com>
Signed-off-by: Gong Yongjie <yong-jie.gong@microfocus.com>
TarasLykhenko pushed a commit to TarasLykhenko/helm that referenced this pull request Aug 4, 2022
…on (helm#10842)

* feat: add configuration for client-side throttling limit

Client-side throttling seems to be an issue in larger environments such as OpenShift clusters, where
it is common to have several hundreds CRDs out-of-the-box.

From this view point, it is fair that clients should be able to fine tune this accordingly should the
environment they work on evolves, which is currently not possible, and quite frustrating.

This change introduces the --default-burst-limit option to helm (and its counterpart
HELM_DEFAULT_BURST_LIMIT environment variable) to address that issue, allowing clients to properly
tune their client usage as their environment evolves.

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: change DefaultBurstLimit to BurstLimit

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: add HELM_BURST_LIMIT to golden file

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: add burst limit tests

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* docs: add burst limit default value to documentation

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* refactor: change burst limit default value to 100 per review instructions

Signed-off-by: Igor Sutton <isuttonl@redhat.com>
zak905 pushed a commit to zak905/helm that referenced this pull request Jan 19, 2023
…on (helm#10842)

* feat: add configuration for client-side throttling limit

Client-side throttling seems to be an issue in larger environments such as OpenShift clusters, where
it is common to have several hundreds CRDs out-of-the-box.

From this view point, it is fair that clients should be able to fine tune this accordingly should the
environment they work on evolves, which is currently not possible, and quite frustrating.

This change introduces the --default-burst-limit option to helm (and its counterpart
HELM_DEFAULT_BURST_LIMIT environment variable) to address that issue, allowing clients to properly
tune their client usage as their environment evolves.

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: change DefaultBurstLimit to BurstLimit

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: add HELM_BURST_LIMIT to golden file

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* chore: add burst limit tests

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* docs: add burst limit default value to documentation

Signed-off-by: Igor Sutton <isuttonl@redhat.com>

* refactor: change burst limit default value to 100 per review instructions

Signed-off-by: Igor Sutton <isuttonl@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 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.

Throttling messages while running helm upgrade commands
4 participants