All Products
Search
Document Center

Alibaba Cloud Service Mesh:Integrate an ALB with an ASM ingress gateway

Last Updated:Jun 20, 2026

Alibaba Cloud Service Mesh integrates with an Application Load Balancer (ALB) for Container Service for Kubernetes (ACK) clusters that use the Terway network plugin on the data plane. This integration simplifies service governance, ensures secure authenticated communication between services, provides mesh observability, and reduces the workload for development and operations. This topic describes how to integrate an ASM Service Mesh with an ALB.

Prerequisites

  • An ACK cluster is added to your ASM instance, and the ASM instance and ACK cluster meet the following requirements:

    • ASM instance: Enterprise Edition.

    • ACK cluster:

      • The network plugin type is Terway.

      • The Cloud Controller Manager (CCM) component version is v1.9.3.313-g748f81e-aliyun or later. For more information, see Cloud Controller Manager.

      • The ALB Ingress Controller component is installed. For more information, see Manage components.

  • Automatic sidecar proxy injection is enabled for the default namespace. For more information, see Enable automatic injection.

  • An ingress gateway is created with the CLB instance type parameter set to Private Access and Service Port set to 80. For more information, see Create an ingress gateway.

Step 1: Deploy a sample application

Run the following command on the data plane cluster to deploy the Bookinfo sample application. For more information, see Deploy an application in a cluster associated with an ASM instance.

kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/bookinfo/platform/kube/bookinfo.yaml

Step 2: Create Istio resources

You will create a Gateway resource and a VirtualService for testing purposes.

  1. Create a Gateway resource.

    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 ASM Gateways > Gateway.

    3. On the Gateway page, click Create.

      In the Basic Information section, select default for Namespace and enter bookinfo-gateway for Name. In the Apply to Gateway section, add a label with the key istio and the value ingressgateway. In the Service section, enter http for Name, enter 80 for Port, and select HTTP for Protocol. Then, click Create.

    4. Click Preview to review the YAML file for the Gateway resource. After you confirm the configuration is correct, click OK. Then, click Create at the bottom of the Create page.

      View YAML details

      apiVersion: networking.istio.io/v1beta1
      kind: Gateway
      metadata:
        name: bookinfo-gateway
        namespace: default
      spec:
        selector:
          istio: ingressgateway
        servers:
          - port:
              number: 80
              name: http
              protocol: HTTP
            hosts:
              - '*'
  2. Create a VirtualService and set up routing.

    1. On the details page of the ASM instance, choose Traffic Management Center > VirtualService in the left-side navigation pane.

    2. On the VirtualService page, click Create to configure a virtual service for the bookinfo-gateway.

      Set Namespace to default and Name to bookinfo. Turn off the Apply to all Sidecars switch, and add bookinfo-gateway to the gateway rules. In the HTTP Route section, add the following matching rules: URI exact match /productpage, URI prefix match /static, URI exact match /login, URI exact match /logout, and URI prefix match /api/v1/products. Set the route destination service name to productpage and the port to 9080. Then, click Create.

    3. At the bottom of the Create page, click Preview to view the YAML file. After you confirm that the configuration is correct, click Submit. Then, at the bottom of the Create page, click Create.

      View YAML details

      apiVersion: networking.istio.io/v1beta1
      kind: VirtualService
      metadata:
        name: bookinfo
        namespace: default
      spec:
        gateways:
          - bookinfo-gateway
        hosts:
          - '*'
        http:
          - match:
              - uri:
                  exact: /productpage
              - uri:
                  prefix: /static
              - uri:
                  exact: /login
              - uri:
                  exact: /logout
              - uri:
                  prefix: /api/v1/products
            route:
              - destination:
                  host: productpage
                  port:
                    number: 9080
                              

Step 3: Create an AlbConfig object

