Accelerator Quota

Accelerator products usually expose resources through Kubernetes extended resource names. After the product is installed, ACP can use those resource names in project and namespace quota.

Quota resources

After an accelerator product is installed in a cluster, ACP can show corresponding accelerator quota fields at project or namespace scope. The exact resource names and units depend on the product.

Examples include:

  • physical NVIDIA GPU count;
  • HAMi virtual GPU core and memory resources;
  • Ascend NPU resources;
  • DRA or vendor-specific resource types.

Show quota fields in ACP

Kubernetes node allocatable resources and ACP quota fields are related but not the same. A node can report an accelerator extended resource, while the ACP quota page still needs resource metadata before it can show the resource as a selectable quota field.

If the node already reports the accelerator resource but the ACP quota page does not show it, register the resource metadata with a ConfigMap in the kube-public namespace.

NOTE

Required rules:

  • Create one ConfigMap for each accelerator resource name.
  • Create the ConfigMap in the kube-public namespace.
  • Use the cf-crl-<groupName>-<name> format for metadata.name.
  • Set metadata.labels.features.cpaas.io/type to CustomResourceLimitation.
  • Set metadata.labels.features.cpaas.io/group and data.group to the same group name.
  • Set metadata.labels.features.cpaas.io/enabled to "true".
  • Set data.key to the exact Kubernetes extended resource name, such as nvidia.com/gpualloc or huawei.com/Ascend910.

Use the following fields to control how ACP displays and applies the resource in quota pages:

  • data.labelEn and data.labelZh: display names shown to users.
  • data.descriptionEn and data.descriptionZh: help text shown to users.
  • data.limits: set to required or optional.
  • data.requests: set to disabled or fromLimits.
  • data.resourceUnit: resource unit, such as count.
  • data.relatedResources: resource names that should be used together.
  • data.excludeResources: resource names that should not be mixed with this resource.
  • data.ignoreNodeCheck: set to "true" when the quota field is derived from another resource and does not need direct node allocatable checking.

If a product exposes multiple resource names, create one ConfigMap for each resource name. For example, shared GPU products may expose separate resource names for GPU core and GPU memory.

Examples

HAMi NVIDIA
HAMi Ascend vNPU
Ascend 910
NVIDIA GPU

The following example registers HAMi NVIDIA resource fields for GPU count, vGPU core, and vGPU memory:

apiVersion: v1
data:
  dataType: integer
  defaultValue: "1"
  descriptionEn: Declare how many physical GPUs needs
  descriptionZh: 申请的物理 gpu 个数
  group: hami-nvidia
  groupI18n: '{"zh": "HAMi NVIDIA", "en": "HAMi NVIDIA"}'
  key: nvidia.com/gpualloc
  labelEn: gpu number
  labelZh: gpu 个数
  limits: optional
  requests: disabled
  resourceUnit: "count"
  relatedResources: "nvidia.com/gpucores,nvidia.com/gpumem"
  excludeResources: "nvidia.com/mps-core,nvidia.com/mps-memory,tencent.com/vcuda-core,tencent.com/vcuda-memory"
  runtimeClassName: ""
kind: ConfigMap
metadata:
  labels:
    features.cpaas.io/enabled: "true"
    features.cpaas.io/group: hami-nvidia
    features.cpaas.io/type: CustomResourceLimitation
  name: cf-crl-hami-nvidia-gpualloc
  namespace: kube-public
---
apiVersion: v1
data:
  dataType: integer
  defaultValue: "20"
  descriptionEn: Declare how many cores needs per physical GPU (%)
  descriptionZh: 每个物理 GPU 申请的算力(%)
  group: hami-nvidia
  groupI18n: '{"zh": "HAMi NVIDIA", "en": "HAMi NVIDIA"}'
  key: nvidia.com/gpucores
  labelEn: vgpu cores
  labelZh: vgpu 算力
  limits: optional
  requests: disabled
  resourceUnit: "%"
  relatedResources: "nvidia.com/gpualloc,nvidia.com/gpumem"
  excludeResources: "nvidia.com/mps-core,nvidia.com/mps-memory,tencent.com/vcuda-core,tencent.com/vcuda-memory"
  runtimeClassName: ""
  ignoreNodeCheck: "true"
kind: ConfigMap
metadata:
  labels:
    features.cpaas.io/enabled: "true"
    features.cpaas.io/group: hami-nvidia
    features.cpaas.io/type: CustomResourceLimitation
  name: cf-crl-hami-nvidia-gpucores
  namespace: kube-public
---
apiVersion: v1
data:
  dataType: integer
  defaultValue: "4000"
  descriptionEn: Declare how many memory needs per physical GPU (Mi)
  descriptionZh: 每个物理 GPU 申请的显存(Mi)
  group: hami-nvidia
  groupI18n: '{"zh": "HAMi NVIDIA", "en": "HAMi NVIDIA"}'
  key: nvidia.com/gpumem
  labelEn: vgpu memory
  labelZh: vgpu 显存
  limits: optional
  requests: disabled
  resourceUnit: "Mi"
  relatedResources: "nvidia.com/gpualloc,nvidia.com/gpucores"
  excludeResources: "nvidia.com/mps-core,nvidia.com/mps-memory,tencent.com/vcuda-core,tencent.com/vcuda-memory"
  runtimeClassName: ""
  ignoreNodeCheck: "true"
kind: ConfigMap
metadata:
  labels:
    features.cpaas.io/enabled: "true"
    features.cpaas.io/group: hami-nvidia
    features.cpaas.io/type: CustomResourceLimitation
  name: cf-crl-hami-nvidia-gpumem
  namespace: kube-public
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: cf-crl-hami-config
  namespace: kube-public
  labels:
    device-plugin.cpaas.io/config: "true"
data:
  deviceName: "HAMi"
  nodeLabelKey: "gpu"
  nodeLabelValue: "on"

For other accelerator products, keep the same ACP metadata model and replace the resource key, labels, display names, unit, and device information with the values exposed by that product.

Configure quota

Use ACP quota pages for operations such as adding a cluster to a project, creating a namespace, or changing namespace quota. Use accelerator product documentation to understand which resource names a product exposes and what each unit means.

Quota pages