For large-scale microservice traffic management, especially if you use or plan to use Istio as your service mesh, we recommend using a Service Mesh (ASM) gateway to route traffic for Knative services. ASM is compatible with community Istio and features a managed control plane to simplify service governance. This includes traffic routing and splitting, securing inter-service communication, and providing mesh observability.
Prerequisites
You have created a Service Mesh (ASM) instance (version 1.21.6.84 or later). For more information, see Create an ASM instance. You have added your Container Service (ACS) cluster to the instance in the Kubernetes Cluster section.
Step 1: Select ASM as the gateway
-
Log on to the ACS console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, choose .
-
On the Knative page, click the Add-ons tab. Click Deploy Knative. In the Gateway section, select ASM, and then click Quick Deployment.
After a successful deployment, you can use Service Mesh (ASM) in Knative.
Step 2: Access services through the ASM gateway
This section uses a sample Knative Service to demonstrate how to deploy a service with ASM.
-
Log on to the ACS console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, choose .
-
On the Knative page, click the Services tab. Set Namespace to default and click Create from Template. Paste the following YAML into the template editor and click Create to create a service named helloworld-go.
ImportantReplace
{REGION-ID}in the following code with the region ID of your cluster, for example,cn-beijing, to ensure the image is accessible.apiVersion: serving.knative.dev/v1 kind: Service metadata: name: helloworld-go spec: template: spec: containers: - image: registry.{REGION-ID}.aliyuncs.com/knative-sample/helloworld-go:73fbdd56 # Replace {REGION-ID} with the region ID of your cluster. env: - name: TARGET value: "Knative" -
On the Services tab, find the helloworld-go service and copy its address from the Gateway column.
-
Run the following command to access the helloworld-go service.
curl -H "Host: helloworld-go.default.example.com" http://39.XX.XX.XX # Replace with your actual gateway IP address and domain name.Expected output:
Hello Knative!This output indicates a successful connection.
(Optional) Step 3: View service monitoring data
Knative provides built-in observability features. On the Knative page, click the Monitoring Dashboards tab to view monitoring data for your Knative services. For details about the dashboards, see View the Knative service monitoring dashboard.

Related documents
-
You can configure a custom domain name for your Knative services. For more information, see Use a custom domain name.
-
You can configure a certificate to enable HTTPS access for your Knative services. For more information, see Configure an HTTPS certificate.
-
You can deploy gRPC services in Knative to improve network efficiency. For more information, see Deploy a gRPC service in Knative.
-
You can configure probes to monitor the health and availability of your Knative services. For more information, see Configure probes in Knative.