envoyproxy/envoy

Route specific filterchains / dynamic filter order

Open

#11.690 aberto em 22 de jun. de 2020

Ver no GitHub
 (3 comments) (1 reaction) (0 assignees)C++ (5.373 forks)batch import
area/httpenhancementhelp wanted

Métricas do repositório

Stars
 (27.997 stars)
Métricas de merge de PR
 (Mesclagem média 8d) (378 fundiu PRs em 30d)

Description

Usecase: This behaviour is desirable for Istio extensions API and related K8s Service APIs Per Target Actions

Many times at ingress there is a need to attach specific behaviours to specific paths. For example

kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
spec:
 hosts:
   - hostname: foo.com
     rules:
     - match:
         path: /bar
       actions:
       - custom:
           targetRef:
             group: "proxy-vendor1.com/v1alpha1"
             resource: "actions"
             name: foo-com-authn
       - custom:
           targetRef:
             group: "mesh-vendor2.com/v1alpha1"
             resource: "plugins"
             name: foo-com-rate-limit
       - modify:
           headers:
             add:
               example: foo
       forwardTo:
       - targetRef:
           name: foo

There is no first class support for this.

What is possible today ?

There is a requested feature for conditional filter dispatch, with this feature or ad-doc filter specific route metadata it is possible to enable and disable filters for specific paths that can approximate the above behaviour.

Problems

a. Every filter must participate in this behaviour. If a filter does not honor filter-enable type flag then it will be dispatched even if the user did not intend it. b. Filter order cannot be changed. Filter order is statically programmed in the filter chain, and the above process can only enable or disable filters within.

Options

Add ability to specify route specific filter chains.

  1. The current http filterchain, becomes the default filterchain.
  2. User can specify a filterchain inline with the route, or refer to it by name.
  3. If route specific filterchain is specified, the route computation happens before dispatching anything, (unlike lazy route computation which happens today)

Guia do colaborador