Custom Opaque CPUSet Allocation Overrides
groupBy: machine mode.Migrate from individual mode
To keep scheduler-controlled selection of exact CPUs that the deprecated Individual mode enabled,
use grouped mode with the external allocator.
Note that also NUMA-node or Socket grouping supports external allocator like the Machine grouping.
All grouping modes publish the external-allocator attributes, but the NUMA-node or Socket grouping
also retain a useful topology boundary:
driverConfig:
cpuDeviceMode: grouped
groupBy: numanode # or socket
allocator: external
The external allocator reads the selected grouped device’s
external-allocator attributes, selects
CPUs from that group, and writes the cpuset in the opaque configuration described below. The
driver validates and enforces the selection. groupBy: machine is also supported, but is less
preferred because it removes that topology boundary; use it only when the allocator must select
from the entire node.
Audience: scheduler-plugin authors and platform integrators, not workload authors. This
page documents an integration contract for external schedulers; no in-tree scheduler
implements it today. Regular workloads should use the default numanode/socket grouping
instead.
When using the external allocator with grouped mode (numanode, socket, or machine), the
DRA driver does not perform automatic topology-aware CPU allocation. Instead, an explicit core
assignment must be provided via the cpuset field in the claim’s opaque configuration
parameters. With numanode or socket, the cpuset must belong to the group selected for the
request.
The Kubelet driver parses this configuration at prepare time from the claim’s allocation status (status.allocation.devices.config). The control plane (typically scheduling plugin) is responsible for injecting this configuration block into the allocation result when binding the claim.
Opaque Parameters Schema (v1alpha1)
The opaque.parameters field must conform to the following schema:
| Field | Type | Description |
|---|---|---|
apiVersion | string | Must be set to v1alpha1. |
cpuConfig | object | Container object for CPU configurations. |
cpuConfig.cpuset | string | Specifies the list of CPU cores in standard Linux cpuset format (e.g. "2-5", "0,4-6"). |
Example of a Fully Allocated ResourceClaim with Opaque Configuration
apiVersion: resource.k8s.io/v1
kind: ResourceClaim
metadata:
name: exclusive-cores-claim
namespace: default
uid: claim-uid-123456
spec:
devices:
requests:
- name: cpu-request-1
exactly:
deviceClassName: dra.cpu
capacity:
requests:
dra.cpu/cpu: "4"
status:
allocation:
devices:
results:
- request: cpu-request-1
driver: dra.cpu
pool: test-node
device: cpudevnuma000
consumedCapacity:
dra.cpu/cpu: "4"
config: # Added by external scheduler
- source: FromClaim
requests:
- cpu-request-1
opaque:
driver: dra.cpu
parameters:
apiVersion: v1alpha1
cpuConfig:
cpuset: "2-5"
The driver allocates the specified cores directly (after validating that they are allocatable and not reserved). If it is omitted, resource preparation will fail and pod startup will be rejected.
Validation Rules:
- The
cpusetvalue must be specified in standard Linux cpuset format representing ranges and/or individual cores (e.g."2-5","1-10,15"). - Per-Request Configurations Only: In
status.allocation.devices.config[], every configuration block’srequestsarray must map to exactly one request in the claim. We do not support multiple claim requests mapping to the same cpuset config. - ResourceClaim Source: Opaque configurations must originate from the
ResourceClaim. Configurations defined in DeviceClass (spec.config[]) are not supported and will result in a validation error. Since a configuration in theDeviceClassapplies to all claims referencing it, configuring acpusetthere would assign the same CPUs to multiple claims, failing allocation due to conflict between claims. - CPUSet Validation: The driver verifies that the custom cpuset is valid for the host machine and is currently allocatable. It checks that:
- The cores are part of the node’s online CPUs.
- The cores are not reserved using the driver’s
--reserved-cpusconfiguration flag.
- Error Handling: If validation fails (e.g. core conflict, size mismatch, duplicate target, or offline cores), the driver returns a failure immediately in Kubelet’s
PrepareResourceClaimshook, causing pod startup to fail.