Skip to content

Support matching hostname to suffix wildcard. example: app.* #38607

@simonfelding

Description

@simonfelding

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:

  1. Exact domain names: www.foo.com.

  2. Suffix domain wildcards: *.foo.com or *-bar.foo.com.

  3. Prefix domain wildcards: foo.* or foo-*.

  4. Special wildcard * matching any domain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/routerenhancementFeature requests. Not bugs or questions.stalestalebot believes this issue/PR has not been touched recently

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions