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
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
+
533
616
### Device taints and tolerations {#device-taints-and-tolerations}
0 commit comments