gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Add default backendRefs to the BackendTrafficPolicy

Open sadovnikov opened this issue 1 year ago • 8 comments

Description:

Adding an HTTP Route for a particular hostname invalidates other routes, which have a match on the context path and headers but use wildcard hostname(s). This makes the creation of a "catch-all" HTTP Route impossible. Such a route can be used when two ingress systems are present in the cluster, for example, for migration to EG.

When a default backendRefs is present in the attached BackendTrafficPolicy, instead of throwing NR, EG can forward the request to it

Relevant Links:

Please, see the discussion in:

  • #5500

sadovnikov avatar Apr 09 '25 12:04 sadovnikov

@zhaohuabing, @arkodg, on your suggestion, I created this request

sadovnikov avatar Apr 09 '25 12:04 sadovnikov

thanks @sadovnikov, this is similar to the default backend feature in ingress-nginx https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/

arkodg avatar Apr 09 '25 12:04 arkodg

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

github-actions[bot] avatar May 09 '25 16:05 github-actions[bot]

still valid, still actual

sadovnikov avatar May 18 '25 19:05 sadovnikov

This issue has been automatically marked as stale because it has not had activity in the last 30 days.

github-actions[bot] avatar Jun 18 '25 04:06 github-actions[bot]

👍 to this feature. Currently I see lots of requests in the envoy access log with "response_flags":"NR","route_name":null,"x-envoy-origin-path":null because bots and other automated tools are searching for specific files that don't exist. I can't even see the path that was requested because x-envoy-origin-path is null.

By adding a catch-all route it would remove this noise from the logs.

lboynton avatar Jul 01 '25 14:07 lboynton

@lboynton you can define a catch all route (PathPrefix: / which has the lowest match precedence) and return a direct response https://gateway.envoyproxy.io/docs/tasks/traffic/direct-response/#testing-direct-response

arkodg avatar Jul 01 '25 14:07 arkodg