Skip to content

Commit 650121e

Browse files
committed
[KEP-5004] DRA Extended resource documentation
1 parent bfcdaac commit 650121e

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed

content/en/docs/concepts/configuration/manage-resources-containers.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,12 @@ extender.
718718
}
719719
```
720720

721+
#### Extended resources allocation by DRA
722+
Extended resources allocation by DRA allows cluster administrators to specify an `extendedResourceName`
723+
in `DeviceClass`, then the devices matching the `DeviceClass` can be requested from a pod's extended
724+
resource requests. Read more about
725+
[Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource).
726+
721727
### Consuming extended resources
722728

723729
Users can consume extended resources in Pod specs like CPU and memory.
@@ -934,3 +940,4 @@ memory limit (and possibly request) for that container.
934940
* Read about [project quotas](https://www.linux.org/docs/man8/xfs_quota.html) in XFS
935941
* Read more about the [kube-scheduler configuration reference (v1)](/docs/reference/config-api/kube-scheduler-config.v1/)
936942
* Read more about [Quality of Service classes for Pods](/docs/concepts/workloads/pods/pod-qos/)
943+
* Read more about [Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource)

content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,4 @@ Here are some examples of device plugin implementations:
509509
* Learn about the [Topology Manager](/docs/tasks/administer-cluster/topology-manager/)
510510
* Read about using [hardware acceleration for TLS ingress](/blog/2019/04/24/hardware-accelerated-ssl/tls-termination-in-ingress-controllers-using-kubernetes-device-plugins-and-runtimeclass/)
511511
with Kubernetes
512+
* Read more about [Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource)

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,46 @@ create ResourceClaim or ResourceClaimTemplate objects in namespaces labeled with
424424
`adminAccess` field. This ensures that non-admin users cannot misuse the
425425
feature.
426426

427+
### Extended resource allocation by DRA {#extended-resource}
428+
429+
{{< feature-state feature_gate_name="DRAExtendedResource" >}}
430+
431+
You can provide an extended resource name for a DeviceClass. The scheduler will then
432+
select the devices matching the class for the extended resource requests. This allows
433+
users to continue using extended resource requests in a pod to request either
434+
extended resources provided by device plugin, or DRA devices. The same extended
435+
resource can be provided either by device plugin, or DRA on one single cluster node.
436+
The same extended resource can be provided by device plugin on some nodes, and
437+
DRA on other nodes in the same cluster.
438+
439+
In the example below, the DeviceClass is given an extendedResourceName `example.com/gpu`.
440+
If a pod requested for the extended resource `example.com/gpu: 2`, it can be scheduled to
441+
a node with two or more devices matching the DeviceClass.
442+
443+
```yaml
444+
apiVersion: resource.k8s.io/v1
445+
kind: DeviceClass
446+
metadata:
447+
name: gpu.example.com
448+
spec:
449+
selectors:
450+
- cel:
451+
expression: device.driver == 'gpu.example.com' && device.attributes['gpu.example.com'].type
452+
== 'gpu'
453+
extendedResourceName: example.com/gpu
454+
```
455+
456+
In addition, users can use a special extended resource to allocate devices without
457+
having to explicitly create a ResourceClaim. Using the extended resource name
458+
prefix `deviceclass.resource.kubernetes.io/` and the DeviceClass name. This works
459+
for any DeviceClass, even if it does not specify the an extended resource name.
460+
The resulting ResourceClaim will contain a request for an `ExactCount` of the
461+
specified number of devices of that DeviceClass.
462+
463+
Extended resource allocation by DRA is an *alpha feature* and only enabled when the
464+
`DRAExtendedResource` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
465+
is enabled in the kube-apiserver, kube-scheduler, and kubelet.
466+
427467
### Prioritized list {#prioritized-list}
428468

429469
{{< feature-state feature_gate_name="DRAPrioritizedList" >}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: DRAExtendedResource
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 support for the [Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource) feature. It makes it possible to specify an extended resource name in a DeviceClass.
14+
15+
This feature gate has no effect unless you also enable the `DynamicResourceAllocation` feature gate.

content/en/docs/tasks/administer-cluster/extended-resource-node.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,10 @@ kubectl describe node <your-node-name> | grep dongle
188188
### For application developers
189189

190190
- [Assign Extended Resources to a Container](/docs/tasks/configure-pod-container/extended-resource/)
191+
- [Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource)
191192

192193
### For cluster administrators
193194

194195
- [Configure Minimum and Maximum Memory Constraints for a Namespace](/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace/)
195196
- [Configure Minimum and Maximum CPU Constraints for a Namespace](/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/)
197+
- [Extended Resource allocation by DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/#extended-resource)

0 commit comments

Comments
 (0)