-
Notifications
You must be signed in to change notification settings - Fork 507
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
matches in HTTPRouteRule should allow more than 8 entries #1485
Comments
Thanks for creating this issue, I think it caused by the limitation here: I also find other items also have the limitations, why did we set them in the first place? |
Applying validation rules to the API schema is good practice and consistent with Kube API conventions. The validation rule's value was determined based on general consensus from the community (xref). Maybe the maintainers can reconsider the current |
@danehans is correct about the reasons for having a limit - not having a limit means that you can get weird behavior once you have a large object, if the object gets big enough, it will not be saved in etcd correctly, so we limit the number of items in each field. @Amila-Rukshan, a couple of things about the YAML you provided:
|
@youngnick, thanks for the clarification! |
@youngnick, can I know how these limits are calculated / decided? any reference for that? I'm thinking the possibility to adjust this value to some higher value. Thanks! |
They're an arbitrary choice, and we chose a small number because the matches list is already part of another list (the rules list), so a small increase in each has a big combinatorial impact on the size. I'm worried that once we start increasing it, it will get harder to say no to further increases, and we will end up in a bad spot. I'd really like work to try and make some guidelines for autogenerating Routes from Swagger entries so that maybe we can limit the size of each HTTPRoute. (Maybe each endpoint gets a HTTPRoute? That would already cut down on the number of matches substantially.) |
Hey @Amila-Rukshan, as Nick mentioned, we really need to enforce some kind of max limit here otherwise the potential size of these resources could get pretty overwhelming. These matches are already within a list with a max length of 16: gateway-api/apis/v1beta1/httproute_types.go Lines 115 to 117 in 223094b
That means that each HTTPRoute can specify 128 (16*8) unique matches. Within each of those match structs, we can configure as many as 16 header matches: gateway-api/apis/v1beta1/httproute_types.go Lines 523 to 524 in 223094b
That means each Route can configure 2048 (16*128) unique header matches. If we were to double the number of matches we allow per Route rule, we'd also double all these other values that are already quite high. Implementations need some kind of upper limit to test against here. In retrospect it likely would have been better to have a list of method matches instead of an individual string, but that's a complicated/messy change to make at this point. I believe these kinds of situations where >8 matches are required are likely to be uncommon edge cases that can already be solved by adding an additional Route rule. I'd recommend starting there. Unfortunately I don't think we can justify increasing any limits here. |
What would you like to be added:
When defining more than 8 HTTPRouteMatch for the
matches
field inHTTPRouteRule
, it returns the following error message. We would like to have the support for allowing more than 8 items for a match.Why this is needed:
It is possible to have more than 8 matches goes to the same backend service and they should be defined under a single HTTPRouteRule. Consider the example given below:
The text was updated successfully, but these errors were encountered: