Skip to content

Commit daec5a5

Browse files
committed
[KEP-5075] DRAConsumableCapacity documentation
Signed-off-by: Sunyanan Choochotkaew <sunyanan.choochotkaew1@ibm.com>
1 parent 5c1c6a3 commit daec5a5

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

content/en/docs/concepts/scheduling-eviction/dynamic-resource-allocation.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,89 @@ Partitionable devices is an *alpha feature* and only enabled when the
530530
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
531531
is enabled in the kube-apiserver and kube-scheduler.
532532

533+
## Consumable capacity
534+
535+
{{< feature-state feature_gate_name="DRAConsumableCapacity" >}}
536+
537+
Device driver can set `allowMultipleAllocations` field added in `.spec.devices` of `ResourceSlice` to allow allocating that device to multiple independent ResourceClaims or to multiple requests within a ResourceClaim.
538+
539+
Users can set `capacity` field added in `spec.devices.requests` of `ResourceClaim` to specify the device resource requirements for each allocation.
540+
541+
For the device that allows multiple allocations, the requested capacity is drawn from—or consumed from—its total capacity, a concept known as **consumable capacity**.
542+
Then, the scheduler ensures that the aggregate consumed capacity across all claims does not exceed the device’s overall capacity and complies with any configured `requestPolicy` constraints in `.spec.devices[*].capacity`, if specified.
543+
544+
Here is an example of a network device which allows multiple allocations and contains
545+
a consumable bandwidth capacity.
546+
547+
```yaml
548+
kind: ResourceSlice
549+
apiVersion: resource.k8s.io/v1beta2
550+
metadata:
551+
name: resourceslice
552+
spec:
553+
nodeName: worker-1
554+
pool:
555+
name: pool
556+
generation: 1
557+
resourceSliceCount: 1
558+
driver: dra.example.com
559+
devices:
560+
- name: eth1
561+
allowMultipleAllocations: true
562+
attributes:
563+
name:
564+
string: "eth1"
565+
capacity:
566+
bandwidth:
567+
requestPolicy:
568+
default: "1M"
569+
validRange:
570+
min: "1M"
571+
step: "8"
572+
value: "10G"
573+
```
574+
575+
The property of `allowMultipleAllocations` can be used in CEL
576+
and the consumable capacity can be requested as shown in the below example.
577+
578+
```yaml
579+
apiVersion: resource.k8s.io/v1beta2
580+
kind: ResourceClaimTemplate
581+
metadata:
582+
name: bandwidth-claim-template
583+
spec:
584+
spec:
585+
devices:
586+
requests:
587+
- name: req-0
588+
exactly:
589+
- name:
590+
deviceClassName: resource.example.com
591+
selectors:
592+
- cel:
593+
expression: |-
594+
device.allowMultipleAllocations == true
595+
capacity:
596+
requests:
597+
bandwidth: 1G
598+
```
599+
600+
The allocation result will include the consumed capacity and the identifier of the share.
601+
602+
```yaml
603+
apiVersion: resource.k8s.io/v1beta2
604+
kind: ResourceClaim
605+
...
606+
status:
607+
allocation:
608+
devices:
609+
results:
610+
- consumedCapacity:
611+
bandwidth: 1G
612+
device: eth1
613+
shareID: "a671734a-e8e5-11e4-8fde-42010af09327"
614+
```
615+
533616
### Device taints and tolerations {#device-taints-and-tolerations}
534617

535618
{{< feature-state feature_gate_name="DRADeviceTaints" >}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: DRAConsumableCapacity
3+
content_type: feature_gate
4+
_build:
5+
list: never
6+
render: false
7+
8+
stages:
9+
- stage: alpha
10+
defaultValue: false
11+
fromVersion: "1.34"
12+
---
13+
Enables device sharing across multiple ResourceClaims or requests.
14+
15+
Additionally, if a device supports sharing, its resource (capacity) can be managed through a defined sharing policy.

0 commit comments

Comments
 (0)