All Products
Search
Document Center

Container Compute Service:Use ASM Ingresses in Knative

Last Updated:Mar 26, 2026

For large-scale traffic management scenarios in distributed systems or microservices applications, especially where Istio is used as the service mesh framework, you can switch to Alibaba Cloud Service Mesh (ASM) as the Knative gateway. ASM is compatible with open-source Istio and provides a fully managed control plane that simplifies service governance.

This guide explains how to select ASM as the Knative gateway and verify end-to-end access through the ASM ingress.

Prerequisites

Before you begin, ensure that you have:

  • An ASM instance at version 1.21.6.84 or later. See Create an ASM instance.

  • Your ACS cluster added to the ASM instance under Kubernetes Clusters during ASM instance creation.

Step 1: Select ASM as the Knative gateway

  1. Log on to the ACS console. In the left navigation pane, click Clusters.

  2. Click the ID of the cluster you want to manage. In the left navigation pane of the cluster details page, choose Applications > Knative.

  3. On the Knative page, click the Components tab. Click Deploy Knative, select ASM in the Gateway section, and then click Deploy.

After deployment completes, ASM is active as the Knative gateway.

Step 2: Access a Knative service through the ASM ingress

This example creates a sample Knative Service named helloworld-go and verifies access through the ASM ingress.

  1. Log on to the ACS console. In the left navigation pane, click Clusters.

  2. Click the ID of the cluster you want to manage. In the left navigation pane of the cluster details page, choose Applications > Knative.

  3. On the Knative page, click the Services tab. Set Namespace to default, then click Create from Template. Paste the following YAML and click Create.

    Important

    Replace {REGION-ID} with your cluster's region ID (for example, cn-beijing).

    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 your cluster's region ID.
            env:
            - name: TARGET
              value: "Knative"
  4. On the Services page, find the helloworld-go entry and note the gateway address in the Gateway column.

  5. Run the following command to send a request to the service. Replace 39.XX.XX.XX with your gateway IP address.

    curl -H "host: helloworld-go.default.example.com" http://39.XX.XX.XX

    The -H host: flag sets the Host header manually because no DNS record points to the gateway IP in this test setup. Knative routes requests based on this header. Expected output:

    Hello Knative!

(Optional) Step 3: View the Knative monitoring dashboard

The Monitoring Dashboards tab on the Knative page provides out-of-the-box observability for your services. For details, see View the Knative dashboard.

image.png

What's next