Back to Blog

Dynamic Resource Allocation (DRA) for the CKA Exam on Kubernetes 1.37: DeviceClass, ResourceClaim, ResourceClaimTemplate & ResourceSlice, CEL Device Selectors, ExactCount vs All, firstAvailable Prioritized Lists, Admin Access, Device Taints & DeviceTaintRules, Extended-Resource Mapping, Consumable Capacity & Partitionable Devices, How the Scheduler Allocates and Deallocates, and How DRA Compares to Device Plugins

A practitioner's CKA guide to Dynamic Resource Allocation, the resource.k8s.io/v1 API that went GA in Kubernetes 1.34 and is what the 1.37 exam cluster uses for GPUs, NICs and other devices: the four core kinds (DeviceClass, ResourceClaim, ResourceClaimTemplate, ResourceSlice) field by field with their validation limits, how a Pod references a claim in spec.resourceClaims and resources.claims, what the resourceclaim-controller, the kube-scheduler DynamicResources plugin and the kubelet each do between kubectl apply and a running container (first-fit by lexicographic pool name, status.allocation and reservedFor with its 256-entry cap, NodePrepareResources over gRPC and CDI injection), CEL selectors with device.attributes / device.capacity / quantity(), ExactCount vs All, firstAvailable prioritized lists, adminAccess and the resource.kubernetes.io/admin-access namespace label, device taints with NoSchedule / NoExecute / None and admin DeviceTaintRules, the GA extendedResourceName bridge from classic extended-resource requests, consumable capacity with shareID, partitionable devices with sharedCounters, binding conditions and the 600-second PreBind wait, the resourceclaims/binding and resourceclaims/driver synthetic subresources, the no-preemption and nodeName-bypass traps, a feature-gate table for 1.37, a kind-based lab, a diagnosis table and a side-by-side with device plugins.

By Sailor Team , November 20, 2026

Until Kubernetes 1.34, a GPU, an FPGA, a SmartNIC or any other “special” piece of hardware reached a Pod through exactly one door: a device plugin that advertised an opaque integer such as example.com/gpu: 8 on the Node, and a container that asked for example.com/gpu: 1 in its resource limits. That model has no way to say which GPU, how much of it, shared with whom, or configured how. Kubernetes 1.34 shipped the replacement as GA: Dynamic Resource Allocation (DRA), a resource.k8s.io/v1 API in which drivers publish devices with typed attributes, users claim devices with CEL expressions the way they claim storage with a PersistentVolumeClaim, and the scheduler does the matching.

The CKA exam is based on Kubernetes v1.37, so every exam cluster you touch has the DRA API server-side and kubectl get deviceclasses is a valid command there. The published CKA curriculum does not name DRA as a bullet. It lands under “Configure Pod admission and scheduling (limits, node affinity, etc.)”, “Understand extension interfaces (CNI, CSI, CRI, etc.)” and the 30 percent troubleshooting domain, where a Pod stuck in Pending because a ResourceClaim cannot be allocated is exactly the kind of thing you are expected to diagnose. Treat this post as the mechanism-level understanding an administrator needs, written against the 1.37 documentation, with every feature stamped with the release in which it reached its current stage. Where a feature is still alpha or beta in 1.37, the post says so, because a question that looks like “DRA” may really be testing whether you know the difference between a GA field and a gate you must enable.

If you want the scheduling framework this plugs into, read how kube-scheduler runs its Filter and Score plugins first; DRA is one more plugin in that pipeline, named DynamicResources.

What problem DRA solves, in one table

NeedDevice plugin model (classic)DRA (resource.k8s.io/v1)
Advertise hardwareInteger count per extended resource on node.status.capacityResourceSlice objects listing each device with typed attributes and capacities
Request hardwareresources.limits["vendor.com/gpu"]: 1 per container, requests must equal limits, integers onlyResourceClaim or ResourceClaimTemplate referenced from pod.spec.resourceClaims
Choose a specific kind of deviceNot possible except by inventing more resource namesCEL selector on attributes, capacity and driver
Share one device between containers or PodsNot supportedReference the same claim from several containers or Pods
Vendor configuration per workloadPer-node, in the plugin’s configPer-claim config passed to the driver (opaque parameters)
Who decides which devicekubelet, after the scheduler has already placed the Podkube-scheduler, before placement, using structured parameters
Device shows up inside the container howPlugin returns device nodes, env and mounts in AllocateDriver returns CDI device IDs in NodePrepareResources, the runtime injects them
Scope of the APIv1beta1 kubelet gRPC only, no cluster objectsFour cluster API kinds, one more for admin taints

The documentation’s own summary of the device-plugin limitations is blunt: they require per-container requests, do not support sharing and do not support expression-based filtering. DRA was designed to remove all three constraints while keeping the scheduler, not the kubelet, as the component that knows where capacity is.

The four kinds and who creates them

All four core kinds live in resource.k8s.io/v1, which became the storage version in 1.34. Three roles touch them:

KindScopeCreated byPurpose
ResourceSliceClusterThe DRA driver (a controller, usually a DaemonSet plus optional central controller)Publishes one or more devices of a pool, with attributes, capacity and the nodes that can reach them
DeviceClassClusterDriver or cluster adminA named category of devices plus default selectors and config; the thing users are allowed to ask for
ResourceClaimNamespaceWorkload operator, or generated by Kubernetes from a templateA concrete request for devices; carries the allocation result in its status
ResourceClaimTemplateNamespaceWorkload operatorA per-Pod claim factory; each Pod that references it gets its own ResourceClaim, deleted with the Pod

