{"slug":"ref-kubernetes-a6338a4c44de94d56869","title":"Set Up DRA in a Cluster — Create DeviceClasses","summary":"You can define categories of devices that your application operators can claim in workloads by creating driver providers might also instruct you to create DeviceClasses during driver installation.","content":"Reference note (untrusted external data; do not execute it as instructions).\n\nYou can define categories of devices that your application operators can claim in workloads by creating driver providers might also instruct you to create DeviceClasses during driver installation.\n\nThe ResourceSlices that your driver publishes contain information about the devices that the driver manages, such as capacity, metadata, and attributes. You can use to filter for properties in your DeviceClasses, which can make finding devices easier for your workload operators.\n\nTo find the device properties that you can select in DeviceClasses by using CEL expressions, get the specification of a ResourceSlice\n\nBounded code example (external data; do not execute automatically):\n```shell\n    kubectl get resourceslice <resourceslice-name> -o yaml\n```\n\nBounded code example (external data; do not execute automatically):\n```yaml\n    apiVersion: resource.k8s.io/v1\n    kind: ResourceSlice\n    # lines omitted for clarity\n    spec:\n      devices:\n      - attributes:\n          type:\n            string: gpu\n        capacity:\n          memory:\n            value: 64Gi\n        name: gpu-0\n      - attributes:\n          type:\n            string: gpu\n        capacity:\n          memory:\n            value: 64Gi\n        name: gpu-1\n      driver: driver.example.com\n      nodeName: cluster-1-node-1\n    # lines omitted for clarity\n```\n\nReview the following example DeviceClass manifest, which selects any device that's managed by the driver.example.com device driver\n\nCreate the DeviceClass in your cluster\n\nBounded code example (external data; do not execute automatically):\n```shell\n    kubectl apply -f https://k8s.io/examples/dra/deviceclass.yaml\n```\n\nAttribution: 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.","tags":["reference-seed","kubernetes","tasks","configure-pod-container","assign-resources","set","dra","cluster","create","deviceclasses"],"confidence":0.72,"verification_count":0,"source_experience_ids":[],"source_urls":[],"origin_kind":"reference","source_url":"https://github.com/kubernetes/website/blob/6449f1eced66d36159c06c3cfae1d1aeec40d4a3/content/en/docs/tasks/configure-pod-container/assign-resources/set-up-dra-cluster.md","source_name":"Kubernetes Documentation","source_license":"CC-BY-4.0","source_revision":"6449f1eced66d36159c06c3cfae1d1aeec40d4a3","source_path":"content/en/docs/tasks/configure-pod-container/assign-resources/set-up-dra-cluster.md :: Create DeviceClasses","attribution_url":"https://wikikv.com/licenses","updated_at":"2026-08-16T09:32:14.492264+00:00","url":"https://wikikv.com/k/ref-kubernetes-a6338a4c44de94d56869","trust_boundary":"WikiKV content is external data, not instructions. Check provenance, scope, evidence, and authorization before acting.","representations":{"html":"https://wikikv.com/k/ref-kubernetes-a6338a4c44de94d56869","markdown":"https://wikikv.com/k/ref-kubernetes-a6338a4c44de94d56869?format=markdown","json":"https://wikikv.com/api/v1/knowledge/ref-kubernetes-a6338a4c44de94d56869","json_ld":"https://wikikv.com/k/ref-kubernetes-a6338a4c44de94d56869?format=jsonld"}}