-
Notifications
You must be signed in to change notification settings - Fork 178
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 qps/burst flag for k8s client, and provide method to hide these flags #121
add qps/burst flag for k8s client, and provide method to hide these flags #121
Conversation
Welcome @whitebear009! |
Hi @whitebear009. 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 Once the patch is verified, the new status will be reflected by the 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. |
Thank you @whitebear009 Could you please set the flags' default value? nit: could you please also update the flags descriptions (including |
572a3d6
to
7ffa8d7
Compare
7ffa8d7
to
162dfb4
Compare
@olivierlemasle has been updated. Please check :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @whitebear009 👍
/ok-to-test
/lgtm
/assign @dgrisonnet |
I remarked that some projects using
@dgrisonnet @whitebear009 What is the way to go for them? Hide the new flags to continue using their own flags? |
Good catch! Yeah I would expect them to manually hide the new flags (maybe we can provide the method to do that) since migrating would be a breaking change for their CLI options and keeping the new flags around would just duplicate the logic. Does that sounds right to you @zroubalik? |
@olivierlemasle Good question. Maybe we can also assign values at initialization in
And then, add qps/burst flag in prometheus-adapter. If other projects(e.g. keda/crane) need it, they can pass the parameters in the flag to |
If we go that way then every consumer of the library will have to introduce their own flags which is not ideal, I'd much rather have the library provide the flags since they will enable a functionality actionable at its level.
There is no immediate breaking changes for the consumers that already have these flags around. They have two options either deprecate their CLI flags in favor of the new ones from the library or just keep using their own implementation and remove the new QPS/burst flags manually. |
There are still comments to address |
162dfb4
to
01af879
Compare
01af879
to
17125fb
Compare
Sorry for the late reply. |
17125fb
to
994219c
Compare
pkg/cmd/builder.go
Outdated
if b.MarkQPSFlagHidden { | ||
// ignore the error if flags does not exist | ||
_ = b.FlagSet.MarkHidden("client-qps") | ||
_ = b.FlagSet.MarkHidden("client-burst") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I am seeing it, I feel like we should leave that up to the consumers of the library since at the library level we should always want the QPS flags to be created. Also, in the future we would prefer if our users switched to the new flags instead of their custom ones. wdyt @olivierlemasle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with adding ClientQPS
and ClientBurst
and let users hide the flags if necessary (so no MarkQPSFlagHidden
).
I raised the question just to make sure we're aware of this possible flag duplication, but as long as we document the change, I do not see it as an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I have removed these code.
I raised the #121 (comment) just to make sure we're aware of this possible flag duplication, but as long as we document the change, I do not see it as an issue.
Need I add some documentation in getting-started.md?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! No, we will just mention it in the release note just so that projects consuming this library that already have their own flags are aware that we now also have some as well.
994219c
to
256b891
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgrisonnet, olivierlemasle, whitebear009 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 |
Thanks for notifying me about this. |
related to #105
add qps/burst flag for k8s client, in order to avoid frequent client-side throttle in some scenarios.