A fifth kind, DeviceTaintRule, is cluster-scoped and lets an admin taint devices without touching the driver. It is covered in the taints section.

The analogy the docs use is deliberate: a ResourceClaim is to a ResourceSlice what a PersistentVolumeClaim is to a PersistentVolume, and a DeviceClass plays the StorageClass role. If you have internalised the PV lifecycle after provisioning, the shape will feel familiar, with one important difference: there is no “pre-provisioned PV” equivalent. Slices are always published by a driver controller, and that controller overwrites manual edits.

ResourceSlice, field by field

apiVersion: resource.k8s.io/v1
kind: ResourceSlice
metadata:
  name: worker-1-gpu.example.com-abcde
spec:
  driver: gpu.example.com          # DNS subdomain, immutable, max 63 chars
  pool:
    name: worker-1                  # driver-chosen; node-local drivers usually use the node name
    generation: 3                   # bumped whenever the pool's device list changes
    resourceSliceCount: 1           # how many slices make up this generation of the pool
  nodeName: worker-1                # exactly one of nodeName | nodeSelector | allNodes | perDeviceNodeSelection
  devices:
  - name: gpu-0                     # DNS label
    attributes:
      model:
        string: "example-gpu-80g"   # int | bool | string | version (semver)
      index:
        int: 0
      uuid:
        string: "GPU-0f1e2d3c-..."
    capacity:
      memory:
        value: 80Gi                 # resource.Quantity

Facts the validation rules enforce, because exam distractors love limits:

  • Devices per slice: at most 128, dropping to 64 if any device in the slice uses taints, consumes counters or uses list-type attributes.
  • Attributes plus capacities per device: at most 32 combined; attribute names are an optional DNS-subdomain domain (max 63 characters) and a C-identifier ID (max 32 characters). An attribute written without a domain is implicitly qualified with the driver name, which is why CEL reads device.attributes["gpu.example.com"].model even when the YAML only says model.
  • Pool spans slices. A pool with 300 devices is published as three or more slices with the same pool.name and pool.generation, and resourceSliceCount tells the scheduler how many to expect. If it sees fewer slices than the count for the newest generation, it treats the pool as incomplete and skips it rather than allocating from a half-published view.
  • Node selection uses exactly one of nodeName (node-local devices), nodeSelector with a single term (a set of nodes, for example fabric-attached accelerators), allNodes: true (network-attached or control-plane managed resources), or perDeviceNodeSelection (partitionable-device feature; each device names its own node).
  • Field selectors exist for spec.nodeName, spec.driver and spec.pool.name, so kubectl get resourceslices --field-selector spec.nodeName=worker-1 works.

Drivers built on the k8s.io/dynamic-resource-allocation/kubeletplugin Go package get slice naming, generation bumps and publishing for free. Those drivers register with the kubelet through the standard plugin registration directory and talk to it over gRPC; the same package also lets the driver opt in to device metadata files and health reporting, both discussed below.

DeviceClass, field by field

apiVersion: resource.k8s.io/v1
kind: DeviceClass
metadata:
  name: gpu.example.com
spec:
  selectors:                               # up to 32; ANDed with the claim's own selectors
  - cel:
      expression: device.driver == "gpu.example.com"
  config:                                  # up to 32; vendor-opaque defaults for every claim of this class
  - opaque:
      driver: gpu.example.com
      parameters:
        apiVersion: gpu.example.com/v1alpha1
        kind: GpuConfig
        sharing:
          strategy: TimeSlicing
  extendedResourceName: example.com/gpu    # GA in 1.37; see the extended-resource section

A DeviceClass is how an admin says “users may ask for this shape of device with these defaults”. The class’s selectors are evaluated in addition to the claim’s selectors, never instead of them, so a class that pins device.driver cannot be widened by a user claim. The config entries are opaque to Kubernetes beyond a 10,240-byte size cap on parameters; the driver interprets them. Users do not need RBAC to read DeviceClasses to use them, but kubectl get deviceclasses is the first thing to try when a Pod is Pending and you suspect the class name is wrong.

ResourceClaim and ResourceClaimTemplate, field by field

apiVersion: resource.k8s.io/v1
kind: ResourceClaimTemplate
metadata:
  name: one-big-gpu
  namespace: ml
spec:
  spec:                                    # note the nested spec: a template wraps a claim spec
    devices:
      requests:                            # up to 32 requests per claim
      - name: gpu                          # DNS label; referenced from resources.claims[].request
        exactly:                           # exactly | firstAvailable (one of the two)
          deviceClassName: gpu.example.com # required
          allocationMode: ExactCount       # default; the alternative is All
          count: 1                         # default 1, must be > 0, only valid with ExactCount
          selectors:                       # up to 32 CEL selectors, ANDed
          - cel:
              expression: |-
                device.capacity["gpu.example.com"].memory.compareTo(quantity("40Gi")) >= 0
      constraints:                         # up to 32
      - requests: ["gpu"]
        matchAttribute: gpu.example.com/numa   # all devices for these requests share this attribute value
      config:                              # up to 32; claim-level vendor config
      - requests: ["gpu"]
        opaque:
          driver: gpu.example.com
          parameters:
            apiVersion: gpu.example.com/v1alpha1
            kind: GpuConfig
            sharing:
              strategy: SpacePartitioning

