tencent cloud

Tencent Kubernetes Engine

XPU Component Description

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-10-23 16:19:16
Diterjemahkan & Diperiksa oleh AI

Introduction

Component Description

The Kunlunxin XPU component (component identifier: xpu-gpu) is used to manage and schedule Kunlunxin XPU accelerator card resources in Tencent Cloud TKE clusters. The component helps run containers that require XPU resources by automatically discovering Kunlunxin XPU (kunlunxin.com/xpu) on nodes as schedulable resources. It also automatically deploys a monitoring exporter to provide XPU device monitoring metrics in standard Prometheus format.

Kubernetes Objects Deployed in a Cluster

All are deployed in the kube-system namespace.
Object name
Type
Feature Description
xpu-device-plugin-daemonset
DaemonSet
A Device Plugin that discovers XPU devices on nodes and registers and reports them to kubelet for scheduling by business Pods.
xpu-exporter
DaemonSet
XPU device metrics collector that exposes monitoring metrics in standard Prometheus format.
xpu-rbac-token-gen
DaemonSet
Synchronizes the ServiceAccount token and ca.crt to the XPU runtime directory on nodes for the XPU runtime to access the cluster API.
xpu-device-plugin
ServiceAccount / ClusterRole / ClusterRoleBinding
Permissions required for Device Plugin to run.
xpu-exporter
ServiceAccount / ClusterRole / ClusterRoleBinding
Permissions required for Exporter to run.
klx-xpu-serviceaccount / klx-xpu-clusterrole / klx-xpu-binding
ServiceAccount / ClusterRole / ClusterRoleBinding
Permissions required for the token synchronization component to run.

Scenarios

Full-card mode: Allocates an entire XPU card as an exclusive resource to a business container, which uses the resource by requesting kunlunxin.com/xpu. This mode is suitable for scenarios that require high computing power and do not need resource sharing, such as training.
Device monitoring: xpu-exporter runs as a DaemonSet on each XPU node and obtains the device-to-Pod ownership relationship through /var/lib/kubelet/pod-resources/. It can provide XPU monitoring metrics at the card, Pod, and container levels for Prometheus to collect.

Limits

Cluster version: Only clusters running Kubernetes 1.16 or later are supported.
Node architecture: Only amd64 nodes are supported.
Underlying environment dependencies: The component is deployed as a DaemonSet on nodes with XPU devices. Ensure that the Kunlunxin XPU driver and XRE runtime environment have been installed on the nodes in advance.
Node label restriction: The component is scheduled only to nodes with the kunlun-device-enable=enable label. The component is not deployed on nodes without this label, and such nodes do not report XPU resources.
Container permissions: Both the xpu-device-plugin and xpu-exporter containers run in privileged: true mode to access the /dev device nodes and device management interfaces on the node.
Token persistence: xpu-rbac-token-gen periodically writes the ServiceAccount token and ca.crt to the host directory /xpu-runtime/auth on the node. Ensure that access to the host of the XPU node is controlled.

Component Permission Description

Permission Description

The component requires specific Kubernetes RBAC permissions to run, which are used for node XPU device discovery and reporting, node status updates, device monitoring metric collection, and cluster access credential distribution for the XPU runtime. The component grants permissions to each submodule by automatically creating the corresponding ServiceAccount, ClusterRole, and ClusterRoleBinding.

Permission Scenarios

Feature Module
Involved Object
Involved Operation Permissions
Device discovery and reporting (xpu-device-plugin)
nodes,nodes/proxy
get,list,watch,patch
Device discovery and reporting (xpu-device-plugin)
nodes/status
patch,update
Device discovery and reporting (xpu-device-plugin)
pods
get,list,watch,update,patch
Device discovery and reporting (xpu-device-plugin)
events
create,patch
Metric collection (xpu-exporter)
nodes,nodes/proxy
get,list,watch
Metric collection (xpu-exporter)
nodes/status
patch,update
Metric collection (xpu-exporter)
pods
get,list,watch,update,patch
Metric collection (xpu-exporter)
events
create,patch
Credential distribution (xpu-rbac-token-gen)
nodes,nodes/status,nodes/proxy,pods,events
get,list

