gloo
gloo copied to clipboard
Provide validation for the Ratelimit CRs
Version
No response
Is your feature request related to a problem? Please describe.
Today we enforce schemas validation for RateLimit CRs The need is to support Server validation for Rate limiting CR
This work should also enable the metric for ratelimitconfigs: https://docs.solo.io/gloo-edge/master/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/settings.proto.sk/#observabilityoptions
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional Context
No response
Duplicate of https://github.com/solo-io/gloo/issues/6533
Part of https://github.com/solo-io/gloo/issues/2797
@jenshu has context and can help to pair on this
Here is a list of issues that we can add to make the necessary changes to the validation webhook for Rate Limit and future resources.
- [x] https://github.com/solo-io/gloo/issues/7273
- [ ] https://github.com/solo-io/gloo/issues/4783
- [ ] https://github.com/solo-io/gloo/issues/7271
- [ ] https://github.com/solo-io/gloo/issues/7272
- [ ] https://github.com/solo-io/solo-projects/issues/3558
- [ ] https://github.com/solo-io/gloo/issues/2797
- [ ] https://github.com/solo-io/gloo/issues/7434
Validation for Rate Limit Configs will be available in v1.13.0-beta13 or v1.13.0 release later in a few weeks.
Seeing an issue with the RLC validation in 1.13.10:
$ cat ratelimitconfig-validation.json
{
"request": {
"uid": "abc",
"dryRun": true,
"kind": {
"group": "ratelimit.solo.io",
"version": "v1alpha1",
"kind": "RateLimitConfig"
},
"namespace": "gloo-system",
"object": {
"apiVersion": "ratelimit.solo.io/v1alpha1",
"kind": "RateLimitConfig",
"metadata": {
"labels": {
"central-id": "200004162",
"proxy": "abc"
},
"name": "abc",
"namespace": "gloo-system"
},
"spec": {
"rawsinvalid": {
"descriptors": [
{
"key": "generic_key",
"value": "abc",
"rateLimit": {
"requestsPerUnit": 50,
"unit": "SECOND"
}
}
],
"rateLimit": [
{
"action": [
{
"genericKey": {
"descriptorValues": "abc"
}
}
]
}
]
}
}
}
}
}
Note:
"spec": {
"rawsinvalid": {
curl -k -XPOST -d @ratelimitconfig-validation.json -H 'Content-Type: application/json' https://localhost:8443/validation
{"response":{"uid":"glooupgrade-zone1-v4-connectapi-rl-1681243877342","allowed":true}}
An additional part of this: https://github.com/solo-io/gloo/issues/4783
We haven't yet added support for syntax validation on RateLimitConfigs, which is what should have been rejected above.
slack context with some more details
Looking for schema in the RateLimitConfig CRD