Help Center> > User Guide >Namespace


Namespaces are a way to divide cluster resources among multiple users. Namespaces are suited for scenarios where multiple users spread across multiple teams or projects.

Currently, CCI provides general-computing and GPU-accelerated resources. Select a resource type when creating a namespace, so that workload containers will run on this type of clusters.

  • General-computing: Container instances (pods) with CPU resources can be created, which are ideal for general computing scenarios.
  • GPU-accelerated: Container instances (pods) with GPU resources can be created, which are ideal for scenarios such as deep learning, scientific computing, and video processing.

Currently, GPU-accelerated resources are available only in region CN North-Beijing 1 and CN North-Beijing 4.

Relationship Between Namespaces and Networks

A namespace corresponds to a subnet in a VPC, as shown in Figure 1. When a namespace is created, it will be associated with an existing VPC or a newly created VPC, and a subnet will be created under the VPC. Containers and other resources created under this namespace will be in the corresponding VPC and subnet.

If you want to run resources of multiple services in the same VPC, you need to consider the network planning, such as subnet CIDR block division and IP address planning.

Figure 1 Relationship between namespaces and VPC subnets

Application Scenarios

Namespaces can implement partial environment isolation. If you have a large number of projects and personnel, you can create different namespaces based on project attributes, such as production, test, and development.

Creating a Namespace

  1. Log in to the CCI console. In the navigation pane, choose Namespaces.
  2. On the page displayed on the right, click Create for the target namespace type.
  3. Enter a name for the namespace.

    The namespace name must be globally unique in CCI.

  4. Select an enterprise project. In CCI, each namespace belongs to one enterprise project, but an enterprise project can have multiple namespaces.

    • Skip this step if the Enterprise Management service is not enabled. To enable the service, see Enabling the Enterprise Project Function or Enterprise Multi-Account Function. For the precautions for IAM users, see (Optional) Uploading Images.
    • After you specify an enterprise project, both the namespace and the network and storage resources automatically created for the namespace belong to the enterprise project. These resources should be migrated together with the namespace. For example, when migrating a namespace from project 1 to project 2, also migrate the network and storage resources associated with the namespace to project 2. Otherwise, the workloads in this namespace may not run properly.

  5. Set on-demand scaling.

    If on-demand scaling is enabled, CCI on-demand instances will be automatically created when dedicated resources are exhausted.

    Currently, on-demand scaling is available only in region CN North-Beijing4.

  6. Configure a VPC.

    You can use an existing VPC or create a VPC. If you create a VPC, it is recommended that the VPC CIDR block be set to–24,–24, or–24.

    The VPC CIDR block and subnet CIDR block cannot be set to, because this CIDR block is reserved by CCI for containerized workloads. If you use this CIDR block, IP address conflicts may occur, which may result in workload creation failures or service unavailability. If you do not need to access pods through workloads, you can allocate this CIDR block to a VPC.

    After the namespace is created, you can view VPC and subnet information by choosing Network Management > Networks.

  7. Configure a subnet CIDR block.

    Ensure that there are sufficient available IP addresses. If the number of IP addresses are insufficient, workloads will fail to be created.

    Figure 2 Configuring a subnet

  8. Configure an InfiniBand (IB) network.

    InfiniBand is a computer network communication standard used for high-performance computing. It provides high throughput and low latency. IB networks can effectively improve the access speed between containers.

    IB and VPC networks are independent of each other. The IB network is a high-speed access channel between containers, and the VPC network is used for other purposes, including external access.

    When creating an IB network, you can enable IP over IB (IPoIB) and set a CIDR block for the IB network.

    • Only GPU-accelerated namespaces support IB network settings.
    • The CIDR block of the IB network cannot conflict with the VPC CIDR block.
    Figure 3 Configuring an IB network

  9. Configure advanced settings.

    Currently, advanced settings are available only in region CN North-Beijing4.

    Each namespace provides an IP resource pool. You can customize the pool size to reduce the duration for applying for IP addresses and improve the workload creation efficiency.

    For example, 200 pods are running every day. During peak traffic hours, the IP resource pool instantly scales out to provide 500 IP addresses. After a specified interval (for example, 23 hours), the IP addresses beyond the pool size (that is, 500 - 200 = 300 IP addresses) will be reclaimed.

    • Warmed-up IP Pool for Namespace: specifies the size of the IP pool warmed up for a namespace. The IP pool can accelerate workload creation.
    • Warmed-up IP Reclaim Interval (h): specifies the interval at which idle IP addresses in the IP resource pool are reclaimed.
    • Warmed-up IP Pool for Node: specifies the size of the IP pool warmed up for a node that runs the dedicated container instance. The IP pool can accelerate workload creation.

      This parameter is displayed only to VIP users.

    • Container Network: When the container starts, network connection may be unavailable. Enable this option if the container needs to connect to the network immediately after it starts.

  10. Click Create.

    After the creation is complete, you can view the VPC and subnet information on the namespace details page.

Deleting a Namespace

Deleting a namespace will remove all data resources related to the namespace, including workloads, ConfigMaps, secrets, and SSL certificates.

  1. Log in to the CCI console. In the navigation pane, choose Namespaces. On the page displayed on the right, click the namespace to be deleted.
  2. In the upper right corner, click Delete. In the dialog box that is displayed, enter DELETE and click Yes.

    To delete a VPC or subnet, go to the VPC console.

Creating a Namespace Using kubectl

For details, see Namespace and Network.