Alibaba Cloud Container Service for Kubernetes (ACK) provides various serverless containers based on virtual nodes and elastic container instances. For example, serverless Kubernetes (ASK) clusters enable seamless integration of Kubernetes and Elastic Container Instance (ECI). This topic describes how to use Alibaba Cloud Service Mesh (ASM) to manage applications deployed in pods that run on elastic container instances in ASK clusters.

Prerequisites

  • An ASK cluster is created. For more information, see ASK quick start.
    Note To use the service discovery feature, you must set the service discovery mode to PrivateZone or CoreDNS when you create an ASK cluster.
  • The ASK cluster is added to your ASM instance. For more information, see Add a cluster to an ASM instance.

Enable automatic sidecar injection

After you enable automatic sidecar injection for a namespace in the ASM console, an Envoy proxy is automatically injected as a sidecar into each pod that is created in the namespace. These Envoy proxies comprise the data plane of the ASM instance.

  1. Log on to the ASM console.
  2. In the left-side navigation pane, choose Service Mesh > Mesh Management.
  3. On the Mesh Management page, find the ASM instance that you want to configure. Click the name of the ASM instance or click Manage in the Actions column.
  4. On the details page of the ASM instance, choose ASM Instance > Global Namespace in the left-side navigation pane.
  5. On the Global Namespace page, find the namespace for which you want to enable automatic sidecar injection and click Enable Automatic Sidecar Injection in the Automatic Sidecar Injection column.
  6. In the message that appears, click OK.

Create an application that runs in an Elastic Container Instance-based pod

All pods in ASK clusters are deployed on elastic container instances. You do not need to use labels to specify that the application is deployed in an Elastic Container Instance-based pod.
Note After an application is deployed in a pod that runs on an elastic container instance, ASM can manage the application on the data plane by using sidecars.
  1. Run the following command to deploy the NGINX application:
    kubectl run nginx -n default --image nginx
  2. Run the following command to view the information about the pods that run on virtual nodes:
    kubectl get pod -n default -o wide|grep virtual-kubelet

FAQ

Why am I unable to enable service discovery for an ASK cluster?

If the logs of containers where sidecars are injected indicate that the istiod.istio-system service is resolved to an invalid IP address, the Alibaba Cloud DNS PrivateZone service is not activated. You can activate the Alibaba Cloud DNS PrivateZone service or install CoreDNS on the Add-ons page in the ACK console. For more information about how to manage system components on the Add-ons page, see Manage system components.