Create a namespace

更新时间:
复制 MD 格式

A namespace is an abstraction that groups a set of resources and objects. You can create namespaces across clusters or within a single cluster. Data in different namespaces is isolated, which allows them to share services without interference. For example, you can place the services for your development and testing environments in separate namespaces.

Namespace categories

LHC namespaces are divided into the following two categories:

  • Federated Namespace: A custom namespace that spans multiple clusters.

  • Namespace: A namespace that exists within a single cluster. You can create namespaces as needed. For example, you can create separate namespaces for different environments, such as development and testing, or for different services, such as logon and game services. LHC creates the following system namespaces within a cluster by default.

    • default: The default namespace that is used when no other namespace is specified.

    • kube-public: Used to deploy public plug-ins, container templates, and other shared resources.

    • kube-system: Used to deploy system components.

    • sigma-operator-machine-conditions: A system namespace required for node operations and maintenance (O&M).

    • operator-extensions: A system namespace required for node operations and maintenance (O&M).

    • antstack: The namespace for system applications. This namespace exists only on AntStack-based Apsara Stack environments.

Prerequisites

A cluster is created or a cluster is imported.

Create a federated namespace

  1. Log on to the LHC console. In the navigation pane on the left, choose Cluster Management > Namespaces.

  2. Click Create. On the Create Namespace page, configure the following parameters and click Create.

    • Name: Enter a name for the namespace. The name is prefixed with TenantName-UnitWorkspaceID- by default.

    • Add labels: Add custom labels to the namespace.

Create a single-cluster namespace

  1. Log on to the LHC console. In the navigation pane on the left, choose Cluster Management > Cluster Details.

  2. Click the name of the target cluster to go to the Cluster Details page, and then click the Namespaces tab.

  3. Click Create Namespace. On the Create Namespace page, configure the following parameters:

    • Name: The name of a namespace.

    • Labels: Add custom labels to the namespace.

  4. After you configure the parameters, click Submit.