All Products
Search
Document Center

Container Compute Service:Manage namespaces and quotas

Last Updated:Dec 10, 2024

You can create namespaces to classify workspaces that are used to complete different tasks. This topic describes how to create namespaces and configure resource quotas and limits in an Alibaba Cloud Container Compute Service (ACS) cluster.

Prerequisites

Background information

  • In an ACS cluster, you can use namespaces to create multiple virtual spaces. If multiple users share a cluster, you can create namespaces to classify cluster resources that are used to complete different tasks and use resource quotas to limit resource allocation in the namespaces.

  • By default, pods that are in the running state can dynamically use CPU and memory resources on a node. If resource allocation is not limited, a single pod may exhaust the resources in the cluster. This may affect the operation and performance of other pods in the cluster. To ensure that resource allocation is reasonable and stable among pods, you can configure resource quotas for each namespace, including CPU, memory, and the number of pods. This ensures effective isolation and scheduling between multiple users or workloads. For more information, see Resource quotas.

Create a namespace

  1. Log on to the ACS console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, find the cluster that you want to manage and click the name of the cluster. In the left-side navigation pane, click Namespaces and Quotas.

  3. On the Namespace page, click Create. In the Create Namespace dialog box, configure the Name and Labels parameters, and click OK.

    Labels are used to identify namespaces. For example, you can add a label to a namespace that is used in the test environment. You can add multiple labels to a namespace.

    After the namespace is created, you can find the created namespace on the Namespaces page.

Configure Resource Quotas and Limits

  1. On the Namespace page, click Resource Quotas and Limits in the Actions column of the namespace that you want to manage.

  2. In the Resource Quotas and Limits dialog box, configure resource quotas and the limit range.

    After you configure CPU and memory quotas for a namespace, you must specify CPU and memory limits when you create a pod. You can also configure the default resource limits for the namespace to control the resources used by the containers. For more information, see Resource Quotas and Configure Default Memory Requests and Limits for a Namespace.

What to do next

After you create a namespace, you can perform the following operations on the Namespace page:

  • Modify the label of a namespace: Find the namespace that you want to manage and click Edit in the Actions column. In the Edit Namespace dialog box, modify the label of the namespace and click OK.

  • Delete a namespace: Find the namespace that you want to delete, click the Dingtalk_20230111151133.png icon in the Actions column, and then click Delete. In the Confirm dialog box, click Confirm Deletion.

    All resources in the namespace are deleted together with the namespace.