All Products
Search
Document Center

Container Service for Kubernetes:Manage namespaces and quotas

Last Updated:Jun 25, 2024

Namespaces can divide resources within the same cluster into different workspaces, allowing you to perform resource isolation, quota management, permission management, business accounting, and other operations. This helps reduce the cost of managing and maintaining ACK clusters in a multi-tenant scenario.

Prerequisites

An ACK cluster is created. For more information, see Create an ACK managed cluster.

Introduction to Namespaces

In an ACK cluster, you can use namespaces to create multiple virtual spaces. If multiple users share a cluster, creating multiple namespaces can effectively divide workspaces, allocate cluster resources for various purposes, and partition and manage resources for each namespace through resource quotas.

For example, pods that are in the running state can use unlimited CPU and memory resources on a node by default, which means that pods in one namespace may exhaust the resources of that cluster. In this case, you can configure multiple resource quotas for the namespace, including CPU, memory, and the number of pods.

Create a Namespace

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

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

  3. Click Create, configure the namespace name and label in the dialog box that appears, and then click OK.

    After creating the namespace, you can edit its configuration (such as modifying labels), set resource quotas and limits, delete the namespace, and perform other operations.

Configure Resource Quotas and Limits

After creating a namespace, you can configure the corresponding resource quotas and default resource limits to control the resource usage and overhead of pods in the namespace.

  1. On the Namespace page, click Resource Quotas and Limits in the Actions column of the target namespace.

  2. In the Resource Quotas and Limits dialog box, configure the resource quotas and default resource limits.

    For more information about how to complete the configuration, see the Kubernetes official documentation Resource Quotas and Configure Default Memory Requests and Limits for a Namespace.

    Note

    After setting CPU and memory quotas for a namespace, you must specify CPU and memory limits when creating pods, or configure default resource limits for the namespace.

References