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—
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 request | Count only (nvidia.com/gpu: 1) | Class + criteria (e.g. at least 40 GB of memory) |
| Device info | Node only reports "how many" | Driver publishes each device with its attributes |
| Who picks | The kubelet on the node, any free device | The scheduler, picking a matching device and recording it |
| Status in Kubernetes | Still widely used | Core 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
Further reading: Dynamic Resource Allocation · Device Plugins · Schedule GPUs