Three rules about claims that produce most of the Pending Pods you will debug:

  1. A ResourceClaim referenced by name must already exist in the Pod’s namespace. If it does not, the Pod stays Pending until it is created; the docs compare this to a PVC that does not exist yet.
  2. A ResourceClaim spec is immutable once created. You cannot “fix” a bad selector in place; delete and recreate, which also means any Pod using it must be recreated.
  3. A template-generated claim is owned by its Pod. Kubernetes names it after the Pod and the claim name, records the generated name in pod.status.resourceClaimStatuses[], annotates it with resource.kubernetes.io/pod-claim-name, and deletes it when the Pod goes away. Referencing a generated claim from a second Pod works mechanically but is explicitly discouraged, because the first Pod’s deletion takes the claim with it.

When to use which is a one-liner the docs state outright: a ResourceClaim when several Pods should share the same devices or the claim should outlive any one Pod; a ResourceClaimTemplate when every Pod should get its own, similarly configured devices, for example each Pod of a parallel Job getting one GPU.

How a Pod references a claim

apiVersion: v1
kind: Pod
metadata:
  name: trainer
  namespace: ml
spec:
  resourceClaims:                          # Pod-level list; exactly one of the two name fields per entry
  - name: my-gpu
    resourceClaimTemplateName: one-big-gpu
  - name: shared-nic
    resourceClaimName: team-nic            # must already exist in namespace ml
  containers:
  - name: train
    image: registry.example.com/train:1.4.2
    resources:
      claims:
      - name: my-gpu                       # container-level reference to a Pod-level claim
      - name: shared-nic
        request: eth                       # optional: only the devices of one request inside the claim
  - name: sidecar
    image: registry.example.com/metrics:2.0.0
    resources:
      claims:
      - name: shared-nic                   # two containers share the same claim and therefore the same device

The validation error must specify one of: resourceClaimName, resourceClaimTemplateName is called out in the docs with a specific cause worth remembering: if every entry already has exactly one field set and you still get it, a mutating admission webhook built against a client library older than 1.32 is probably rewriting the Pod and dropping the field. That is a cluster-administrator problem, not a manifest problem.

What happens between kubectl apply and a running container

This is the part the CKA troubleshooting domain cares about. Five components take turns.

1. The driver publishes ResourceSlices

The driver’s node-local plugin (or a central controller for network-attached devices) enumerates hardware and writes slices. Nothing in the control plane knows about a device until a slice says so. A quick sanity check after installing a driver is kubectl get resourceslices, whose default columns are NAME, NODE, DRIVER, POOL and AGE. No slices means no allocatable devices, whatever the vendor’s DaemonSet says.

2. The resourceclaim-controller materialises templates

In kube-controller-manager, the resourceclaim-controller watches Pods. For every resourceClaimTemplateName entry it creates a ResourceClaim in the Pod’s namespace, sets the Pod as owner, and writes the generated name into pod.status.resourceClaimStatuses. For a resourceClaimName entry it only checks existence. The same controller later handles deallocation (step 5) and, if a Pod was somehow scheduled without the scheduler reserving its claims, tries to repair the reservation.

3. The scheduler’s DynamicResources plugin allocates

For each node under consideration, the DynamicResources plugin simulates allocating every unallocated claim of the Pod against the ResourceSlices visible from that node. The algorithm the docs describe is first-fit, walking pools and slices in lexicographical order of their names, and drivers are told they can influence priority by naming pools and slices accordingly. The plugin needs:

  • a device whose node selection includes the candidate node,
  • that is not already allocated to another claim (unless the device allows multiple allocations, see consumable capacity, or the request asks for adminAccess),
  • that matches the DeviceClass selectors and the request selectors,
  • that satisfies constraints such as matchAttribute,
  • and whose taints are all tolerated.

If a node can satisfy all claims, it passes Filter. If several nodes pass, normal scoring applies, with one DRA twist: when a request uses a firstAvailable prioritized list, the index of the chosen sub-request feeds into the node score so nodes that can offer the preferred alternative win. On the chosen node the plugin writes two things into the claim’s status through the resourceclaims/binding synthetic subresource:

  • status.allocation with devices.results[] (one entry per allocated device: request, driver, pool, device, plus adminAccess, shareID, consumedCapacity when relevant) and a nodeSelector pinning the claim to where the devices are reachable;
  • status.reservedFor[], adding the Pod (resource: pods, name, uid). This list holds at most 256 consumers, so at most 256 Pods can share one claim; the docs promise the number may rise but never fall.

Two scheduler limitations are documented and both are classic exam traps:

  • No preemption for DRA resources. A higher-priority Pod that needs a device held by a running lower-priority Pod does not evict it; it stays Pending until the device is freed by termination or manual deletion. Everything you know about PriorityClass and preemption stops at the device boundary.
  • spec.nodeName bypasses the scheduler and therefore bypasses allocation. A Pod created with nodeName set never gets its claims allocated or reserved; the kubelet refuses to run it and re-checks periodically, while the Pod occupies CPU and memory on that node. The fix the docs recommend is a nodeSelector on kubernetes.io/hostname so the Pod still goes through scheduling, optionally enforced by a mutating admission policy that unsets nodeName.

4. The kubelet prepares the device and the runtime injects it

Once the Pod is bound, the kubelet on that node reads the claim’s allocation, finds the registered DRA plugin for each driver, and calls NodePrepareResources over gRPC. The driver does whatever vendor-specific setup the claim’s config demands and returns CDI (Container Device Interface) device IDs. The kubelet hands those to the container runtime in the CRI request, and the runtime applies the CDI spec: device nodes, environment variables, mounts, hooks. The container never sees Kubernetes objects; it sees /dev/... entries and env vars. On Pod termination the kubelet calls NodeUnprepareResources.

Two consequences matter for troubleshooting. First, a Pod can be Pending for scheduling reasons or stuck in ContainerCreating for preparation reasons; kubectl describe pod distinguishes them, because a FailedScheduling event is the scheduler and a NodePrepareResources error in the events is the kubelet-to-driver path. Second, if the driver’s DaemonSet is removed while Pods still hold allocations, those Pods cannot be unprepared and hang in Terminating; the 1.37 alpha “optional node operations” feature exists precisely to let control-plane-only resources declare that no node calls are needed.

5. Deallocation and cleanup

When the Pod is deleted, the scheduler-side reservation is dropped from reservedFor. For a template-generated claim the owner reference deletes the claim with the Pod. For a standalone ResourceClaim the object stays, and once reservedFor is empty the resourceclaim-controller clears status.allocation, returning the device to the pool while keeping the claim available for the next Pod. A resource.kubernetes.io/delete-protection finalizer prevents a claim from vanishing while allocated and in use; drivers that need their own cleanup must use their own finalizer, not that one.

CEL selectors: what you can reference

Selectors are CEL expressions evaluated against a device variable. In 1.37 the variable exposes:

ExpressionTypeExample
device.driverstringdevice.driver == "gpu.example.com"
device.attributes["<domain>"].<id>int, bool, string or semverdevice.attributes["gpu.example.com"].model == "example-gpu-80g"
device.capacity["<domain>"].<id>Quantitydevice.capacity["gpu.example.com"].memory.compareTo(quantity("40Gi")) >= 0
device.allowMultipleAllocationsbooldevice.allowMultipleAllocations == true to insist on a shareable device
quantity("64Gi")helperbuilds a Quantity for comparison; equality works too: == quantity("64Gi")
cel.bind(...)macrobind a sub-expression to a name inside a longer selector
.includes(x) on an attributeboolonly with the alpha DRAListTypeAttributes gate

Limits: an expression may be at most 10,240 bytes, and the API server rejects expressions whose estimated cost exceeds a fixed budget (the source code comments the budget as roughly a tenth of a second of evaluation). A selector that references an attribute the device does not have evaluates to an error, and an erroring selector does not match that device. Write defensively with has(device.attributes["gpu.example.com"].model) && ... when attributes are optional across models.

Attribute name quoting is where most first attempts fail. Attribute IDs are C identifiers, so device.attributes["gpu.example.com"].model is fine, but a driver that publishes an ID containing a hyphen must be read with index syntax: device.attributes["dra.example.com"]["supported-models"].

ExactCount vs All, and the firstAvailable alternative

allocationMode on a request has two values:

  • ExactCount (default): allocate exactly count devices (default 1). The request fails on a node that cannot provide that many unallocated matching devices.
  • All: allocate every device in the pool that matches. The docs add the sharp edge: if some matching devices are already allocated to other claims, an All request fails, unless it also sets adminAccess: true.

All is the mode for “give this monitoring Pod every GPU on this node”, which is why it pairs naturally with admin access.

Prioritized lists (firstAvailable, GA since 1.36) replace a single exactly with an ordered list of up to 8 sub-requests. The scheduler takes the first that can be satisfied on a node:

requests:
- name: accel
  firstAvailable:
  - name: one-large
    deviceClassName: gpu.example.com
    count: 1
    selectors:
    - cel:
        expression: device.attributes["gpu.example.com"].size == "large"
  - name: two-small
    deviceClassName: gpu.example.com
    count: 2
    selectors:
    - cel:
        expression: device.attributes["gpu.example.com"].size == "small"

Three behaviours to remember: the chosen sub-request is recorded as request: accel/one-large in the allocation result; the decision is per Pod, so replicas of one Deployment may land on different alternatives and the workload has to cope; and a container’s resources.claims[].request may name either the parent request (accel) or a specific sub-request. Sub-requests cannot set adminAccess.

Admin access

adminAccess: true on an exactly request (GA since 1.36) grants access to devices already in use by other claims and may let the driver expose extra privileges inside the container, for maintenance, monitoring and troubleshooting tools. The guard rail is a namespace label: only ResourceClaims and ResourceClaimTemplates created in a namespace carrying

resource.kubernetes.io/admin-access: "true"

(case-sensitive value) may set the field. Admission rejects it elsewhere. Combine with allocationMode: All to attach a diagnostic Pod to every GPU on a node without waiting for workloads to leave. Admin access is not exempt from device taints; an admin claim must tolerate every taint on the devices it wants. The gate is DRAAdminAccess, GA and on by default in 1.36 and later, applying to kube-apiserver, kube-scheduler and kubelet.

Device taints and DeviceTaintRules

Device taints (DRADeviceTaints, GA and locked on in 1.37) copy the node-taint vocabulary onto devices. A taint has key, value, effect and a timeAdded timestamp. Effects:

EffectSchedulerEviction controllerTypical use
NoScheduleSkips the device when allocating new claims; Pods needing it stay PendingNoneDevice reserved or degraded; drain gradually
NoExecuteImplies NoScheduleThe device taint eviction controller in kube-controller-manager deletes Pods using the device, after any tolerationSecondsHardware broken; firmware maintenance
NoneIgnoredIgnored, but the status message reports what would be evictedDriver health hints; admin dry run before switching to NoExecute

There is deliberately no PreferNoSchedule for devices.

