Alibaba Cloud Service Mesh (ASM) is a managed service mesh platform. It decouples the control plane of a service mesh from the data plane that the control plane manages. You can separately manage the lifecycle of the control plane and data plane. The data plane is where Container Service for Kubernetes (ACK) clusters reside. In the ASM console, you can create, define, and delete namespaces in an ASM instance to manage resources in the data plane. This topic describes the difference between namespaces in an ASM instance and those of the clusters in the data plane managed by the ASM instance. This topic also describes how to enable automatic sidecar injection for a namespace in the ASM console.

Difference

The namespaces that you create in an ASM instance, whether in the ASM console or by using the kubectl client, belong only to the ASM instance. They are independent of the Kubernetes clusters in the data plane that are managed by the ASM instance. Therefore, the namespaces in the control plane of the ASM instance may be different from the namespaces of the Kubernetes clusters in the data plane. When you create or delete namespaces for the ASM instance, the namespaces of the Kubernetes clusters in the data plane are not affected.

Enable automatic sidecar injection for a namespace

You can enable automatic sidecar injection for a namespace of a Kubernetes cluster. After automatic sidecar injection is enabled, the istio-injection=enabled tag is added to the namespace. An Envoy proxy is automatically injected as a sidecar into each pod that is created in the namespace. You can also disable automatic sidecar injection for the namespace. After automatic sidecar injection is disabled, the istio-injection=disabled tag is added to the namespace.

To enable automatic sidecar injection for a namespace of a Kubernetes cluster in the ASM console, perform the following steps:

  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 of the ASM instance.
  4. On the details page of the ASM instance, click Namespaces in the left-side navigation pane.
  5. On the Namespaces 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.
    Note If automatic sidecar injection is already enabled for the namespace, Disable Automatic Sidecar Injection appears in the Automatic Sidecar Injection column. If you want to disable this feature, click Disable Automatic Sidecar Injection. In the Confirm message, click OK.
  6. In the Confirm message, click OK.
    Note After you enable or disable automatic sidecar injection for namespaces in the ASM console, automatic sidecar injection is automatically enabled or disabled for the same namespaces of the Kubernetes clusters in the data plane. However, the creation and deletion of namespaces in the control plane are not synchronized to the Kubernetes clusters in the data plane. This ensures the stability of the resources used by the Kubernetes clusters in the data plane.