-
Notifications
You must be signed in to change notification settings - Fork 496
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
spec.rules[0].matches: Too many #2501
Comments
There is a size limit because there is a limit to the size of any one Kubernetes object, so we need to ensure that we don't hit that. Also, we do prefer that people create multiple, smaller HTTPRoute objects, and this is designed to have people do that. It's possible we might increase this limit at some point, but unlikely, because of the reasons above. If you post your HTTPRoute (or at least a redacted version), maybe someone can assist with splitting it up. |
I understand but I still believes the limit should be more than 8, thanks |
Hi @youngnick , It will be great if you can add the ability to configure the limit with environment variable or some other ways, so each user will be responsible for his configuration. |
Unfortunately increasing the max size of an individual list has significant knock-on effects as @youngnick mentioned. To highlight consider the following: 16 max HTTPRoute rules: gateway-api/apis/v1/httproute_types.go Line 119 in ee42a6d
8 max HTTPRouteRule matches: gateway-api/apis/v1/httproute_types.go Line 192 in ee42a6d
16 max HTTPRouteMatch header matches: gateway-api/apis/v1/httproute_types.go Line 605 in ee42a6d
16 max HTTPRouteMatch query param matches: gateway-api/apis/v1/httproute_types.go Line 617 in ee42a6d
That means that each rule can specify 8 matches, and each match can specify 16 header matches and 16 query param matches 🤯. If you consider that we allow 16 rules within a route, you can see that this can quickly result in untenable resource size. I think the only reasonable way to make significant increases here would be if Kubernetes API machinery allowed us to make the max size conditional - ie this can only be larger than x if there is only 1 total route rule. In the meantime, it should be entirely possible to split different matches into different route rules to get around this limitation. |
As I said to @Rez0k, I'd be happy to take a look at sample HTTPRoutes and suggest ways that I think it would be better to break them up - I have an outstanding TODO to write some documentation around best practices here, but I need more real-world data to make it useful. |
Thanks, I decoupled my 20 paths into groups of 8 in each match array, all in the same httproue single object, and it seems to work fine. |
I understand the technical implication. is it possible to document this behaviour? |
Hmm, the behavior is already documented in the validations, but I'm not sure how we should document this aside from that. I think that may need a fresh issue, would you mind opening one? |
@youngnick sure let me raise a new one. We could add these rules into the API spec for the HttpRoutes |
hi, @Rez0k Can you give an example yaml file? |
Increasing this property value can expands the limit, it also in file https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.1.0/standard-install.yaml, 9768 line |
@804e, the limit has been chosen to limit the combinatorial complexity and resulting size of the object. We've had a few discussions before, but have not found a compelling enough reason to increase the limit yet. If you would like to open a fresh issue outlining your reasons, please feel free to do so. |
Hi,
I am getting the following error:
I need all 20 routes, why is there a limit and how can I bypass this limitation if possible?
if I can't bypass this limitation what is the workaround? creating multiple http routes objects?
I read this #1485 issue but I coudn't understand wheater or not you are going to increase / delete this limitation in the future.
The text was updated successfully, but these errors were encountered: