envoyproxy/envoy

Feature Request: Support basic Regex virtual host domain matching

Open

#10.482 geöffnet am 23. März 2020

Auf GitHub ansehen
 (4 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
area/httpdesign proposalhelp wanted

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

Title: Feature Request : Support basic Regex virtual host domain matching

Description: I was attempting to migrate from Nginx to Envoy and encountered the following limitation with domain name matching in Virtual Hosts.

The envoy instance had the following domains (on vm01.example.com) which it required to match to a specific virtual host / cluster:

  • svcx-01.uat.example.com
  • svcx-03.uat.example.com
  • svcx-05.uat.example.com

An Envoy instance on vm02.example.com will likewise have some number of instances of the service

  • svcx-02.uat.example.com
  • svcx-04.uat.example.com

Desired Behaviour: To be able to specify a simple regular expression in the domain match field

...
"filters": [
    {
        "name": "envoy.http_connection_manager",
        "typed_config": {
            "@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager",
            "stat_prefix": "ingress_http",
            "route_config": {
                "virtual_hosts": [
                    {
                        "name": "default",
                        "domains": [
                           '~svcx-\d+.uat.example.com'
                        ],
                        "routes": [
                            {
                                "match": {
                                    "prefix": "/"
                                },
                                "route": {
                                    "cluster": "svc_cluster"
                                }
                            }
                        ]
                    }
                ]
            },
            "http_filters": [
                {
                    "name": "envoy.router"
                }
            ]
        }
    }
...

[optional Relevant Links:]

Additional: Prior to this I also tried a wildcard domain match svcx-*.uat.example.com which would also have been sufficient had it worked.

Contributor Guide