Skip to content

Commit 5e59533

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

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

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

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,90 @@ 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+
A device with the property `allowMultipleAllocations` can be allocated or shared
538+
among multiple independent ResourceClaim's requests.
539+
540+
For a device sharing purpose, consumable capacity refers to the device capacity that,
541+
the driver can manage and dynamically allocate a portion of it to a Pod,
542+
based on the amount requested in a ResourceClaim and its `requestPolicy`.
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+
basic:
562+
allowMultipleAllocations: true
563+
attributes:
564+
name:
565+
string: "eth1"
566+
capacity:
567+
bandwidth:
568+
requestPolicy:
569+
default: "1M"
570+
validRange:
571+
min: "1M"
572+
step: "8"
573+
value: "10G"
574+
```
575+
576+
The property of `allowMultipleAllocations` can be used in CEL
577+
and the consumable capacity can be requested as shown in the below example.
578+
579+
```yaml
580+
apiVersion: resource.k8s.io/v1beta2
581+
kind: ResourceClaimTemplate
582+
metadata:
583+
name: bandwidth-claim-template
584+
spec:
585+
spec:
586+
devices:
587+
requests:
588+
- name: req-0
589+
exactly:
590+
- name:
591+
deviceClassName: resource.example.com
592+
selectors:
593+
- cel:
594+
expression: |-
595+
device.allowMultipleAllocations == true
596+
capacity:
597+
requests:
598+
bandwidth: 1G
599+
```
600+
601+
The allocation result will include the consumed capacity and the identifier of the share.
602+
603+
```yaml
604+
apiVersion: resource.k8s.io/v1beta2
605+
kind: ResourceClaim
606+
...
607+
status:
608+
allocation:
609+
devices:
610+
results:
611+
- consumedCapacity:
612+
bandwidth: 1G
613+
device: eth1
614+
shareID: "a671734a-e8e5-11e4-8fde-42010af09327"
615+
```
616+
533617
### Device taints and tolerations {#device-taints-and-tolerations}
534618

535619
{{< 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)