Skip to content

Support RegularExpression as a HTTPRoute HeaderMatchType #5370

Open
@simonfelding

Description

@simonfelding

Description:
The HTTPRoute resource allows for defining two HeaderMatchType: Exact (Core) and RegularExpression (Implementation specific).

Envoy Gateway only supports the Exact match type, and it would be really nice to have regex support.

I want to use it to make routing decisions based on a partial header match - like so:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: grafana
spec:
  rules:
  - matches:
    - header:
        type: RegularExpression
        name: "Host"
        value: "^grafana"
    backendRefs:
    - name: grafana
      port: 80

This would be really useful, as spec.hostnames only supports doing a full FQDN match, or a wildcard subdomain. I want to match like "grafana.*" so I can better repurpose my HTTPRoutes for a general setup, without having to use complex variable substitution and whatnot.

I believe it should be somewhat trivial to implement as it is already a feature in Envoy

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions