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

Support user-defined route order #4943

Open
guydc opened this issue Dec 17, 2024 · 0 comments · May be fixed by #4955
Open

Support user-defined route order #4943

guydc opened this issue Dec 17, 2024 · 0 comments · May be fixed by #4955
Labels
area/api API-related issues kind/decision A record of a decision made by the community.

Comments

@guydc
Copy link
Contributor

guydc commented Dec 17, 2024

Description:
Currently, envoy gateway orders routes according to requirements in GW-API: https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.HTTPRouteRule

Proxy or Load Balancer routing configuration generated from HTTPRoutes MUST prioritize matches based on the following criteria, continuing on ties. Across all rules specified on applicable Routes, precedence must be given to the match having:

  • “Exact” path match.
  • “Prefix” path match with largest number of characters.
  • Method match.
  • Largest number of header matches.
  • Largest number of query param matches.
  • Note: The precedence of RegularExpression path matches are implementation-specific.

Some projects support user-defined route ordering:

Each virtual service consists of a set of routing rules that are evaluated in order

The order of routes matters. A route is selected for a request based on the first matching route matcher in the virtual service’s list

The sorting of routes improves consistency and guards against end user mistakes (e.g. more specific prefix matchers being ignored because shorter matchers are specified first). However, advanced users and users migrating from other projects may need more control over the route order (e.g. determining the order of regex matchers not based on length).

The default behavior of Envoy Gateway must remain backwards compatible and compliant with GW-API specs. However, EG can introduce a new flag in EnvoyGateway configmap or ClientTrafficPolicy CRD to support user-defined route ordering. When multiple HTTPRoute resources are attached to a GW, date-of-creation sorting can be used to determine the order of the route groups.

Allowing users to define this behavior on a per HTTPRoute or even HTTPRouteRule level with BackendTrafficPolicy/HTTPRouteFilter would create significant implementation complexity and possible ambiguity.

[optional Relevant Links:]

Any extra documentation required to understand the issue.

@guydc guydc added area/api API-related issues kind/decision A record of a decision made by the community. labels Dec 17, 2024
@guydc guydc linked a pull request Dec 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api API-related issues kind/decision A record of a decision made by the community.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant