gateway
gateway copied to clipboard
Support Filters in BackendRefs
I have encountered difficulties while using the Kubernetes Gateway API Filters under BackendRefs. Is the current envoy gateway already supported?
@MregXN this is not supported, highlighted in https://gateway.envoyproxy.io/latest/user/gatewayapi-support/#httproute keeping this issue open to we can highlight this using a status condition
I think I can help in making this issue achievable.
But it seems that the fields of ir.HTTPRoute
are not adequate for Filters in BackendRefs support because all filters will be translatrd into Redirect
filed and there is no way to differentiate based on backendref. Should we need to somehow extend some new fields to ir.HTTPRoute
? @arkodg @cnvergence
@MregXN can you share your use case of why you'd prefer enabling the filter on the backendRef instead of the route
@arkodg I have two backend services pointing to the same hostname and path, with different weights set to distribute access traffic proportionally to the corresponding backend services. However, I now need to apply forwarding operations when traffic is routed to one of the backend services only. Therefore, I need to use a filter that only affects one backend. Using the filter in route will affect both backends simultaneously.
@MregXN by forwarding operations, do you mean appending headers to the request or response ?
@arkodg It has nothing to do with the header. I hope the user can receive the 302 status code when their traffic is routed to the specific backend.
@MregXN hi, is there any process?
I think this is a reasonable request for filter implementation, thoughts on this @arkodg ?
@MregXN hi, is there any process?
I haven't started as I think we haven't reached a consensus yet.
BackendRef Filters are needed by Knative - https://github.com/knative-extensions/net-gateway-api/issues/566
We specifically append headers after a traffic split - this enables our scale to zero feature as well as our ability to handle 'burst capacity'
I miscalculated the effort to get this in :( The implementation seems straightforward
- Add new filter related fields in the DestinationSetting IR similar to this
- Set them in the Gateway API translator
- In the Xds Side, use a Weighted Cluster to represent this case, and populate the fields https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#config-route-v3-weightedcluster-clusterweight
The only issue I see is, there is no support for these specific filters at the weighted cluster level
- Path rewrites
- Redirect
- Mirroring https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.HTTPRouteFilter these can probably be rejected for now, else will need to be enhanced in Envoy
@cnvergence planning on working on this one ?
sure, I can continue on this one seems like a valid feature
This issue has been automatically marked as stale because it has not had activity in the last 30 days.