With Dynamic Resource Allocation (DRA), a pod requests devices through a ResourceClaim. “cannot allocate all claims” means: the scheduler finds no node on which all of the pod's claims can be satisfied.
Symptom
kubectl -n tag08 get pods,resourceclaim NAME READY STATUS RESTARTS AGE pod/job-2 1/1 Running 0 11s pod/job-9 0/1 Pending 0 10s pod/training 1/1 Running 0 29s NAME STATE AGE resourceclaim.resource.k8s.io/eine-gpu allocated,reserved 29s resourceclaim.resource.k8s.io/gpus-2 allocated,reserved 11s resourceclaim.resource.k8s.io/gpus-9 pending 10s
job-2 got two devices, job-9 requests nine GPUs with its claim – the node has eight.
Diagnosis
The message is in the pod's FailedScheduling event.
kubectl -n tag08 describe pod job-9 0/3 nodes are available: 1 node(s) had untolerated taint(s), 2 cannot allocate all claims. preemption: 0/3 nodes are available: 3 Preemption is not helpful for scheduling.
Causes
count too highMore devices than one node has
No node has nine GPUs, and a claim is never spread across several nodes. The pod stays Pending until someone changes the claim.
devices takenDevices are held by other claims
Allocated devices appear in the status of other claims. Only when they are freed can a new claim be satisfied.
kubectl -n tag08 get resourceclaim gpus-2 -o jsonpath='{range .status.allocation.devices.results[*]}{.device} {end}{"\n"}'
gpu-3 gpu-4Fix
kubectl -n tag08 delete pod job-9 --wait=false kubectl -n tag08 delete resourceclaim gpus-9
Don't: Try to edit the claim while it exists. A ResourceClaim's spec is immutable – delete and recreate it.
GPU infrastructure on Kubernetes, Day 8: Dynamic Resource Allocation with DeviceClass, ResourceClaim and the NVIDIA DRA driver.
Go to day 8 →
FAQ
How do I see which GPUs a claim got?
In the claim's status under .status.allocation.devices.results – it lists the allocated devices.
What does the state pending mean for a ResourceClaim?
The claim has not been allocated to a device yet. allocated,reserved means allocated and in use by a pod.