All Products
Search
Document Center

Alibaba Cloud Service Mesh:Set a custom domain name in Knative on ASM

Last Updated:Oct 23, 2026

The default domain name of a Knative Service is example.com. The default DNS name is in the following format: {Service name}.{Namespace in which the Service resides}.{Default domain name}. If you want to associate a Knative Service with a domain name of an enterprise or maintain the consistency and professionalism of domain names, you can use a custom domain name as the default domain name in Knative on ASM. This topic describes how to set a custom domain name in Knative Serving, associate the custom domain name with the helloworld-go service, and access the helloworld-go service by using the new custom domain name.

Prerequisites

A Knative Service is created by using Knative on ASM.

Use a custom domain name as the default domain name in the ASM console

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Ecosystem > Knative on ASM.

  3. On the Knative on ASM page, in the Knative components section, click edit next to Service domain name suffix, enter a domain name, such as aliyun.com, and then click confirm edit.

Access the Knative Service by using the new custom domain name

After an application is deployed, Knative automatically updates all Knative Services and routes based on the ConfigMap.

  1. Add the information about the new custom domain name that you want to visit to the hosts file.

    Configure the mapping as shown in the following example. Replace xx.xx.xxx.xx with your gateway address. To obtain the gateway address, see Obtain the gateway address.

    xx.xx.xxx.xx helloworld-go.default.aliyun.com
  2. Access the helloworld-go service by using the new custom domain name.

    • Access the helloworld-go service by running the following command

      curl http://helloworld-go.default.aliyun.com

      Expected output:

      Hello Knative!
    • Access the helloworld-go service by visiting the following website

      Enter http://helloworld-go.default.aliyun.com in your browser's address bar.

Related topics

  • A Service Mesh (ASM) gateway supports HTTPS and allows you to dynamically load certificates. When you use Knative on ASM, you can use an ASM gateway to access the Knative Service over HTTPS. For more information, see Access a Knative Service over HTTPS through an ASM gateway.

  • Knative on ASM allows you to perform a canary release based on traffic splitting for a Knative Service. When you create a Knative Service, Knative automatically creates the first Revision for the Service. Whenever the configuration of the Knative Service changes, Knative creates a new Revision and modifies the percentage of traffic that is distributed to different Revisions to implement a canary release. For more information, see Canary release a Knative Service with traffic splitting.

  • Knative Serving adds the Queue Proxy container to each pod. The Queue Proxy container sends concurrency metrics of the application containers to KPA. After KPA receives the metrics, KPA automatically adjusts the number of pods provisioned for a Deployment based on the number of concurrent requests and related autoscaling algorithms. For more information, see Enable request-based pod autoscaling.