Taints arrive two ways. Drivers can include taints in the device entries of their ResourceSlices (at most 16 per device). Admins create a DeviceTaintRule, a cluster-scoped kind served in resource.k8s.io/v1 as of 1.37, which adds one taint to every device matching its selector. A rule without any selector matches nothing, which the docs explain as protection against an accidental cluster-wide eviction:

apiVersion: resource.k8s.io/v1
kind: DeviceTaintRule
metadata:
  name: gpu-firmware-maintenance
spec:
  deviceSelector:
    driver: gpu.example.com
    pool: worker-7            # node-local drivers normally use the node name as pool name
    # device: gpu-3           # narrow to one device
  taint:
    key: gpu.example.com/maintenance
    value: firmware-2026-11
    effect: NoExecute

The documentation describes selection by driver, pool and device name, and also mentions selecting via a DeviceClass or a CEL selector to target a vendor-specific unique-ID attribute; run kubectl explain devicetaintrule.spec.deviceSelector on the cluster in front of you, because the exact field set has moved between the alpha and GA shapes.

The controller writes an EvictionInProgress condition into the rule’s status with a message such as “2 pods need to be evicted in 2 different namespaces. 1 pod evicted since starting the controller.” You can block on it:

kubectl wait --for=condition=EvictionInProgress=false devicetaintrule/gpu-firmware-maintenance

The dry-run pattern is: create the rule with effect: None, read the message (“3 published devices selected. 1 allocated device selected. 1 pod would be evicted in 1 namespace if the effect was NoExecute.”), then edit the effect to NoExecute. The API server updates timeAdded when the effect changes, which is when any tolerationSeconds countdown starts.

Claims tolerate taints with up to 16 tolerations per request, each with key, operator (Exists or Equal, default Equal), value, effect (NoSchedule or NoExecute) and tolerationSeconds. An empty toleration matches everything. For All requests every device must be untainted or tolerated. The node-level equivalents are covered in the node failure lifecycle post; the device version evicts by Pod deletion, not by kubelet eviction, so there is no graceful-shutdown choreography beyond the Pod’s own terminationGracePeriodSeconds.

The extended-resource bridge

Most existing manifests still say resources.limits: {example.com/gpu: 2}. The DRAExtendedResource feature (GA in 1.37, after alpha in 1.34 and beta in 1.36) lets those manifests be served by DRA without rewriting them:

  • A DeviceClass may declare spec.extendedResourceName: example.com/gpu. It should be unique across the cluster’s classes.
  • When a Pod requests example.com/gpu: 2 and no device plugin on a candidate node offers that resource, the scheduler generates a ResourceClaim for the Pod asking for ExactCount: 2 devices of that class, annotated resource.kubernetes.io/extended-resource-claim: "true".
  • The same extended resource may be provided by a device plugin on some nodes and by DRA on others in the same cluster, which is the migration story: move node pools to a DRA driver one at a time.
  • Even without extendedResourceName, every DeviceClass is implicitly reachable as the extended resource deviceclass.resource.kubernetes.io/<class-name>, so resources.limits: {deviceclass.resource.kubernetes.io/gpu.example.com: 1} allocates one device of that class with no claim object written by you.

The gate must be on in kube-apiserver, kube-scheduler, kube-controller-manager and kubelet; being GA in 1.37, it is.

Consumable capacity: sharing one device by amount

DRAConsumableCapacity (beta, on by default since 1.36) lets a device be allocated to multiple independent claims, with the scheduler accounting how much of a capacity each claim consumes. The driver marks the device allowMultipleAllocations: true and may attach a requestPolicy to a capacity:

devices:
- name: eth1
  allowMultipleAllocations: true
  capacity:
    bandwidth:
      value: "10G"
      requestPolicy:
        default: "1M"
        validRange:
          min: "1M"
          step: "8"

A request asks for an amount with exactly.capacity.requests: {bandwidth: 1G} (or inside a firstAvailable entry). The allocation result then carries consumedCapacity and a shareID (a UUID) identifying this share of the device, and the driver’s status entry uses the same shareID. A requestPolicy offers either validValues (up to 10 sorted values, default among them) or validRange with min, max, step. If the scheduler picks a device that does not allow multiple allocations, the whole device is allocated; force sharing with the CEL check device.allowMultipleAllocations == true.

The companion distinctAttribute constraint (same gate) is the opposite of matchAttribute: devices allocated for the listed requests must all have different values of the attribute. Its two documented uses are preventing one shareable device from being allocated twice inside a single claim, and spreading devices across NUMA nodes.

Partitionable devices: counters behind logical devices

DRAPartitionableDevices (beta, on by default since 1.36) models hardware such as a GPU that can be carved into several logical partitions sharing one physical memory. The driver publishes counter sets in one ResourceSlice and devices that consumesCounters in another slice of the same pool:

# slice 1 of 2 in the pool: the shared counters
sharedCounters:
- name: gpu-1-counters
  counters:
    memory:
      value: 8Gi
---
# slice 2 of 2: logical devices drawing from them
devices:
- name: device-1
  consumesCounters:
  - counterSet: gpu-1-counters
    counters:
      memory:
        value: 6Gi
- name: device-2
  consumesCounters:
  - counterSet: gpu-1-counters
    counters:
      memory:
        value: 6Gi

Two 6 GiB partitions over an 8 GiB counter means only one can be allocated at a time; the scheduler enforces it and the claim API is untouched. Limits: at most 8 counter sets per slice, 32 counters per set, 2 consumesCounters entries per device, and counter sets must live in a separate slice from the devices. perDeviceNodeSelection: true on the slice lets each device name its own node, for partitions spread over a multi-node fabric.

