-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Title: Support matching hostname to suffix wildcard
Description:
It would be really nice to be able to match a hostname to a suffix wildcard, such as app.* or grafana.* and so on. This makes platform engineering easier, as the same configuration can then be deployed to multiple solutions.
My specific use case is the Kubernetes Gateway API, where I want to bundle some deployment with a HTTPRoute that has the service name and a wildcard suffix like grafana.*
. Currently, the Kubernetes Gateway API has a regex validation on the .spec.hostnames field that only allows a FQDN or a wildcard-prefixed domain name.
I made a pull request for the Gateway API to allow for wildcard-suffixed domain names, and while Nginx does support it, it was pointed out to me that Envoy does not currently support this.
Relevant Links:
Envoyproxy actually indirectly supports this, but through a somewhat obscure method.
The Envoy documentation for route_components.proto implies that this should work, but it was pointed out to me in the Gateway API pull request that it won't work as I thought because of this line of code.
For reference, the Envoy documentation currently states:
domains
(repeated string, REQUIRED) A list of domains (host/authority header) that will be matched to this virtual host. Wildcard hosts are supported in the suffix or prefix form.Domain search order:
Exact domain names: www.foo.com.
Suffix domain wildcards: *.foo.com or *-bar.foo.com.
Prefix domain wildcards: foo.* or foo-*.
Special wildcard * matching any domain.