Updated on 2022-06-24 GMT+08:00

Namespaces

Namespaces enable division of cluster resources among multiple users through quotas. Namespaces are suited for environments in which multiple users spread across multiple teams or projects. A namespace created on the MCP console is a multi-cluster namespace. After it is created, a namespace with the same name will be created in all clusters that join the MCP instance.

  • You can modify the resource quota of a multi-cluster namespace on the cluster console. The modified quota applies only to the current cluster. The namespace quota in other clusters does not change.
  • A multi-cluster namespace will be created again after it is deleted from the cluster console.
  • The namespaces mentioned in this section are multi-cluster namespaces.

Creating a Namespace

  1. Log in to the MCP console. In the navigation pane, choose Resource Management > Namespaces. Click Create Namespace.
  2. Set namespace parameters based on Table 1.

    Table 1 Parameters for creating a namespace

    Parameter

    Description

    Namespace Name

    Name of a namespace, which must be unique in a cluster.

    Tag

    Tag in the key-value pair format. Add tags to namespaces and define different attributes. You can learn the characteristics of each namespace through these tags.

    Annotations

    Annotation in the key-value pair format. Add annotations to the namespace.

    Description

    Description of the namespace.

  3. Click Create after the configuration is complete.

Using Namespaces

Namespaces can be used when creating Services, ingresses, domain name access, and PVCs. The following describes how a namespace is used during creation of a Service.

  1. Log in to the MCP console. In the navigation pane, choose Resource Management > Network Management.
  2. Click Create Service.
  3. Select the namespace to which the Service resides.

    Figure 1 Selecting a namespace

Deleting a Namespace

Deleting a multi-cluster namespace will delete all data resources related to it. Exercise caution when performing this operation.

  1. Log in to the MCP console. In the navigation pane, choose Resource Management > Namespaces.
  2. In the namespace list, select the target namespace and click Delete in the Operation column.

    Figure 2 Deleting a namespace

    Follow the prompts to delete the namespace. The default namespace cannot be deleted.