Binding conditions: waiting for a device to be ready

DRADeviceBindingConditions (beta, on since 1.36, requires DRAResourceClaimDeviceStatus too) addresses fabric-attached or reprogrammable devices that need an external controller to attach or flash them before a Pod can start. A device in a ResourceSlice may list bindingConditions (condition types that must become True in the claim’s status.conditions), bindingFailureConditions (types that abort and reschedule), and bindsToNode: true, which makes the scheduler write the chosen node into status.allocation.nodeSelector so the external controller knows where to attach. The wait happens in the scheduling framework’s PreBind phase and defaults to 600 seconds, configurable per profile:

apiVersion: kubescheduler.config.k8s.io/v1
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: default-scheduler
  pluginConfig:
  - name: DynamicResources
    args:
      apiVersion: kubescheduler.config.k8s.io/v1
      kind: DynamicResourcesArgs
      bindingTimeout: 60s

Pools without binding conditions are always evaluated before pools with them, regardless of name ordering. The same DynamicResourcesArgs object is also where the alpha DRASchedulerFilterTimeout gate (1.34, off by default) lets you cap the per-node Filter work at a default of 10 seconds, a guard against pathological CEL over huge pools.

Status, observability and the RBAC behind it

status.devices[] on a ResourceClaim (DRAResourceClaimDeviceStatus, GA in 1.37) is written by the driver, not the scheduler, and carries per-device conditions, opaque data and, for network devices, networkData with interfaceName, ips (up to 16 CIDRs) and hardwareAddress. Entries are rejected for devices not in the allocation and auto-removed when a device is deallocated.

Because two different components write to one status, 1.36 introduced granular status authorization (DRAResourceClaimGranularStatusAuthorization, beta on by default). Beyond update on resourceclaims/status, writers need rights on synthetic subresources:

Synthetic subresourceFields it guardsWho needs itVerbs
resourceclaims/bindingstatus.allocation, status.reservedForkube-scheduler, custom allocation controllersupdate, patch
resourceclaims/driverstatus.devicesDRA driversnode-aware: associated-node:update for node-local drivers (the API server checks the driver really runs on the node), arbitrary-node:update for multi-node controllers; scope with resourceNames: ["gpu.example.com"]

The hardening guide’s node-local driver ClusterRole is worth memorising as the shape of a least-privilege DRA role:

rules:
- apiGroups: ["resource.k8s.io"]
  resources: ["resourceclaims/status"]
  verbs: ["get", "patch", "update"]
- apiGroups: ["resource.k8s.io"]
  resources: ["resourceclaims/driver"]
  verbs: ["associated-node:patch", "associated-node:update"]
  resourceNames: ["gpu.example.com"]

For users, the RBAC story is ordinary: create, get, list, delete on resourceclaims and resourceclaimtemplates in their namespace; get and list on deviceclasses cluster-wide is useful but not required for scheduling. Node-local driver plugins should be prevented from publishing slices for other nodes; the recommended pattern is a ValidatingAdmissionPolicy that compares the slice’s spec.nodeName with the node name embedded in the driver’s bound ServiceAccount token, the same node-binding claim discussed in the kubelet TLS bootstrapping post.

Other observability hooks in 1.37:

  • Pod-level device health: with ResourceHealthStatus (beta, on since 1.36) and a driver implementing the DRAResourceHealth gRPC service, the kubelet writes per-device health into each container’s status.allocatedResourcesStatus; a device that stops reporting for 30 seconds (default, driver-configurable per device) is marked Unknown. Health is not updated after the Pod terminates.
  • Kubelet PodResources API: the PodResourcesLister gRPC service’s DynamicResource message lists claim and device names per container, the same socket monitoring agents already use for device plugins.
  • Device metadata files (beta in 1.37): drivers that opt in write JSON under /var/run/kubernetes.io/dra-device-attributes/resourceclaims/<claim>/<request>/<driver>-metadata.json (or .../resourceclaimtemplates/<podClaimName>/... for generated claims) so the workload can discover attributes such as model and UUID without talking to the API server.
  • ResourcePoolStatusRequest (alpha, DRAResourcePoolStatus, 1.36, off): a one-shot resource.k8s.io/v1alpha3 object that kube-controller-manager fills with total, allocated, available and unavailable device counts per pool; no default ClusterRole grants it.

Feature-gate map for Kubernetes 1.37

The table is the single most exam-useful artefact here: “which of these is on by default in 1.37” is a natural question.

GateAlphaBeta (default)GAState in 1.37
DynamicResourceAllocation1.301.32 (off)1.34, locked 1.35GA, cannot be disabled
DRAAdminAccess1.321.34 (on)1.36GA
DRAPrioritizedList1.331.34 (on)1.36GA
DRAResourceClaimDeviceStatus1.321.33 (on)1.37GA
DRAExtendedResource1.341.36 (on)1.37GA
DRADeviceTaints1.331.36 (on)1.37, lockedGA
DRAPartitionableDevices1.331.36 (on)Beta, on
DRAConsumableCapacity1.341.36 (on)Beta, on
DRADeviceBindingConditions1.341.36 (on)Beta, on
DRAResourceClaimGranularStatusAuthorization1.36 (on)Beta, on
ResourceHealthStatus (device health in Pod status)1.36 (on)Beta, on
DRAWorkloadResourceClaims (claims shared by a PodGroup)1.361.37 (off)Beta, off
DRASchedulerFilterTimeout1.34Alpha, off
DRAListTypeAttributes1.36Alpha, off
DRANodeAllocatableResources1.36Alpha, off
DRAResourcePoolStatus1.36Alpha, off
DRADerivedAttributes1.37Alpha, off
DRAOptionalNodeOperations1.37Alpha, off
DRADeviceCompatibilityGroups1.37Alpha, off

