Install Drivers and Allocate Devices with DRA [page]deterministic
This tutorial shows you how to install [Dynamic Resource Allocation (DRA)](#gloss:dra) drivers in your cluster and how to use them in conjunction with the DRA APIs to allocate [devices](#gloss:device) to Pods. This page is intended for cluster administrators.
[Dynamic Resource Allocation (DRA)](#gloss:dra) lets a cluster manage availability and allocation of hardware resources to satisfy Pod-based claims for hardware requirements and preferences. To support this, a mixture of Kubernetes built-in components (like the Kubernetes scheduler, kubelet, and kube-controller-manager) and third-party drivers from device owners (called DRA drivers) share the responsibility to advertise, allocate, prepare, mount, healthcheck, unprepare, and cleanup resources throughout the Pod lifecycle. These components share information via a series of DRA specific APIs in the `resource.k8s.io` API group including [DeviceClasses](#gloss:deviceclass), [ResourceSlices](#gloss:resourceslice), [ResourceClaims](#gloss:resourceclaim), as well as new fields in the Pod spec itself.
### * Deploy an example DRA driver * Deploy a Pod requesting a hardware claim using DRA APIs * Delete a Pod that has a claim
##
Your cluster should support [RBAC](/docs/reference/access-authn-authz/rbac/). You can try this tutorial with a cluster using a different authorization mechanism, but in that case you will have to adapt the steps around defining roles and permissions.
This tutorial has been tested with Linux nodes, though it may also work with other types of nodes.
If your cluster is not currently running Kubernetes then please check the documentation for the version of Kubernetes that you plan to use.
## Explore the initial cluster state {#explore-initial-state}
You can spend some time to observe the initial state of a cluster with DRA enabled, especially if you have not used these APIs extensively before. If you set up a new cluster for this tutorial, with no driver installed and no Pod claims yet to satisfy, the output of these commands won't show any resources.
1. Get a list of [DeviceClasses](#gloss:deviceclass):
```shell kubectl get deviceclasses ``` The output is similar to this: ``` No resources found ```
1. Get a list of [ResourceSlices](#gloss:resourceslice):
```shell kubectl get resourceslices ``` The output is similar to this: ``` No resources found ```
1. Get a list of [ResourceClaims](#gloss:resourceclaim) and [ResourceClaimTemplates](#gloss:resourceclaimtemplate)
```shell kubectl get resourceclaims -A kubectl get resourceclaimtemplates -A ``` The output is similar to this: ``` No resources found No resources found ```
At this point, you have confirmed that DRA is enabled and configured properly in the cluster, and that no DRA drivers have advertised any resources to the DRA APIs yet.
## Install an example DRA driver {#install-example-driver}
DRA drivers are third-party applications that run on each node of your cluster to interface with the hardware of that node and Kubernetes' built-in DRA components. The installation procedure depends on the driver you choose, but is likely deployed as a [daemonset](#gloss:daemonset) to all or a selection of the nodes (using [selectors](#gloss:selector) or similar mechanisms) in your cluster.
Check your driver's documentation for specific installation instructions, which might include a Helm chart, a set of manifests, or other deployment tooling.
This tutorial uses an example driver which can be found in the [kubernetes-sigs/dra-example-driver](https://github.com/kubernetes-sigs/dra-example-driver) repository to demonstrate driver installation. This example driver advertises simulated GPUs to Kubernetes for your Pods to interact with.
### Prepare your cluster for driver installation {#prepare-cluster-driver}
To simplify cleanup, create a namespace named dra-tutorial:
1. Create the namesp …(trimmed)