Specialized devices and DRA
Devices are not ordinary CPU shares
A device plugin advertises node-local extended resources through the kubelet. A Pod can request a qualified resource such as hardware.example.com/accelerator if a compatible plugin exposes it. Extended resources are integer quantities and cannot be overcommitted in the standard resource model; if requests and limits are both specified they must match. A device count alone says nothing about device memory, driver compatibility or application speed. GPU drivers, runtime integration and vendor-specific plugins must be installed and reviewed separately. The invented resource in this example is unavailable in this environment.
resources: requests: cpu: "1" memory: 1Gi hardware.example.com/accelerator: "1" limits: hardware.example.com/accelerator: "1"NUMA and resource managers
NUMA means non-uniform memory access: a CPU may access local memory more efficiently than memory attached to another NUMA node. For eligible Guaranteed containers with integer CPU requests, CPU Manager static policy can assign exclusive CPUs, subject to configuration and availability. Topology Manager coordinates topology hints from resource managers and device plugins; its policy can reject an otherwise resource-fit Pod at node admission. Memory Manager can support NUMA-aware memory and hugepage allocation in supported configurations. Huge pages are separately advertised, preallocated resources and are not overcommitted. Do not change kubelet policy on a shared node for this exercise.
Node total: 4 free CPUsNUMA 0: 2 free CPUs; NUMA 1: 2 free CPUsA strict single-NUMA request for 3 CPUs cannot fit this simplified inventory.Understand Dynamic Resource Allocation
DRA lets workloads request devices through richer resource claims. DeviceClass describes selection criteria; a ResourceSlice advertises driver inventory and attributes; a ResourceClaim describes a request and records allocation; a ResourceClaimTemplate can generate per-Pod claims. A compatible scheduler and driver arrange allocation and node preparation before the workload uses the device. Core DRA was documented as stable in upstream v1.34; the inherited v1.37.2 baseline is provisional. Additional features, including sharing, consumable capacity and device-related topology, have separate release and gate requirements. Do not infer their availability from core DRA maturity.
Driver publishes ResourceSlice -> DeviceClass describes choicesResourceClaim requests a device -> scheduler allocates and selects nodeDriver prepares device -> workload starts (if all other checks pass)Match attributes, availability and trust
A fictional inventory contains a 16 GiB accelerator in node A and two 24 GiB accelerators in node B, one already allocated. A request for at least 20 GiB and one free accelerator has one candidate device on node B. Our offline selector handles only that simple predicate and does not implement CEL, driver allocation, sharing, claim lifecycle or scheduler logic. Before a real pilot, verify API discovery for resource.k8s.io/v1, feature status for each required capability, driver/controller and kubelet support, isolation and resource cleanup. Use only a reviewed device class; do not allow arbitrary tenant-controlled driver configuration.
A: 16 GiB free -> too smallB: 24 GiB allocated -> unavailableB: 24 GiB free -> candidatePractice and next step
Use devices.json and device-cases.json to predict the eligible device IDs. Check the NUMA cases and explain why a matching device does not prove that the application can start. Do not install drivers or allocate accelerators. Next: measurement design.
python validate_offline.py # synthetic inventory onlyFurther reading
- https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/ — CPU Manager policies
- https://kubernetes.io/docs/tasks/administer-cluster/topology-manager/ — NUMA alignment
- https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/ — Memory Manager and topology hints
- https://kubernetes.io/docs/tasks/manage-hugepages/scheduling-hugepages/ — Huge page capacity
- https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/ — Device plugin resource advertisement
- https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/ — GPU prerequisites and resource limits
- https://v1-34.docs.kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/ — Versioned v1.34 core DRA stable feature evidence
- https://kubernetes.io/docs/concepts/resource-management/dynamic-resource-allocation/dra-api/ — DeviceClass, ResourceClaim and ResourceSlice API
- https://kubernetes.io/docs/concepts/resource-management/dynamic-resource-allocation/how-dra-works/ — Allocation workflow and optional feature distinctions
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Specialized devices and DRA — knowledge check
Identify device resource and version requirements
What advertises node-local extended resources in the conventional model?
What does a device count alone prove?
What is a ResourceSlice used for?
Does stable core DRA imply every device-sharing capability is stable?
Two NUMA nodes have two free CPUs each. Can one strict single-NUMA allocation of three fit?