@@ -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/)
531531is 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" >}}
0 commit comments