Conversation
Gateway API only allows RequestHeaderModifier and ResponseHeaderModifier at the backendRef level. Placing URLRewrite filters on individual backendRefs causes Envoy Gateway to reject the HTTPRoute with UnsupportedRefValue, resulting in HTTP 500 for all requests through a ModelService. This commit groups endpoints by rewritePath and emits one HTTPRoute rule per unique path. Each rule carries the URLRewrite filter at the rule level, where Gateway API permits it. Endpoints sharing a rewritePath land under the same rule and load-balance within it. Fixes #85. Signed-off-by: Nic Cope <nicc@rk0n.org>
There was a problem hiding this comment.
Pull request overview
This PR switches the control-plane inference gateway from Envoy Gateway to Traefik so Modelplane can use per-backendRef URLRewrite behavior for endpoints with different path conventions.
Changes:
- Updates InferenceGateway API/schema and generated Python models from Envoy Gateway to Traefik.
- Replaces Envoy Backend composition with Kubernetes Service + EndpointSlice composition for ModelEndpoint routing.
- Updates ModelService and InferenceGateway composition/tests for Traefik-backed Gateway API routing.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
apis/inferencegateways/definition.yaml |
Updates InferenceGateway schema to Traefik. |
schemas/python/models/ai/modelplane/inferencegateway/v1alpha1.py |
Regenerates Python model fields for Traefik config. |
schemas/.lock.json |
Updates schema lock hash. |
functions/compose-inference-gateway/function/fn.py |
Installs/configures Traefik and composes Traefik Gateway resources. |
functions/compose-inference-gateway/tests/test_fn.py |
Updates expected gateway composition to Traefik. |
functions/compose-model-endpoint/function/fn.py |
Composes Services and EndpointSlices from ModelEndpoint URLs. |
functions/compose-model-endpoint/tests/test_fn.py |
Updates endpoint composition test expectations. |
functions/compose-model-service/function/fn.py |
Builds HTTPRoute backendRefs against Kubernetes Services. |
functions/compose-model-service/tests/test_fn.py |
Updates HTTPRoute tests for Service backendRefs and per-backend rewrites. |
functions/compose-model-deployment/function/fn.py |
Clarifies rewrite path comment for KServe path conventions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
negz
commented
May 27, 2026
negz
left a comment
Collaborator
Author
There was a problem hiding this comment.
Self-review of LLM-assisted code.
Envoy Gateway doesn't support per-backendRef URLRewrite filters. This is a Gateway API Extended feature that allows each backend in a weighted traffic split to have its own path rewrite. Modelplane needs this to route across endpoints with different path conventions -- for example a self-hosted model serving at /v1/ alongside Groq at /openai/v1/. The limitation is in Envoy itself: WeightedCluster.ClusterWeight doesn't support prefix_rewrite. See envoyproxy/gateway#7099. Traefik is the only confirmed Gateway API implementation that supports this feature. This commit replaces Envoy Gateway with Traefik Proxy on the control plane. Workload clusters remain on Envoy Gateway. The HTTPRoute now uses a single rule with per-backendRef URLRewrite filters instead of grouping endpoints by rewritePath into separate rules. The Envoy Gateway Backend CRD is replaced with standard Kubernetes Service plus EndpointSlice resources. Both IP-based endpoints (workload cluster gateway addresses) and FQDN-based endpoints (external SaaS providers) use the same pattern. ExternalName Services aren't an option because Traefik's Gateway API provider explicitly rejects them. Signed-off-by: Nic Cope <nicc@rk0n.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #85
Fixes #88
Envoy Gateway doesn't support per-backendRef URLRewrite filters. This is a Gateway API Extended feature that allows each backend in a weighted traffic split to have its own path rewrite. Modelplane needs this to route across endpoints with different path conventions -- for example a self-hosted model serving at /v1/ alongside Groq at /openai/v1/.
The limitation is in Envoy itself: WeightedCluster.ClusterWeight doesn't support prefix_rewrite. See envoyproxy/gateway#7099. Traefik is the only confirmed Gateway API implementation that supports this feature.
This PR replaces Envoy Gateway with Traefik Proxy on the control plane. Workload clusters remain on Envoy Gateway. The HTTPRoute now uses a single rule with per-backendRef URLRewrite filters instead of grouping endpoints by rewritePath into separate rules.
The Envoy Gateway Backend CRD is replaced with standard Kubernetes Service plus EndpointSlice resources. Both IP-based endpoints (workload cluster gateway addresses) and FQDN-based endpoints (external SaaS providers) use the same pattern. ExternalName Services aren't an option because Traefik's Gateway API provider explicitly rejects them.