Resource Quotas
Refer to the official Kubernetes documentation: Resource Quotas
Resource Requests and Resource Limits
This is used to restrict the resources available for a designated namespace. The total resource usage by all Pods in a namespace, except those in a non-terminating state, cannot exceed this value.
- Resource Requests define the minimum amount of resources (e.g., CPU, memory) a container requires, guiding the Kubernetes Scheduler to place the Pod on a Node with sufficient resources.
- Resource Limits set the maximum amount of resources a container can consume, preventing resource exhaustion and ensuring system stability.
Quotas
Resource Quotas
Unlimited means that there is no restriction on input and usage, but actual usage cannot exceed the available value of the corresponding resource in the cluster.
Each container’s computing resource limit (limits) specified under the namespace, or each new Pod or PVC added, will consume the quota set here.
Includes the following resource quotas
Field | Description |
---|
Resource Requests | Specifies the quota value of the resource requests. |
Resource Limits | Specifies the quota value of the resource limits. |
Number of Pods | Specifies the quota number of Pods. |
Note:
- The resource quota of the namespace comes from the quota allocated to the project by the cluster. For any given resource, the maximum quota that can be set is the unused quota in the project. If the available amount of any resource is 0, you will not be able to create a namespace. Please contact the platform administrator for support.
- GPU resource quota can only be configured when GPU (vGPU or pGPU) resources are deployed in the cluster. When vGPU resources are used, vMemory quota can also be configured.
GPU Units: 100 units of virtual cores are equivalent to 1 physical core (1 pGPU = 1 core = 100 vGPU), and pGPU is allocated in whole units. 1 unit of memory is equal to 256 MiB, and 1024 MiB = 1 GiB.
- If no quota is specified for a certain resource, it defaults to Unlimited. This means that the namespace can use the available resources of the corresponding type allocated to the project in the cluster as needed, without any limit.
Storage Quotas
Quota Type:
- All: The total requested storage capacity of all Persistent Volume Claims (PVCs) in this namespace cannot exceed this value.
- Storage Class: In this namespace, the total requested storage capacity of all Persistent Volume Claims (PVCs) associated with the selected storage class cannot exceed this value.
Note: Please allocate the storage class to the project where the namespace resides in advance.
Extended Resources Quotas
The quota types for extended resources are obtained from the configuration dictionary (ConfigMap). If the corresponding configuration dictionary does not exist, this category will not be displayed.
Configuration Dictionary Field Descriptions
Field | Description |
---|
data.dataType | Specifies the data type of the value. |
data.defaultValue | Sets the default value. If this field does not exist or the value is empty, it indicates that there is no default value. |
data.descriptionEn | English prompt message, which can be viewed by clicking the icon on the right side of the value. |
data.descriptionZh | Chinese prompt message, which can be viewed by clicking the icon on the right side of the value. |
data.excludeResources | Mutually exclusive resources. This field is used to add resources that cannot be configured simultaneously, separated by , . |
data.group | Group |
data.groupI18n | The English and Chinese names of the group, which can be viewed and selected in the drop-down options corresponding to the quota types. Applicable when the same resource has one or more values. |
data.key | Specifies the value of the key. A configuration dictionary can only describe one key. |
data.labelEn/data.labelZh | The English/Chinese name of the resource, which can be viewed and selected in the drop-down options corresponding to the quota types. This field serves the same function as the data.groupI18n field but is only applicable when the same resource has a single value, ensuring compatibility with the old version of the configuration dictionary (ConfigMap). |
data.limits | Indicates whether to configure limits for the resources. Valid values include: disabled indicates limits cannot be configured for the resource, required indicates it must be input, and optional indicates it is optional input. |
data.requests | Indicates whether to configure requests for the resources. Valid values include: disabled indicates requests cannot be configured for the resource, required indicates it must be input, optional indicates it is optional input, and fromLimits indicates it will use the same configuration as limits. |
data.relatedResources | Associated resources. This field is reserved and currently cannot be used. |
data.resourceUnit | Unit of the resource, must be input in English letters, and currently does not support input in Chinese. |
data.runtimeClassName | Required runtime class, defaults to empty with optional value nvidia. |
metadata.labels | - features.cpaas.io/type: CustomResourceLimitation, this label is mandatory and cannot be changed.
-
features.cpaas.io/group: <*groupName*> , this label is mandatory and should modify groupName to the corresponding group. - features.cpaas.io/enabled: "true", this label is mandatory and indicates whether it is enabled, default is true.
|
metadata.name | The format is cf-crl-<*groupName*>-<*name*> , where - cf-crl is a fixed field and cannot be changed.
- groupName is the name of the corresponding resource group, e.g., gpu-manager, galaxy, etc.
- name is the resource name:
- Resource name can be standard resource type names, e.g., cpu, memory, pods, etc. The standard resource names must comply with Kubernetes' qualified name rules and must exist within the defined standard resource types in Kubernetes.
- Resource names can also be special resource types starting with specific prefixes, such as: hugepages- or requests.hugepages-.
|
metadata.namespace | Must be specified as the kube-public namespace and cannot be changed. |
Configuration Dictionary Example
This document only provides YAML configuration examples for physical GPU, GPU Manager core count and memory, MPS core count and memory. For using other resources, please refer to the above field descriptions for customization.
-
Physical GPU Configuration Example
apiVersion: v1
data:
dataType: integer
defaultValue: "1"
descriptionEn: GPU quantity
descriptionZh: GPU 数量
excludeResources: nvidia.com/mps-core,nvidia.com/mps-memory,tencent.com/vcuda-core,tencent.com/vcuda-memory
group: nvidia-device-plugin
groupI18n: '{"zh": "pGPU", "en": "pGPU"}'
key: nvidia.com/gpu
labelEn: GPU core
labelZh: 物理 GPU
limits: optional
relatedResources: ""
requests: disabled
resourceUnit: count
runtimeClassName: nvidia
kind: ConfigMap
metadata:
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: nvidia-device-plugin
features.cpaas.io/type: CustomResourceLimitation
name: cf-crl-nvidia-device-plugin
namespace: kube-public
-
GPU Manager Configuration Example
-
GPU Manager Core Count:
apiVersion: v1
data:
dataType: integer
defaultValue: "20"
descriptionEn: "GPU vcore count, 100 vcore equals 1 GPU core"
descriptionZh: 虚拟 GPU 核心数,100个虚拟核心等于 1 个 GPU 物理核心
excludeResources: nvidia.com/gpu,nvidia.com/mps-core,nvidia.com/mps-memory
group: gpu-manager
groupI18n: '{"zh": "GPU Manager", "en": "GPU Manager"}'
key: tencent.com/vcuda-core
labelEn: GPU vcore
labelZh: 虚拟 GPU
limits: optional
relatedResources: tencent.com/vcuda-memory
requests: disabled
resourceUnit: vcore
runtimeClassName: ""
kind: ConfigMap
metadata:
labels:
device-recource.cpaas.io/config: "true"
features.cpaas.io/enabled: "true"
features.cpaas.io/group: gpu-manager
features.cpaas.io/type: CustomResourceLimitation
name: demo-gpu-manager-core
namespace: kube-public
-
GPU Manager Memory:
apiVersion: v1
data:
dataType: integer
defaultValue: "20"
descriptionEn: GPU vmemory, 256 Mi physical memory per Unit
descriptionZh: 虚拟 GPU 显存,每单位等于 256Mi 显存
excludeResources: nvidia.com/gpu,nvidia.com/mps-core,nvidia.com/mps-memory
group: gpu-manager
groupI18n: '{"zh": "GPU Manager", "en": "GPU Manager"}'
key: tencent.com/vcuda-memory
labelEn: GPU vmemory
labelZh: 显存
limits: optional
relatedResources: tencent.com/vcuda-core
requests: disabled
resourceUnit: unit
runtimeClassName: ""
kind: ConfigMap
metadata:
labels:
device-recource.cpaas.io/config: "true"
features.cpaas.io/enabled: "true"
features.cpaas.io/group: gpu-manager
features.cpaas.io/type: CustomResourceLimitation
name: demo-gpu-manager-memory
namespace: kube-public
-
MPS Configuration Example
-
MPS Core Count:
apiVersion: v1
data:
dataType: integer
defaultValue: "20"
descriptionEn: "MPS GPU core count, 100 MPS core equals 1 GPU core"
descriptionZh: MPS GPU 核心数,100个 MPS 核心等于 1 个 GPU 物理核心
excludeResources: nvidia.com/gpu,tencent.com/vcuda-core,tencent.com/vcuda-memory
group: nvidia-mps-device-plugin
groupI18n: '{"zh": "MPS", "en": "MPS"}'
key: nvidia.com/mps-core
labelEn: MPS GPU core
labelZh: MPS GPU
limits: optional
relatedResources: nvidia.com/mps-memory
requests: disabled
resourceUnit: vcore
runtimeClassName: nvidia
kind: ConfigMap
metadata:
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: nvidia-mps-device-plugin
features.cpaas.io/type: CustomResourceLimitation
name: cf-crl-nvidia-mps-device-plugin-core
namespace: kube-public
-
MPS Memory:
apiVersion: v1
data:
dataType: integer
defaultValue: "1"
descriptionEn: MPS GPU memory, 1 Gi physical memory per Unit
descriptionZh: MPS GPU 显存,每单位等于 1Gi 显存
excludeResources: nvidia.com/gpu,tencent.com/vcuda-core,tencent.com/vcuda-memory
group: nvidia-mps-device-plugin
groupI18n: '{"zh": "MPS", "en": "MPS"}'
key: nvidia.com/mps-memory
labelEn: MPS GPU memory
labelZh: MPS 显存
limits: optional
relatedResources: nvidia.com/mps-core
requests: disabled
resourceUnit: unit
runtimeClassName: nvidia
kind: ConfigMap
metadata:
labels:
features.cpaas.io/enabled: "true"
features.cpaas.io/group: nvidia-mps-device-plugin
features.cpaas.io/type: CustomResourceLimitation
name: cf-crl-nvidia-mps-device-plugin-memory
namespace: kube-public
Other Quotas
The format for custom quota names must comply with the following specifications:
- If the custom quota name does not contain a slash (/): It must start and end with a letter or number, and can contain letters, numbers, hyphens (-), underscores (_), or periods (.), forming a qualified name with a maximum length of 63 characters.
- If the custom quota name contains a slash (/): The name is divided into two parts: prefix and name, in the form of: prefix/name. The prefix must be a valid DNS subdomain, while the name must comply with the rules for a qualified name.
- DNS Subdomain:
- Label: Must start and end with lowercase letters or numbers, may contain hyphens (-), but cannot be exclusively composed of hyphens, with a maximum length of 63 characters.
- Subdomain: Extends the rules of the label, allowing multiple labels to be connected by periods (.) to form a subdomain, with a maximum length of 253 characters.