Skip to main content
AI on Kubernetes · GPU/NPULesson 2 of 20

Requesting GPUs by Criteria (DRA)

Until now, Kubernetes could only request GPUs by count. Dynamic Resource Allocation (DRA) lets you request them by criteria, such as "one GPU with at least 40 GB of memory". The core API became GA in Kubernetes 1.34. Follow how a request turns into a device.

Request1 GPU
Allocated devicecannot choose
Pod status—
Control planeGPU node · node-2UserPod + criteriaDevice claimResourceClaimDevice classDeviceClassAPI serverentry pointSchedulerpicks device+nodeDevice listResourceSlicekubeletnode-2DRA driverfrom vendortrainPodgpu-024GBgpu-180GBGPU ×1
RequestResponse / reportAppears in a later step

What you will learn

  • The limits of requesting by count
  • Drivers publish the list of devices
  • Criteria go in a ResourceClaim
  • The scheduler is what picks the device
  • The device is released when the Pod ends

Device plugins vs DRA​

Before (device plugin)DRA
How you requestCount only (nvidia.com/gpu: 1)Class + criteria (e.g. at least 40 GB of memory)
Device infoNode only reports "how many"Driver publishes each device with its attributes
Who picksThe kubelet on the node, any free deviceThe scheduler, picking a matching device and recording it
Status in KubernetesStill widely usedCore API GA in 1.34; extra features graduate in later versions

Try it yourself​

kubectl get deviceclasses # Broad device categories
kubectl get resourceslices # Devices each driver published per node
kubectl get resourceclaims -A # Claims and their allocation state
kubectl get resourceclaim <name> -o jsonpath='{.status.allocation.devices.results}' # Device written to the claim
kubectl describe pod <pod> # FailedScheduling: cannot allocate all claims

Check yourself

  1. With DRA, who decides which specific GPU a Pod gets?
  2. A Pod asks for a GPU with at least 40 GB, and the cluster has free 24 GB GPUs. The Pod is Pending. What should you check?
  3. A training Pod that used a ResourceClaimTemplate is deleted. What happens to its GPU?

Further reading: Dynamic Resource Allocation · Device Plugins · Schedule GPUs