Many GPU workloads on Kubernetes request a GPU with one line in the container spec, such as nvidia.com/gpu: 1. A device plugin on the node provides the GPU. Dynamic Resource Allocation (DRA) is a newer way to allocate devices. Before Kubernetes added extended resource support to DRA, a Pod that used DRA had to replace that line with a ResourceClaim. A ResourceClaim is an object that describes the device that a Pod needs.
Kubernetes 1.37 made extended resource support in DRA Stable. With this feature, the scheduler can allocate a device from a DRA driver for the one-line request, and you do not change the Pod spec. We tested the feature on Kubernetes 1.37.0 with the DRA example driver. The driver simulated eight GPUs on one node.
Set the resource name on the DeviceClass
A DeviceClass describes a type of device, and the cluster administrator sets the field extendedResourceName on it. With the Helm chart of the example driver, you set this field with the chart value deviceClass.extendedResourceName.
apiVersion: resource.k8s.io/v1
kind: DeviceClass
metadata:
name: gpu.example.com
spec:
extendedResourceName: example.com/gpu
selectors:
- cel:
expression: device.driver == 'gpu.example.com'
The container in the Pod requests the GPU with the same one-line request as before.
resources:
limits:
example.com/gpu: 1
The scheduler creates a ResourceClaim for the Pod and allocates a device to the claim. The user does not write the ResourceClaim.
$ kubectl get resourceclaim -n dra
NAME STATE AGE
one-extended-resources-wmwq2 allocated,reserved 15s
Move one node at a time
Each node provides the resource either through a device plugin or through DRA, and different nodes in one cluster can use different methods. One node must not use both methods for the same resource name. The design document does not support that case.
In our test, we gave one node two GPUs in its node status, as a device plugin does. The DRA node had eight GPUs. We then ran eleven Pods, and each Pod requested example.com/gpu: 1. Two Pods ran on the node with two GPUs, eight Pods ran on the DRA node, and one Pod stayed Pending. The scheduler created eight ResourceClaims, one for each Pod on the DRA node.
To move a node to DRA, first drain the GPU Pods from the node. Then remove the device plugin from the node, and start the DRA driver. The design document says that you should then check that the resource in the status.capacity of the node is zero. If the value is not zero, check that you removed the device plugin. In our test, the scheduler still allocated devices through DRA on a node whose capacity was 8 and whose allocatable value was 0. A capacity above zero therefore did not stop the allocation through DRA. Always remove the device plugin, because the design document does not support a node that uses both methods.
What changes for quotas, dashboards and alerts
In our test, a ResourceQuota on requests.example.com/gpu counted the Pods on both types of node. In a separate test on the DRA node, the quota had a limit of 3, and 3 GPUs were in use. The API server rejected the next Pod with the usual exceeded quota error.
On the DRA node, status.allocatable does not list example.com/gpu. ResourceSlices list the devices of the node. A dashboard or script that adds up status.allocatable of the nodes reports fewer GPUs for each node that you move to DRA. Change the dashboard or script so that it also adds up the devices in the ResourceSlices.
The scheduling message is different when there are not enough GPUs. In our test, a Pod that requested more GPUs than the DRA node has got the message cannot allocate all claims. On a device plugin node, the message is Insufficient followed by the resource name, for example Insufficient nvidia.com/gpu. Search your alerts and runbooks for the old message.
According to the Kueue documentation, Kueue adds each device to the quota usage one time. The Kueue support for DRA is Beta, and it has been on by default since Kueue 0.19. Kueue takes the resource name for the quota from the DeviceClass, and it does not count the ResourceClaim that the scheduler creates as a second device. We did not test this with Kueue.
Take one faulty GPU out of service
Device taints in DRA are also Stable in 1.37. With a DeviceTaintRule, you can stop the scheduler from using one GPU without draining the node. Get the driver, pool and device names from kubectl get resourceslices -o yaml.
apiVersion: resource.k8s.io/v1
kind: DeviceTaintRule
metadata:
name: bad-gpu
spec:
deviceSelector:
driver: gpu.example.com
pool: gpu-node-1
device: gpu-0
taint:
key: example.com/unhealthy
value: ecc-errors
effect: NoSchedule
In our test with the effect NoSchedule, the Pod that already used gpu-0 kept running, and the scheduler gave three new Pods other devices.
The effect NoExecute also evicts the Pods that already use the device. On Kubernetes 1.37.0, NoExecute evicted a Pod whose spec names a ResourceClaim. It did not evict a Pod that used the one-line request. The fix is in 1.37.2. If you plan to use the one-line request together with NoExecute, run 1.37.2 or later. We did not test the fix on 1.37.2.
On KKP, Kubernetes 1.37.2 is available from KKP 2.31.4. Before you upgrade to KKP 2.31.4, create a second OIDC client for the dashboard in your identity provider, or configure KKP to keep using one shared client. The changelog describes both options.
Before you move a node
Before you plan the move, check which features the DRA driver from your GPU vendor supports, and which of them are ready for production use. The Helm chart of the NVIDIA DRA driver 0.5.1 includes a DeviceClass for nvidia.com/gpu. Its README says that some GPU allocation features can be tried out and are not yet officially supported. To turn these features on, you set gpuResourcesEnabledOverride=true in the chart. Try the driver on a test node pool. Do not run it on a node where the NVIDIA device plugin still reports nvidia.com/gpu.
The one-line request names one resource and a number of devices. If you want to request each GPU model separately, each model needs a separate DeviceClass and a separate resource name. A workload needs a ResourceClaim if it selects devices by their attributes, or if several Pods share one device.
For the other layers of an AI platform, such as model serving, an AI gateway and secret management, read What turns a GPU cluster into an AI platform.





