1
1
---
2
2
title : " Set Up DRA in a Cluster"
3
3
content_type : task
4
- min-kubernetes-server-version : v1.32
4
+ min-kubernetes-server-version : v1.34
5
5
weight : 10
6
6
---
7
7
{{< feature-state feature_gate_name="DynamicResourceAllocation" >}}
@@ -37,30 +37,20 @@ For details, see
37
37
38
38
<!-- steps -->
39
39
40
- ## Enable the DRA API groups {#enable-dra}
40
+ ## Optional: enable legacy DRA API groups {#enable-dra}
41
41
42
- To let Kubernetes allocate resources to your Pods with DRA, complete the
43
- following configuration steps:
42
+ DRA graduated to stable in Kubernetes 1.34 and is enabled by default.
43
+ Some older DRA drivers or workloads might still need the
44
+ v1beta1 API from Kubernetes 1.30 or v1beta2 from Kubernetes 1.32.
45
+ If and only if support for those is desired, then enable the following
46
+ {{< glossary_tooltip text="API groups" term_id="api-group" >}}:
47
+
48
+ * `resource.k8s.io/v1beta1`
49
+ * `resource.k8s.io/v1beta2`
50
+
51
+ For more information, see
52
+ [ Enabling or disabling API groups] ( /docs/reference/using-api/#enabling-or-disabling ) .
44
53
45
- 1 . Enable the ` DynamicResourceAllocation `
46
- [ feature gate] ( /docs/reference/command-line-tools-reference/feature-gates/ )
47
- on all of the following components:
48
-
49
- * ` kube-apiserver `
50
- * ` kube-controller-manager `
51
- * ` kube-scheduler `
52
- * ` kubelet `
53
-
54
- 1 . Enable the following
55
- {{< glossary_tooltip text="API groups" term_id="api-group" >}}:
56
-
57
- * ` resource.k8s.io/v1beta1 ` : required for DRA to function.
58
- * ` resource.k8s.io/v1beta2 ` : optional, recommended improvements to the user
59
- experience.
60
-
61
- For more information, see
62
- [ Enabling or disabling API groups] ( /docs/reference/using-api/#enabling-or-disabling ) .
63
-
64
54
## Verify that DRA is enabled {#verify}
65
55
66
56
To verify that the cluster is configured correctly, try to list DeviceClasses:
@@ -81,15 +71,15 @@ similar to the following:
81
71
```
82
72
error: the server doesn't have a resource type "deviceclasses"
83
73
```
74
+
84
75
Try the following troubleshooting steps:
85
76
86
- 1 . Ensure that the ` kube-scheduler ` component has the ` DynamicResourceAllocation `
87
- feature gate enabled * and* uses the
88
- [ v1 configuration API] ( /docs/reference/config-api/kube-scheduler-config.v1/ ) .
89
- If you use a custom configuration, you might need to perform additional steps
90
- to enable the ` DynamicResource ` plugin.
91
- 1 . Restart the ` kube-apiserver ` component and the ` kube-controller-manager `
92
- component to propagate the API group changes.
77
+ 1 . Reconfigure and restart the ` kube-apiserver ` component.
78
+
79
+ 1 . If the complete ` .spec.resourceClaims ` field gets removed from Pods, or if
80
+ Pods get scheduled without considering the ResourceClaims, then verify
81
+ that the ` DynamicResourceAllocation ` [ feature gate] ( /docs/reference/command-line-tools-reference/feature-gates/ ) is not turned off
82
+ for kube-apiserver, kube-controller-manager, kube-scheduler or the kubelet.
93
83
94
84
## Install device drivers {#install-drivers}
95
85
@@ -112,6 +102,12 @@ cluster-1-device-pool-1-driver.example.com-lqx8x cluster-1-node-1 driver
112
102
cluster-1-device-pool-2-driver.example.com-29t7b cluster-1-node-2 driver.example.com cluster-1-device-pool-2-446z 8s
113
103
```
114
104
105
+ Try the following troubleshooting steps:
106
+
107
+ 1 . Check the health of the DRA driver and look for error messages about
108
+ publishing ResourceSlices in its log output. The vendor of the driver
109
+ may have further instructions about installation and troubleshooting.
110
+
115
111
## Create DeviceClasses {#create-deviceclasses}
116
112
117
113
You can define categories of devices that your application operators can
@@ -135,27 +131,25 @@ operators.
135
131
The output is similar to the following:
136
132
137
133
` ` ` yaml
138
- apiVersion: resource.k8s.io/v1beta1
134
+ apiVersion: resource.k8s.io/v1
139
135
kind: ResourceSlice
140
136
# lines omitted for clarity
141
137
spec:
142
138
devices:
143
- - basic:
144
- attributes:
145
- type:
146
- string: gpu
147
- capacity:
148
- memory:
149
- value: 64Gi
150
- name: gpu-0
151
- - basic:
152
- attributes:
153
- type:
154
- string: gpu
155
- capacity:
156
- memory:
157
- value: 64Gi
158
- name: gpu-1
139
+ - attributes:
140
+ type:
141
+ string: gpu
142
+ capacity:
143
+ memory:
144
+ value: 64Gi
145
+ name: gpu-0
146
+ - attributes:
147
+ type:
148
+ string: gpu
149
+ capacity:
150
+ memory:
151
+ value: 64Gi
152
+ name: gpu-1
159
153
driver: driver.example.com
160
154
nodeName: cluster-1-node-1
161
155
# lines omitted for clarity
@@ -186,4 +180,4 @@ kubectl delete -f https://k8s.io/examples/dra/deviceclass.yaml
186
180
# # {{% heading "whatsnext" %}}
187
181
188
182
* [Learn more about DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation)
189
- * [Allocate Devices to Workloads with DRA](/docs/tasks/configure-pod-container/assign-resources/allocate-devices-dra)
183
+ * [Allocate Devices to Workloads with DRA](/docs/tasks/configure-pod-container/assign-resources/allocate-devices-dra)
0 commit comments