Scenario 1: Integrate an existing ALB instance

  1. Log on to the ALB console and obtain your ALB instance ID.

  2. Create a file named alb-demo.yaml with the following content.

    Replace config.id with your ALB instance ID.

    apiVersion: alibabacloud.com/v1
    kind: AlbConfig
    metadata:
      name: default
    spec:
      config:
        id: alb-xxxxx 
        forceOverride: false
  3. Run the following command to create the AlbConfig object.

    kubectl apply -f alb-demo.yaml

Scenario 2: Integrate a new ALB instance

  1. Create a file named alb-demo.yaml with the following content. For more information, see Expose services by using an ALB Ingress.

    This example automatically creates an ALB instance named alb-demo.

    apiVersion: alibabacloud.com/v1
    kind: AlbConfig
    metadata:
      name: default
    spec:
      config:
        name: alb-demo
        addressType: Internet
        zoneMappings:
        - vSwitchId: vsw-uf6ccg2a9g71hx8go****
        - vSwitchId: vsw-uf6nun9tql5t8nh15****

    Parameter

    Description

    spec.config.name

    The name of the ALB instance.

    addressType

    (Required) The address type of the load balancer. Valid values:

    • Internet (default): The load balancer has a public IP address. The DNS record resolves to the public IP address, and the load balancer can be accessed over the internet.

    • Intranet: The load balancer has only a private IP address. The DNS record resolves to the private IP address, and the load balancer can be accessed only from within the VPC where it is deployed.

    zoneMappings

    (Required) The vSwitch IDs for the ALB Ingress. You must specify at least two vSwitch IDs that are in different availability zones. The specified vSwitches must be in availability zones supported by ALB. For information about supported regions and availability zones, see Regions and zones supported by ALB. For information about how to create a vSwitch, see Create and manage vSwitches.

  2. Run the following command to create the AlbConfig object.

     kubectl apply -f alb-demo.yaml

Step 4: Create an IngressClass resource

  1. Create a file named alb.yaml and copy the following content into it.

    apiVersion: networking.k8s.io/v1
    kind: IngressClass
    metadata:
      name: alb
    spec:
      controller: ingress.k8s.alibabacloud/alb
      parameters:
        apiGroup: alibabacloud.com
        kind: AlbConfig
        name: default
        scope: Cluster
  2. Run the following command to create the IngressClass resource.

    kubectl apply -f alb.yaml

    Expected output:

    ingressclass.networking.k8s.io/alb created

Step 5: Create an Ingress resource

The service for the ASM ingress gateway runs in the istio-system namespace. You must create the Ingress resource in the same istio-system namespace of your data plane cluster (the ACK cluster). The port must be consistent with port 80, which you configured for the ASM ingress gateway.

  1. Create a file named asm-gateway-ingress.yaml and copy the following content into the file.

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: asm-gateway-ingress
      namespace: istio-system
    spec:
      ingressClassName: alb
      rules:
      - http:
          paths:
          - backend:
              service:
                name: istio-ingressgateway
                port:
                  number: 80
            path: /*
            pathType: ImplementationSpecific
                    
  2. Run the following command to create the Ingress resource.

    kubectl apply -f asm-gateway-ingress.yaml

Step 6: Test access

  1. Run the following command to get the Ingress address.

    kubectl get ing -n istio-system

    Expected output:

    NAME                  CLASS   HOSTS   ADDRESS                                               PORTS   AGE
    asm-gateway-ingress   alb     *       alb-xxxx.xxxx.alb.aliyuncs.com                        80      18h

    The Ingress address is alb-xxxx.xxxx.alb.aliyuncs.com.

  2. Access the ASM ingress gateway.

    • Method 1: Access the ASM gateway by using the address of the Ingress instance that you obtained in the previous step: http://alb-xxxx.xxxx.alb.aliyuncs.com/productpage.

    • Method 2: Log on to the ALB console and access the ASM gateway using the public IP address of the ALB instance or its bound domain name. On the instance details page in the ALB console, view the basic information of the alb-demo ALB instance. In the availability zone section at the bottom, you can find the Elastic IP Address (EIP) for each availability zone.

Related documents

Use the Terway network plugin