Updated on 2024-12-16 GMT+08:00

Managing Namespace Quotas

By default, pods running in a CCE cluster can use the CPUs and memory of a node without restrictions. This means that pods in a namespace may exhaust all resources of the cluster.

Kubernetes provides namespaces for you to group workloads in a cluster. By setting resource quotas for each namespace, you can prevent resource exhaustion and ensure cluster reliability. You can configure quotas for resources such as CPU, memory, and the number of pods in a namespace. For more information, see Resource Quotas.

Prerequisites

  1. A CCE cluster has been bound to the environment. For details, see Binding a CCE Cluster.
  2. The CCE cluster bound to the environment has a user-created namespace or the cluster-created namespace default.

Managing Namespace Resource Quotas

  1. Log in to ServiceStage.
  2. Choose Environment Management. The Environment Management page is displayed.
  3. Click the target environment. The Overview page is displayed.
  4. Choose Cloud Container Engine from Compute.
  5. Go to the Namespace page.

    • For an HA environment, click the cluster that has been bound in the environment and click the Namespace tab.
    • For a non-HA environment, click the Namespace tab.

  6. Click Resource Quota Manager in the Operation column of the target namespace.

    In the displayed Resource Quota Manager dialog box, view the resource types, total resource quotas, and accumulated quota usage in the namespace.
    Figure 1 Accessing the Resource Quota Manager page

  7. Click Edit Quota and set the total quota of each resource type.

    • If the usage of a resource type is not limited, leave it blank.
    • If the usage of a resource type is limited, enter an expected integer ranging from 1 to 9,007,199,254,740,992.
      • Accumulated quota usage includes the default resources created by CCE, such as the Kubernetes service (which can be viewed using kubectl) created under the default namespace. Therefore, you are advised to set a resource quota slightly greater than expected.
      • If the total CPU or memory quota in a namespace is limited, you must set the maximum and minimum number of CPU cores and memory (GiB) that can be used by the component when setting resources for the Kubernetes component of this namespace in Creating and Deploying a Component and Upgrading a Single Component. Otherwise, the operation will fail.
      • If the total quota of other resource types in a namespace is limited and the remaining usage of this resource type does not meet requirements, the Kubernetes component of this namespace will fail to be deployed.

  8. Click OK.

    On the Resource Quota Manager page, view the total resource quota and accumulated quota usage of the resource type whose quota has been reset.