Knative: Operator’s Handbook

Assigning a domain name

Default domain naming assigns ugly names that aren't good for user-facing applications (e.g. web sites).

To make a nice domain name like go to your Knative service, you need to register this hostname to the Knative load balancer. However, Knative does not offer a feature to map extra domains to your Service (see related discussion).


Cloud Run on GKE Domain Mappings

Google’s managed distribution of Knative on GKE (Cloud Run on GKE/Anthos) has a DomainMappings custom API to register additional hostnames to the Knative ingress gateway. Read documentation →

You can create a domain mapping through Google’s UI or CLI, then see the resulting Kubernetes custom API object:

$ kubectl get domainmapping -o=yaml

Note that these domains will not show up on kubectl describe ksvc or kubectl get ksvc commands, as this API directly updates the ingress gateway (by creating an additional Istio VirtualService object that isn't managed by Knative serving controller).

  1. When the proxy/load balancer sets the Host header to the value of your KService, the Knative ingress gateway knows how to the traffic to your service. ↩︎