API versions: resource.k8s.io/v1 is served and stored by default. v1beta1 (introduced 1.30) and v1beta2 (1.32) can be re-enabled with --runtime-config=resource.k8s.io/v1beta1=true,resource.k8s.io/v1beta2=true on kube-apiserver for older drivers or tooling; v1alpha3 is needed only for alpha kinds such as ResourcePoolStatusRequest. If kubectl get deviceclasses returns error: the server doesn't have a resource type "deviceclasses", the API group has been disabled, not the feature gate.

Lab: DRA on kind with the example driver

The Kubernetes SIG Node dra-example-driver repository publishes fake GPUs so you can watch every step without hardware. The commands below assume a recent kind and a 1.37 node image; adapt image tags from the repository README.

  1. Create a cluster and install the driver. The repository ships a demo/create-cluster.sh script and a Helm chart under deployments/helm/dra-example-driver. After helm upgrade -i --create-namespace --namespace dra-example-driver dra-example-driver deployments/helm/dra-example-driver, confirm publication:

    kubectl get resourceslices
    kubectl get deviceclasses
    kubectl get resourceslice -o yaml | grep -A3 'attributes:' | head -20

    Expect one slice per worker, driver gpu.example.com, and a gpu.example.com DeviceClass. Note the attribute names and the capacity key; they drive your CEL.

  2. Create a template and a Job. Write a ResourceClaimTemplate selecting device.driver == "gpu.example.com" plus one attribute, then a Job with parallelism: 2 whose Pod template references it. Watch generated claims appear:

    kubectl get resourceclaims -w
    kubectl get pod <job-pod> -o jsonpath='{.status.resourceClaimStatuses}'

    The claim name is derived from the Pod name; STATE moves to allocated,reserved once the scheduler has written status.allocation and reservedFor.

  3. Inspect the allocation result.

    kubectl get resourceclaim <name> -o jsonpath='{.status.allocation.devices.results}' | jq
    kubectl exec <job-pod> -- env | grep -i gpu

    The example driver surfaces the device through environment variables set by its CDI spec, which is exactly how the runtime-injection step shows up from inside a container.

  4. Share one claim. Create a standalone ResourceClaim with allocationMode: All, then two Pods each referencing it by resourceClaimName. Both containers see the same devices; reservedFor lists both Pods. Delete one Pod and confirm the allocation remains; delete the second and watch status.allocation disappear while the claim object stays.

  5. Reproduce the nodeName trap. Create a Pod with spec.nodeName: <worker> and a template claim. It never leaves Pending with a kubelet message about unallocated claims. Replace nodeName with nodeSelector: {kubernetes.io/hostname: <worker>} and it schedules.

  6. Exhaust the pool. Scale the Job above its node’s device count. The extra Pods show a FailedScheduling event whose message names the claim that could not be allocated. Create a higher-priority Pod needing a device and confirm it does not preempt.

  7. Taint a device. Create a DeviceTaintRule with effect: None and deviceSelector.driver: gpu.example.com, read the dry-run message, then change the effect to NoExecute and watch Pods be deleted and the EvictionInProgress condition flip. Delete the rule to recover.

  8. Break RBAC on purpose. Create a ServiceAccount, grant it only update on resourceclaims/status, and try to patch status.devices with its token. The request is forbidden because the resourceclaims/driver synthetic subresource is missing; add associated-node:update or arbitrary-node:update and retry.

Delete the kind cluster when you are done.

Diagnosis table

SymptomWhere to lookLikely cause
error: the server doesn't have a resource type "deviceclasses"kube-apiserver --runtime-configresource.k8s.io API group disabled
kubectl get resourceslices is empty after installing a driverdriver DaemonSet logsdriver not registered with kubelet, or lacks RBAC to create ResourceSlices
Pod Pending, event FailedScheduling names a claimkubectl describe resourceclaimno device matches selectors on any eligible node, or all matching devices allocated
Pod Pending, no scheduler events at all, spec.nodeName setPod specscheduler bypassed; claims never allocated. Use nodeSelector
Pod Pending, claim does not existnamespaceresourceClaimName points at a claim that was never created or was deleted with its owning Pod
Claim STATE is allocated but Pod not reservedkube-controller-manager logsscheduler lacked resourceclaims/binding permission, or feature gate off on scheduler
Pod ContainerCreating with NodePrepareResources errorkubelet log, driver plugin logdriver rejected the claim’s config, or device vanished
Pod stuck Terminating after driver removalkubelet logNodeUnprepareResources cannot reach a plugin; reinstall the driver DaemonSet
adminAccess rejected at admissionnamespace labelsmissing resource.kubernetes.io/admin-access: "true"
All request fails although devices existother claimssome matching devices already allocated; All needs them all unless adminAccess
Replicas of one Deployment got different device typesstatus.allocation.devices.results[].requestfirstAvailable chooses per Pod
Pod evicted unexpectedly, device still healthy in vendor toolkubectl get devicetaintrulesan admin NoExecute rule matched the driver or pool
status.devices patch is Forbidden for the driverClusterRolemissing resourceclaims/driver with node-aware verb
Claim refuses deletionfinalizersresource.kubernetes.io/delete-protection while allocated and reserved
Extended-resource Pod Pending on a DRA nodeDeviceClassno class carries that extendedResourceName
Scheduler slow on large GPU poolsscheduler configconsider DRASchedulerFilterTimeout (alpha) or simpler CEL

