Skip to content

Commit f6c3312

Browse files
authored
Merge pull request #51710 from yliaog/main
[KEP-5004] DRA Extended resource documentation
2 parents df2a445 + f453b00 commit f6c3312

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-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
@@ -721,6 +721,12 @@ extender.
721721
}
722722
```
723723

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

726732
Users can consume extended resources in Pod specs like CPU and memory.
@@ -937,3 +943,4 @@ memory limit (and possibly request) for that container.
937943
* Read about [project quotas](https://www.linux.org/docs/man8/xfs_quota.html) in XFS
938944
* Read more about the [kube-scheduler configuration reference (v1)](/docs/reference/config-api/kube-scheduler-config.v1/)
939945
* Read more about [Quality of Service classes for Pods](/docs/concepts/workloads/pods/pod-qos/)
946+
* 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
@@ -444,6 +444,46 @@ enabling the DynamicResourceAllocation feature gate and the DRA
444444
information, see
445445
[Set up DRA in the cluster](/docs/tasks/configure-pod-container/assign-resources/set-up-dra-cluster/).
446446
447+
### Extended resource allocation by DRA {#extended-resource}
448+
449+
{{< feature-state feature_gate_name="DRAExtendedResource" >}}
450+
451+
You can provide an extended resource name for a DeviceClass. The scheduler will then
452+
select the devices matching the class for the extended resource requests. This allows
453+
users to continue using extended resource requests in a pod to request either
454+
extended resources provided by device plugin, or DRA devices. The same extended
455+
resource can be provided either by device plugin, or DRA on one single cluster node.
456+
The same extended resource can be provided by device plugin on some nodes, and
457+
DRA on other nodes in the same cluster.
458+
459+
In the example below, the DeviceClass is given an extendedResourceName `example.com/gpu`.
460+
If a pod requested for the extended resource `example.com/gpu: 2`, it can be scheduled to
461+
a node with two or more devices matching the DeviceClass.
462+
463+
```yaml
464+
apiVersion: resource.k8s.io/v1
465+
kind: DeviceClass
466+
metadata:
467+
name: gpu.example.com
468+
spec:
469+
selectors:
470+
- cel:
471+
expression: device.driver == 'gpu.example.com' && device.attributes['gpu.example.com'].type
472+
== 'gpu'
473+
extendedResourceName: example.com/gpu
474+
```
475+
476+
In addition, users can use a special extended resource to allocate devices without
477+
having to explicitly create a ResourceClaim. Using the extended resource name
478+
prefix `deviceclass.resource.kubernetes.io/` and the DeviceClass name. This works
479+
for any DeviceClass, even if it does not specify the an extended resource name.
480+
The resulting ResourceClaim will contain a request for an `ExactCount` of the
481+
specified number of devices of that DeviceClass.
482+
483+
Extended resource allocation by DRA is an *alpha feature* and only enabled when the
484+
`DRAExtendedResource` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
485+
is enabled in the kube-apiserver, kube-scheduler, and kubelet.
486+
447487
### Prioritized list {#prioritized-list}
448488

449489
{{< feature-state feature_gate_name="DRAPrioritizedList" >}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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/configuration/manage-resources-containers/#extended-resources-allocation-by-dra) feature.
14+
It makes it possible to specify an extended resource name in a DeviceClass.
15+
16+
This feature gate has no effect unless the `DynamicResourceAllocation` feature gate is enabled.

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)