Skip to content

Commit 574bf6f

Browse files
authored
Document DRA prioritized list(s) (#49869)
* Add placeholder for DRA Prioritized List * First draft of documentation of the Prioritized List feature * Addressed feedback
1 parent 3e00afa commit 574bf6f

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

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

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,50 @@ When the feature is disabled, that field automatically gets cleared when storing
260260
A ResourceClaim device status is supported when it is possible, from a DRA driver, to update an
261261
existing ResourceClaim where the `status.devices` field is set.
262262

263+
## Prioritized List
264+
265+
{{< feature-state feature_gate_name="DRAPrioritizedList" >}}
266+
267+
You can provide a prioritized list of subrequests for requests in a ResourceClaim. The
268+
scheduler will then select the first subrequest that can be allocated. This allows users to
269+
specify alternative devices that can be used by the workload if the primary choice is not
270+
available.
271+
272+
In the example below, the ResourceClaimTemplate requested a device with the color black
273+
and the size large. If a device with those attributes are not available, the pod can not
274+
be scheduled. With the priotized list feature, a second alternative can be specified, which
275+
requests two devices with the color white and size small. The large black device will be
276+
allocated if it is available. But if it is not and two small white devices are available,
277+
the pod will still be able to run.
278+
279+
```yaml
280+
apiVersion: resource.k8s.io/v1beta1
281+
kind: ResourceClaimTemplate
282+
metadata:
283+
name: prioritized-list-claim-template
284+
spec:
285+
spec:
286+
devices:
287+
requests:
288+
- name: req-0
289+
firstAvailable:
290+
- name: large-black
291+
deviceClassName: resource.example.com
292+
selectors:
293+
- cel:
294+
expression: |-
295+
device.attributes["resource-driver.example.com"].color == "black" &&
296+
device.attributes["resource-driver.example.com"].size == "large"
297+
- name: small-white
298+
deviceClassName: resource.example.com
299+
selectors:
300+
- cel:
301+
expression: |-
302+
device.attributes["resource-driver.example.com"].color == "white" &&
303+
device.attributes["resource-driver.example.com"].size == "small"
304+
count: 2
305+
```
306+
263307
## Enabling dynamic resource allocation
264308

265309
Dynamic resource allocation is a *beta feature* which is off by default and only enabled when the
@@ -314,6 +358,14 @@ and only enabled when the `DRAResourceClaimDeviceStatus`
314358
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
315359
is enabled in the kube-apiserver.
316360

361+
### Enabling Prioritized List
362+
363+
[Prioritized List](#prioritized-list)) is an *alpha feature* and only enabled when the
364+
`DRAPrioritizedList` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
365+
is enabled in the kube-apiserver and kube-scheduler. It also requires that the
366+
`DynamicResourceAllocation` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
367+
is enabled.
368+
317369
## {{% heading "whatsnext" %}}
318370

319371
- For more information on the design, see the
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: DRAPrioritizedList
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.33"
12+
---
13+
Enables support for the [Prioritized List](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#prioritized-list)
14+
feature. It makes it possible to specify a prioritized list of subrequests for requests in a ResourceClaim.
15+
16+
This feature gate has no effect unless you also enable the `DynamicResourceAllocation` feature gate.

0 commit comments

Comments
 (0)