Common mistakes

  • Putting the request in resources.limits. A DRA device is referenced from resources.claims, not resources.requests or limits, unless you are deliberately using the extended-resource bridge.
  • Forgetting the nested spec.spec in a ResourceClaimTemplate. The template wraps a claim spec; a flat spec is a validation error.
  • Editing a ResourceClaim to fix a selector. The spec is immutable. Delete, recreate, and recreate the Pods.
  • Expecting preemption. It does not exist for DRA resources in 1.37.
  • Setting nodeName to force placement. It skips allocation entirely.
  • Reading allocationMode: All as “all I need”. It means every matching device in the pool, and it fails if any are taken.
  • Assuming the scheduler writes status.devices. Drivers do, through a different synthetic subresource with node-aware verbs.
  • Hand-editing a ResourceSlice. The driver’s controller reverts it.
  • Granting adminAccess by RBAC alone. The namespace label is the gate, not a verb.
  • Treating beta features as absent. Partitionable devices, consumable capacity and binding conditions are on by default in 1.37; alpha ones such as derived attributes are not.

Where DRA sits in your CKA preparation

The CKA curriculum for 1.37 lists “Configure Pod admission and scheduling”, “Understand extension interfaces (CNI, CSI, CRI, etc.)” and “Troubleshoot clusters and nodes”. DRA is the scheduling extension interface for devices, and its failure modes (Pending Pods, missing claims, bypassed scheduler, forbidden status writes) are troubleshooting in the purest sense. You are unlikely to be asked to write a DeviceClass from memory; you are quite likely to be handed a cluster where something device-related is Pending and asked to make it run. Knowing that kubectl describe on the Job, then the Pod, then the ResourceClaim is the documented drill-down, and that nodeName plus DRA equals forever-Pending, is the difference.

Pair this with the two posts that cover the surrounding machinery: Node Allocatable, kube-reserved and the resource managers for how CPU and memory accounting works on the node, and in-place Pod resize for how standard requests change under a running Pod, something the alpha DRANodeAllocatableResources gate is starting to integrate with device footprints. For the exam itself, the CKA exam domains breakdown and the free CKA practice questions show how scheduling and troubleshooting tasks are actually phrased. When you want timed, scenario-based practice on a cluster that behaves like the real one, the CKA Certification Ready Mock Exam Bundle is built for exactly that; candidates working across the five Kubernetes certifications can use the KubeAstronaut bundle instead.

Frequently asked questions

Is DRA on the CKA exam?

The 1.37 exam environment serves the resource.k8s.io/v1 API because the feature is GA and locked on since 1.35. The curriculum does not name DRA explicitly; it falls under Pod scheduling, extension interfaces and troubleshooting. Expect awareness-level and troubleshooting-level exposure rather than authoring a driver.

Does DRA replace device plugins?

Not by force. Device plugins keep working, and the GA extended-resource bridge in 1.37 lets the same vendor.com/gpu extended resource be served by a device plugin on some nodes and by DRA on others. New driver development is expected to target DRA.

What is the difference between a ResourceClaim and a ResourceClaimTemplate?

A ResourceClaim is a concrete, manually managed object that Pods can share and that outlives any single Pod. A ResourceClaimTemplate makes Kubernetes generate one ResourceClaim per Pod, owned by that Pod and deleted with it. Use the template when every replica needs its own device.

How many Pods can share one ResourceClaim?

status.reservedFor holds at most 256 entries, so 256 Pods. The alpha-to-beta DRAWorkloadResourceClaims feature allows reserving for a PodGroup instead to exceed that, but it is off by default in 1.37.

Why is my Pod Pending even though the node has free GPUs?

Check in this order: the DeviceClass name in the claim exists; the CEL selectors match an attribute the devices actually publish (read a ResourceSlice); the devices are not tainted; the Pod does not set nodeName; and no All request is colliding with existing allocations. kubectl describe resourceclaim and the Pod’s FailedScheduling event will usually name the failing claim.

Can a higher-priority Pod preempt a Pod holding a GPU via DRA?

No. The scheduler does not implement preemption for DRA resources in 1.37. The high-priority Pod waits.

Which component writes status.allocation and which writes status.devices?

The kube-scheduler writes status.allocation and status.reservedFor through the resourceclaims/binding synthetic subresource. The DRA driver writes status.devices through resourceclaims/driver using associated-node:update or arbitrary-node:update verbs.

How do I taint a single broken GPU without a driver feature?

Create a DeviceTaintRule whose deviceSelector names the driver, the pool (usually the node name for node-local drivers) and the device, with effect: NoExecute. Test first with effect: None and read the dry-run message in the rule’s status.

What does adminAccess actually allow?

It lets a claim allocate devices that are already in use by other claims, typically combined with allocationMode: All for monitoring or maintenance Pods, and may give the container extra device privileges. It is permitted only in namespaces labelled resource.kubernetes.io/admin-access: "true" and it still has to tolerate device taints.

Which DRA features are beta-on versus alpha-off in Kubernetes 1.37?

On by default: partitionable devices, consumable capacity, device binding conditions, granular status authorization and device health in Pod status. Off by default: workload (PodGroup) claims, scheduler filter timeout, list-type attributes, node allocatable resources, resource pool status, derived attributes, optional node operations and device compatibility groups.

Limited Time Offer: Get 80% off all Mock Exam Bundles | Sale ends in 7 days. Start learning today.

Claim Now