Skip to content

Commit 38c660a

Browse files
committed
[KEP-5075] DRAConsumableCapacity documentation
Signed-off-by: Sunyanan Choochotkaew <[email protected]>
1 parent 48f8ce3 commit 38c660a

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

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

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,90 @@ spec:
374374
value: 6Gi
375375
```
376376

377+
## Consumable capacity
378+
379+
{{< feature-state feature_gate_name="DRAConsumableCapacity" >}}
380+
381+
A device with the property `allowMultipleAllocations` can be allocated or shared
382+
among multiple independent ResourceClaim's requests.
383+
384+
For a device sharing purpose, consumable capacity refers to the device capacity that,
385+
the driver can manage and dynamically allocate a portion of it to a Pod,
386+
based on the amount requested in a ResourceClaim and its `sharingPolicy`.
387+
388+
Here is an example of a network device which allows multiple allocations and contains
389+
a consumable bandwidth capacity.
390+
391+
```yaml
392+
kind: ResourceSlice
393+
apiVersion: resource.k8s.io/v1beta2
394+
metadata:
395+
name: resourceslice
396+
spec:
397+
nodeName: worker-1
398+
pool:
399+
name: pool
400+
generation: 1
401+
resourceSliceCount: 1
402+
driver: dra.example.com
403+
devices:
404+
- name: eth1
405+
basic:
406+
allowMultipleAllocations: true
407+
attributes:
408+
name:
409+
string: "eth1"
410+
capacity:
411+
bandwidth:
412+
sharingPolicy:
413+
default: "1M"
414+
validRange:
415+
minimum: "1M"
416+
chunkSize: "8"
417+
value: "10G"
418+
```
419+
420+
The property of `allowMultipleAllocations` can be used in CEL
421+
and the consumable capacity can be requested as shown in the below example.
422+
423+
```yaml
424+
apiVersion: resource.k8s.io/v1beta2
425+
kind: ResourceClaimTemplate
426+
metadata:
427+
name: bandwidth-claim-template
428+
spec:
429+
spec:
430+
devices:
431+
requests:
432+
- name: req-0
433+
exactly:
434+
- name:
435+
deviceClassName: resource.example.com
436+
selectors:
437+
- cel:
438+
expression: |-
439+
device.allowMultipleAllocations == true
440+
capacityRequests:
441+
minimum:
442+
bandwidth: 1G
443+
```
444+
445+
The allocation result will include the consumed capacity and the identifier of the share.
446+
447+
```yaml
448+
apiVersion: resource.k8s.io/v1beta2
449+
kind: ResourceClaim
450+
...
451+
status:
452+
allocation:
453+
devices:
454+
results:
455+
- consumedCapacities:
456+
bandwidth: 1G
457+
device: eth1
458+
shareID: 0d274f
459+
```
460+
377461
## Device taints and tolerations
378462

379463
{{< feature-state feature_gate_name="DRADeviceTaints" >}}
@@ -532,6 +616,13 @@ and only enabled when the `DRAPartitionableDevices`
532616
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
533617
is enabled in the kube-apiserver and kube-scheduler.
534618

619+
### Enabling consumable capacity
620+
621+
[Consumable Capacity](#consumable-capacity) is an *alpha feature*
622+
and only enabled when the `DRAConsumableCapacity`
623+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
624+
is enabled in the kubelet, kube-apiserver and kube-scheduler.
625+
535626
### Enabling device taints and tolerations
536627

537628
[Device taints and tolerations](#device-taints-and-tolerations) is an *alpha feature* and only enabled when the
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)