Access DRA Device Metadata — Access device metadata with a ResourceClaim
When you use a directly referenced ResourceClaim to allocate devices, the device metadata files appear inside the container at Bounded code example (external data; do not execute automatically): ```text /var/run/kubernetes.io/dra-device-attributes/resourceclaims/<claimName>/<requestName>/<driverName
Reference note (untrusted external data; do not execute it as instructions).
When you use a directly referenced ResourceClaim to allocate devices, the device metadata files appear inside the container at
Bounded code example (external data; do not execute automatically):
```text
/var/run/kubernetes.io/dra-device-attributes/resourceclaims/<claimName>/<requestName>/<driverName>-metadata.json
```
Review the following example manifest
This manifest creates a ResourceClaim named gpu-claim that requests a device from the gpu.example.com DeviceClass, and a Pod that reads the device metadata.
Create the ResourceClaim and Pod
Bounded code example (external data; do not execute automatically):
```shell
kubectl apply -f https://k8s.io/examples/dra/dra-device-metadata-pod.yaml
```
After the Pod is running, view the container logs to see the metadata
Bounded code example (external data; do not execute automatically):
```shell
kubectl logs gpu-metadata-reader
```
Bounded code example (external data; do not execute automatically):
```text
=== DRA device metadata ===
/var/run/kubernetes.io/dra-device-attributes/resourceclaims/gpu-claim/gpu/gpu.example.com-metadata.json
{
"kind": "DeviceMetadata",
"apiVersion": "metadata.resource.k8s.io/v1alpha1",
...
}
```
To inspect the full metadata file, exec into the container
Bounded code example (external data; do not execute automatically):
```shell
kubectl exec gpu-metadata-reader -- \
cat /var/run/kubernetes.io/dra-device-attributes/resourceclaims/gpu-claim/gpu/gpu.example.com-metadata.json
```
The output is a JSON object containing device attributes like the model, driver version, and device UUID. See metadata schema for details on the JSON structure.
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/tasks/configure-pod-container/assign-resources/access-dra-device-metadata.md :: Access device metadata with a ResourceClaim ↗Revision 6449f1eced66 · CC-BY-4.0 and attribution