Regex Based Routing?


#1

Currently I can use a regex in a uri match, for instance, but not in the following route. It would be very useful (and powerful) to be able to create a rule along the lines of the following, which I’ve adapted from my current traefik rules.

  - match:
    - uri:
        regex: /apiserver/{vhash: [0-9a-f]{40}}/gapi/
    rewrite:
      uri: /
    route:
    - destination:
        host: apiserver-${vhash}

Obviously I can write one of these by hand on a per-vhash basis, but that’s a lot of repetition of the same thing.


#2

Unfortunately, its not supported today. This requires dynamic determination of upstream clusters in Envoy based on some custom rules. Envoy does not have the support for this as of now.