Namespaces are used to divide Kubernetes cluster resources into virtual and isolated spaces. This topic describes how to create, define, and delete a namespace for an Alibaba Cloud Service Mesh (ASM) instance.

Background information

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 managed by the ASM instance. Therefore, the namespaces in the ASM instance may be different from those of the Kubernetes clusters in the data plane managed by the ASM instance. When you create or delete namespaces for the ASM instance, the namespaces of the Kubernetes clusters in the data plane managed by the ASM instance are not affected.

Create a namespace

  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. On the Namespaces page, click Create.
  5. In the Create Namespace panel, set the parameters and click OK.
    Parameter Description
    Name The name of the namespace. The name must be 1 to 63 characters in length and can contain only digits, letters, and hyphens (-). It must start and end with a letter or digit.
    Tag You can add multiple tags to a namespace. Tags are used to identify namespaces. For example, you can tag a namespace as one that is used in the test environment. To add a tag, click Add in the Tag section and enter the key and value of the tag in the row that appears.

Enable automatic sidecar injection

After you enable automatic sidecar injection for a namespace, 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 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.
  6. In the Submit message, click OK.

Define a namespace

  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 that you want to define and click YAML in the Actions column.
  6. In the Edit panel, define the namespace and click OK.

Delete a namespace

  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 that you want to delete and click Delete in the Actions column.
  6. In the Submit message, click OK.
    The namespace disappears from the Namespaces page.