You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Devices managed by DRA can have an underlying footprint composed of node allocatable resources, such as `cpu`, `memory`, `hugepages` or `ephemeral-storage`. This feature integrates these DRA based requests into the scheduler's standard accounting alongside regular Pod `spec` requests for these resources.
1050
+
1051
+
DRA drivers declare this node allocatable footprint using the `nodeAllocatableResourceMappings` field on devices within a `ResourceSlice`. This mapping translates the requested DRA device or capacity into standard resources tracked in the Node's `status.allocatable` (note that extended resources are not included here). This is useful both for drivers that directly expose native resources (like a CPU or Memory DRA driver) and for devices that require auxiliary node dependencies (like an accelerator that needs host memory).
1052
+
1053
+
This mapping defines the translation of the requested DRA device or capacity units to the corresponding quantity of the node-allocatable resource. The scheduler calculates the exact quantity using an `allocationMultiplier`, which defaults to 1 if omitted:
1054
+
* **Device-based scaling:** If `capacityKey` is NOT set, the `allocationMultiplier` multiplies the device count allocated to the claim.
1055
+
* **Capacity-based scaling:** If `capacityKey` IS set, it references a capacity name defined in the device's `capacity` map. The scheduler looks up the amount of that capacity consumed by the claim, and multiplies it by the `allocationMultiplier`.
1056
+
1057
+
#### Example: CPU DRA Driver (Capacity-based scaling)
1058
+
1059
+
Here is an example where a CPU DRA driver exposes a CPU socket as a pool of 128 CPUs using DRA consumable capacity. The `capacityKey` links the consumed `cpu.example.com/cpu` capacity directly to the node's standard `cpu` allocatable resource:
1060
+
1061
+
```yaml
1062
+
apiVersion: resource.k8s.io/v1
1063
+
kind: ResourceSlice
1064
+
metadata:
1065
+
name: my-node-cpus
1066
+
spec:
1067
+
driver: cpu.example.com
1068
+
nodeName: my-node
1069
+
pool:
1070
+
name: socket-cpus
1071
+
generation: 1
1072
+
resourceSliceCount: 1
1073
+
devices:
1074
+
- name: socket0cpus
1075
+
allowMultipleAllocations: true
1076
+
capacity:
1077
+
"cpu.example.com/cpu": "128"
1078
+
nodeAllocatableResourceMappings:
1079
+
cpu:
1080
+
capacityKey: "cpu.example.com/cpu"
1081
+
# allocationMultiplier defaults to 1 if omitted
1082
+
- name: socket1cpus
1083
+
allowMultipleAllocations: true
1084
+
capacity:
1085
+
"cpu.example.com/cpu": "128"
1086
+
nodeAllocatableResourceMappings:
1087
+
cpu:
1088
+
capacityKey: "cpu.example.com/cpu"
1089
+
# allocationMultiplier defaults to 1 if omitted
1090
+
```
1091
+
#### Example: Accelerator with Auxiliary Resources (Device-based scaling)
1092
+
1093
+
Here is an example of a resource slice where an accelerator requires an additional 8Gi of memory per device instance to function:
1094
+
1095
+
```yaml
1096
+
apiVersion: resource.k8s.io/v1
1097
+
kind: ResourceSlice
1098
+
metadata:
1099
+
name: my-node-xpus
1100
+
spec:
1101
+
driver: xpu.example.com
1102
+
nodeName: my-node
1103
+
pool:
1104
+
name: xpu-pool
1105
+
generation: 1
1106
+
resourceSliceCount: 1
1107
+
devices:
1108
+
- name: xpu-model-x-001
1109
+
attributes:
1110
+
example.com/model:
1111
+
string: "model-x"
1112
+
nodeAllocatableResourceMappings:
1113
+
memory:
1114
+
allocationMultiplier: "8Gi"
1115
+
```
1116
+
1117
+
After a Pod is successfully scheduled, the control plane records the exact quantities of node allocatable resources allocated via DRA in the Pod's `status.nodeAllocatableResourceClaimStatuses` field.
1118
+
1119
+
Node allocatable resources is an alpha feature and is enabled when the `DRANodeAllocatableResources` feature gate is enabled in the kube-apiserver, kube-scheduler, and kubelet. In the Alpha phase, the kubelet does not account for these resources when determining QoS classes, configuring cgroups, or making eviction decisions.
1120
+
1045
1121
## {{% heading "whatsnext" %}}
1046
1122
1047
1123
- [Set Up DRA in a Cluster](/docs/tasks/configure-pod-container/assign-resources/set-up-dra-cluster/)
Enables the kube-scheduler to incorporate Node Allocatable resources (such as CPU, memory, and hugepages) managed by Dynamic Resource Allocation (DRA) into its standard node resource accounting.
14
+
15
+
When enabled, DRA drivers can use the `nodeAllocatableResourceMappings` field on `ResourceSlice` devices to specify how their devices consume node allocatable resources. This allows the scheduler to combine these DRA allocations with standard Pod requests.
16
+
It also exposes the `status.nodeAllocatableResourceClaimStatuses` field on the Pod API to track the resulting resource allocations.
0 commit comments