-
Notifications
You must be signed in to change notification settings - Fork 592
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
rpk: add client quotas support to rpk #18711
Conversation
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/49661#018fc728-0975-4894-96e0-cf9cccd185bb ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/49661#018fc72a-84c9-4703-8ab7-56fa56d33845 |
57e8080
to
1b7fc43
Compare
Last Force Push:
|
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, I've skimmed through the PR and it pretty much looks good to me. I might come back for a deeper review later. But let me add a bit of context in the meantime:
For the time being, Redpanda is only going to support a subset of the quotas that Kafka supports:
- Only entity=client quotas and only for the consumer_byte_rate, producer_byte_rate and controller_mutation_rate quota types
- We won’t yet support user entity types or ip entity types. We also won’t support connection_creation_rate and request_percentage quotas.
I’m wondering if it would be confusing for customers if rpk supports everything but redpanda doesn’t. I think it’s probably fine as long as we propagate the errors returned by redpanda to the user and redpanda handles the validation of which quota combinations are supported. I think that’s already the case, but I just wanted to call this out for context.
Also, redpanda has a client-id-prefix entity type that we’ve introduced. Long story short, redpanda has supported this client quota type from a while ago and we want to be able to configure them through the Kafka API as well. I’m not sure if franz-go would already support this (ie. if it validates the entity type string at all), but if it’s easy, it would be great if rpk could start supporting the client-id-prefix entity type as well. It would make testing easier in redpanda.
@@ -1849,3 +1849,57 @@ def _run_role(self, cmd, output_format="json"): | |||
out = self._execute(cmd) | |||
|
|||
return json.loads(out) if output_format == "json" else out | |||
|
|||
def describe_cluster_quotas(self, |
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 so much for setting this up!
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.
Left some suggestions for clarity, consistency with docs.
@pgellert How does a client-id-prefix entity work along with client-id? how does a default for client-id-prefix work? Is an entity composed of Also, out of curiosity, what's the order of precedence? say I have:
|
The priority order is:
There's no specific default for
The
Based on the priority order from above, |
1b7fc43
to
6db00db
Compare
6db00db
to
9e4f61e
Compare
@pgellert Thanks for the context, I changed the PR to meet what Redpanda will support, the validation happens in Redpanda so we should be fine. (For example, this is using Kafka:)
Please review the examples again. |
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.
There's one error message which is misleading but apart from that lgtm.
if !validTypes[def] { | ||
out.Die("default type %q is invalid (allowed: client-id, client-id-prefix)", def) | ||
} |
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.
The error message says that --default client-id-prefix
is allowed even though it's not supported. I think there should probably be a separate validTypes
for any
and default
. Alternatively, we could handle the validation in redpanda and rpk will just show the error but at least this error message should be changed.
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 added your suggestion in a new commit, thanks! 0ac43ee
client-id-prefix is not a valid entity type to be used with <default>
This PR adds rpk support to DescribeClientQuotas and AlterClientQuotas under the
rpk cluster quotas
command.Examples:
Creating a Quota
Describing Quotas
All new commands now include support for
--format
json|yaml flag.Backports Required
Release Notes
Features
rpk cluster quotas
.