⎈ k8s knowledge compiler

Dynamic Resource Allocation [page]deterministic

concepts

This page describes _dynamic resource allocation (DRA)_ in Kubernetes.

## About DRA {#about-dra}

[definition:dra]

Allocating resources with DRA is a similar experience to [dynamic volume provisioning](/docs/concepts/storage/dynamic-provisioning/), in which you use PersistentVolumeClaims to claim storage capacity from storage classes and request the claimed capacity in your Pods.

### Benefits of DRA {#dra-benefits}

DRA provides a flexible way to categorize, request, and use devices in your cluster. Using DRA provides benefits like the following:

* Flexible device filtering: use common expression language (CEL) to perform fine-grained filtering for specific device attributes. * Device sharing: share the same resource with multiple containers or Pods by referencing the corresponding resource claim. * Centralized device categorization: device drivers and cluster admins can use device classes to provide app operators with hardware categories that are optimized for various use cases. For example, you can create a cost-optimized device class for general-purpose workloads, and a high-performance device class for critical jobs. * Simplified Pod requests: with DRA, app operators don't need to specify device quantities in Pod resource requests. Instead, the Pod references a resource claim, and the device configuration in that claim applies to the Pod.

These benefits provide significant improvements in the device allocation workflow when compared to [device plugins](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/), which require per-container device requests, don't support device sharing, and don't support expression-based device filtering.

### Types of DRA users {#dra-user-types}

The workflow of using DRA to allocate devices involves the following types of users:

* Device owner: responsible for devices. Device owners might be commercial vendors, the cluster operator, or another entity. To use DRA, devices must have DRA-compatible drivers that do the following:

* Create ResourceSlices that provide Kubernetes with information about nodes and resources. * Update ResourceSlices when resource capacity in the cluster changes. * Optionally, create DeviceClasses that workload operators can use to claim devices.

* Cluster admin: responsible for configuring clusters and nodes, attaching devices, installing drivers, and similar tasks. To use DRA, cluster admins do the following:

* Attach devices to nodes. * Install device drivers that support DRA. * Optionally, create DeviceClasses that workload operators can use to claim devices.

* Workload operator: responsible for deploying and managing workloads in the cluster. To use DRA to allocate devices to Pods, workload operators do the following:

* Create ResourceClaims or ResourceClaimTemplates to request specific configurations within DeviceClasses. * Deploy workloads that use specific ResourceClaims or ResourceClaimTemplates.

## DRA terminology {#terminology}

DRA uses the following Kubernetes API kinds to provide the core allocation functionality. All of these API kinds are included in the `resource.k8s.io/v1` [API group](#gloss:api-group).

DeviceClass : Defines a category of devices that can be claimed and how to select specific device attributes in claims. The DeviceClass parameters can match zero or more devices in ResourceSlices. To claim devices from a DeviceClass, ResourceClaims select specific device attributes.

ResourceClaim : Describes a request for access to attached resources, such as devices, in the cluster. ResourceClaims provide Pods with access to a specific resource. ResourceClaims can be created by workload operators or generated by Kubernetes based on a ResourceClaimTemplate.

ResourceClaimTemplate : Defines a template that Kubernetes uses to create per-Pod ResourceClaims for a workload. ResourceClaimTemplates provide Pods with access to sepa …(trimmed)

Sources

concepts/scheduling-eviction/dynamic-resource-allocation.md · docDynamic Resource Allocation

Related (25)

references API GroupAPI group conf=1
references PodGroupPodGroups conf=1
references Common Expression LanguageCommon Expression Language (CEL) conf=1
references Devicedevices conf=1
references Controllercontroller conf=1
references Container Device Interface (CDI)CDI conf=1
part_of About DRA {#about-dra}describes conf=1
part_of DRA terminology {#terminology}describes conf=1
part_of Pre-scheduled Podsdescribes conf=1
part_of Limitationsdescribes conf=1
part_of DRA beta features {#beta-features}describes conf=1
part_of DRA alpha features {#alpha-features}describes conf=1
part_of {{% heading "whatsnext" %}}describes conf=1
part_of Benefits of DRA {#dra-benefits}describes conf=1
part_of Types of DRA users {#dra-user-types}describes conf=1
part_of DeviceClass {#deviceclass}describes conf=1
part_of ResourceSlice {#resourceslice}describes conf=1
part_of Workflow for users {#user-workflow}describes conf=1

← all Docs