3

I am using Ambassador API Gateway in my GKE as below:

apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: my-service
spec:
  host: app.mycompany.com
  prefix: /
  service: my-service

However, I would like to map all sub domains (*.mycompany.com) and route to my-service

apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: my-service
spec:
  host: *.app.mycompany.com
  prefix: /
  service: my-service

How to map wildcard subdomain?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Ha Doan
  • 611
  • 6
  • 20

1 Answers1

3

Based on this documentation, you have to set the host as a regex pattern to match against your subdomains.

So in your case, you'd want this:

apiVersion: getambassador.io/v2
kind: Mapping
metadata:
  name: my-service
spec:
  host: "[a-z]*\\.app\\.mycompany\\.com"
  host_regex: true
  prefix: /
  service: my-service
Dharman
  • 30,962
  • 25
  • 85
  • 135
Yazen Nasr
  • 31
  • 1