Permission Definition (Complete ClusterRole Declaration)

# 1. xpu-device-plugin Permissions
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: xpu-device-plugin
rules:
- apiGroups: [""]
resources: ["nodes", "nodes/proxy"]
verbs: ["get", "list", "watch", "patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["update", "patch", "get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes/status"]
verbs: ["patch", "update"]
---
# 2. xpu-exporter Permissions
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: xpu-exporter
rules:
- apiGroups: [""]
resources: ["nodes", "nodes/proxy"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["update", "patch", "get", "list", "watch"]
- apiGroups: [""]
resources: ["nodes/status"]
verbs: ["patch", "update"]
---
# 3. xpu-rbac-token-gen Permissions
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: klx-xpu-clusterrole
rules:
- apiGroups: [""]
resources: ["nodes", "pods", "nodes/status", "events", "nodes/proxy"]
verbs: ["get", "list"]

Component Parameter Description

Note:
You can customize the component during installation or update by configuring component parameters or modifying the YAML file.

Component Parameter Options

Parameter Name
Default Value
Description
global.image.host
ccr.ccs.tencentyun.com
Component image repository address
config.exporterPort
9507
Prometheus metrics collection port exposed by xpu-exporter
config.logVerbose
5
Log verbosity level of xpu-device-plugin (corresponding to --v)
config.memoryUnit
MiB
Unit of measurement for memory reported by xpu-device-plugin
images.devicePlugin.tag
v5.0.2-alpha.3
xpu-device-plugin image version
images.exporter.tag
v5.0.3-alpha.6
xpu_exporter image version
images.rbacTokenGen.tag
v1.0.0
xpu-rbac-token-gen image version
exporter.goMemLimit
800MiB
Go runtime memory limit of xpu-exporter (GOMEMLIMIT)
exporter.resources.requests.cpu
100m
xpu-exporter CPU request
exporter.resources.requests.memory
100Mi
xpu-exporter memory request
exporter.resources.limits.cpu
1000m
xpu-exporter CPU limit
exporter.resources.limits.memory
1Gi
xpu-exporter memory limit
nodeSelector
kunlun-device-enable: enable
Target node selector for component deployment

Configuration Example

global:
image:
host: ccr.ccs.tencentyun.com

config:
exporterPort: 9507
logVerbose: 5
memoryUnit: MiB

exporter:
goMemLimit: 800MiB
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 1000m
memory: 1Gi

nodeSelector:
kunlun-device-enable: enable

Reserved Parameters (Not Effective in the Current Version)

The following parameters are declared in values.yaml, but are not yet referenced by the current chart template. Configuring them has no actual effect, so do not rely on them:
Parameter Name
Default Value
Intended Use
config.logLevel
info
Log level.
devicePlugin.enableSriov
false
Enable vXPU (SR-IOV) virtualization or not.
devicePlugin.sriovNumVfs
0
Number of vXPUs.
devicePlugin.reconfigVxpu
false
Allow reconfiguring the number of vXPUs or not.
devicePlugin.enableXpuShare
false
Enable XPU sharing mode or not.
devicePlugin.useDetailResName
false
Report resource names by model or not (for example, kunlunxin.com/R200)
devicePlugin.customizedResourceName
""
Custom resource name (leave empty to use the default kunlunxin.com/xpu)
tolerations
See values.yaml.
Tolerations (hardcoded in the current DaemonSet template)

Usage Examples

Add the component scheduling label to the node:
kubectl label node <node_name> kunlun-device-enable=enable
A business Pod requests XPU resources:
apiVersion: v1
kind: Pod
metadata:
name: xpu-demo
spec:
nodeSelector:
kunlun-device-enable: enable
containers:
- name: demo
image: <your_business_image>
resources:
limits:
kunlunxin.com/xpu: 1
View the XPU resources allocatable on the node:
kubectl describe node <node_name> | grep kunlunxin.com/xpu


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan