Skip to content
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

Consolidate routes from HTTPRoute matches when using expression rotues #6807

Open
2 of 4 tasks
randmonkey opened this issue Dec 11, 2024 · 0 comments
Open
2 of 4 tasks
Labels
area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API

Comments

@randmonkey
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Does this enhancement require public documentation?

  • I have added an Acceptance Criteria item for adding and/or adjusting public documentation (if applicable)

Problem Statement

To satisfy the priority specifications of HTTPRoute matches, the translator split HTTPRoute by each hostname and match, and generate one Kong route for each combination of split match. This increases the number of generated Kong routes. Also, it may bring lots of changes to translated Kong configuration when some HTTPRoute changed that cause priorities of multiple matches change.
We should consider how to consolidate these routes and make the translation result still satisfy the priority specification.

Proposed Solution

  • Assign the same priority to split matches from the same HTTPRoute rule if the priority ties on priority values calculated from attributes(hostname, method, path, header, query, ..,) and relative orders of parent HTTPRoute and rule.
  • For the split matches from same rule and having the same priority, we translate them into one Kong route when using expression based routes.

Additional information

We can consider to consolidate the Kong routes more by violating the spec of "relative" priorities to break ties when the priorities came from the match attributes are the same. When the priorities calculated from match attributes (hostname, path, method, headers, queries), we assign the same priorities and do not run the tie breaker to sort parent HTTPRoutes and rules.
This could reduce the changes of priorities when HTTPRoutes updated. Currently there are no such conformance test cases to verify the priority from relative orders, but I am not sure if the upstream will add such cases.

Acceptance Criteria

  • Matches from the same rule with the same priorities calculated from match attributes have the same priority assigned
  • Matches from the same rule and having the same priories are translated to one Kong route when expression routes enabled
@randmonkey randmonkey added the area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gateway-api Relating to upstream Kubernetes SIG Networking Gateway API
Projects
None yet
Development

No branches or pull requests

1 participant