@@ -45,9 +45,15 @@ From here we will build the image for the example resource driver:
45
45
46
46
And create a ` kind ` cluster to run it in:
47
47
``` bash
48
- ./demo/create-cluster.sh
48
+ KUBE_GIT_VERSION=v1.30.0 BUILD_KIND_IMAGE=true KIND_K8S_TAG=v1.31.0-rc.1 ./demo/create-cluster.sh
49
49
```
50
50
51
+ ** Note** : The environment variables in the command above allow us to build a
52
+ local node image against Kubernetes v1.31.0-rc.1. Once ` kind ` releases a node
53
+ image for v1.31 these extra environment variables will no longer be needed. If
54
+ you only plan on running tests for Kubernetes 1.30 then you can just use the
55
+ latest ` kind ` image for v1.30 and omit these extra environment variables.
56
+
51
57
Once the cluster has been created successfully, double check everything is
52
58
coming up as expected:
53
59
``` console
@@ -79,7 +85,6 @@ Double check the driver components have come up successfully:
79
85
``` console
80
86
$ kubectl get pod -n dra-example-driver
81
87
NAME READY STATUS RESTARTS AGE
82
- dra-example-driver-controller-7555d488db-nbd52 1/1 Running 0 1m
83
88
dra-example-driver-kubeletplugin-qwmbl 1/1 Running 0 1m
84
89
```
85
90
@@ -88,32 +93,133 @@ And show the initial state of available GPU devices on the worker node:
88
93
$ kubectl get resourceslice -o yaml
89
94
apiVersion: v1
90
95
items:
91
- - apiVersion: resource.k8s.io/v1alpha2
92
- driverName: gpu.resource.example.com
96
+ - apiVersion: resource.k8s.io/v1alpha3
93
97
kind: ResourceSlice
94
98
metadata:
95
- creationTimestamp: "2024-04-17T13:45:44Z"
96
- generateName: dra-example-driver-cluster-worker-gpu.resource.example.com-
97
- name: dra-example-driver-cluster-worker-gpu.resource.example.comxktph
99
+ creationTimestamp: "2024-07-16T13:00:06Z"
100
+ generateName: dra-example-driver-cluster-worker-gpu.example.com-
101
+ generation: 1
102
+ name: dra-example-driver-cluster-worker-gpu.example.com-xhsqf
98
103
ownerReferences:
99
104
- apiVersion: v1
100
105
controller: true
101
106
kind: Node
102
107
name: dra-example-driver-cluster-worker
103
- uid: 4dc7c3b2-d99c-492b-8ede-37d435e56b2d
104
- resourceVersion: "1189"
105
- uid: 61c965b5-54a9-40ee-88a1-c52a814fa624
106
- namedResources:
107
- instances:
108
- - name: gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac
109
- - name: gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b
110
- - name: gpu-18db0e85-99e9-c746-8531-ffeb86328b39
111
- - name: gpu-93d37703-997c-c46f-a531-755e3e0dc2ac
112
- - name: gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744
113
- - name: gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243
114
- - name: gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747
115
- - name: gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e
116
- nodeName: dra-example-driver-cluster-worker
108
+ uid: 8a18f216-bd77-426a-86b1-a989bdacc135
109
+ resourceVersion: "854"
110
+ uid: ea955e01-eaf0-45ed-8a36-1c56e4b8bced
111
+ spec:
112
+ driver: gpu.example.com
113
+ nodeName: dra-example-driver-cluster-worker
114
+ pool:
115
+ generation: 0
116
+ name: dra-example-driver-cluster-worker
117
+ resourceSliceCount: 1
118
+ devices:
119
+ - basic:
120
+ attributes:
121
+ driverVersion:
122
+ version: 1.0.0
123
+ index:
124
+ int: 0
125
+ model:
126
+ string: LATEST-GPU-MODEL
127
+ uuid:
128
+ string: gpu-18db0e85-99e9-c746-8531-ffeb86328b39
129
+ capacity:
130
+ memory: 80Gi
131
+ name: gpu-18db0e85-99e9-c746-8531-ffeb86328b39
132
+ - basic:
133
+ attributes:
134
+ driverVersion:
135
+ version: 1.0.0
136
+ index:
137
+ int: 1
138
+ model:
139
+ string: LATEST-GPU-MODEL
140
+ uuid:
141
+ string: gpu-93d37703-997c-c46f-a531-755e3e0dc2ac
142
+ capacity:
143
+ memory: 80Gi
144
+ name: gpu-93d37703-997c-c46f-a531-755e3e0dc2ac
145
+ - basic:
146
+ attributes:
147
+ driverVersion:
148
+ version: 1.0.0
149
+ index:
150
+ int: 2
151
+ model:
152
+ string: LATEST-GPU-MODEL
153
+ uuid:
154
+ string: gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744
155
+ capacity:
156
+ memory: 80Gi
157
+ name: gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744
158
+ - basic:
159
+ attributes:
160
+ driverVersion:
161
+ version: 1.0.0
162
+ index:
163
+ int: 3
164
+ model:
165
+ string: LATEST-GPU-MODEL
166
+ uuid:
167
+ string: gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243
168
+ capacity:
169
+ memory: 80Gi
170
+ name: gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243
171
+ - basic:
172
+ attributes:
173
+ driverVersion:
174
+ version: 1.0.0
175
+ index:
176
+ int: 4
177
+ model:
178
+ string: LATEST-GPU-MODEL
179
+ uuid:
180
+ string: gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747
181
+ capacity:
182
+ memory: 80Gi
183
+ name: gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747
184
+ - basic:
185
+ attributes:
186
+ driverVersion:
187
+ version: 1.0.0
188
+ index:
189
+ int: 5
190
+ model:
191
+ string: LATEST-GPU-MODEL
192
+ uuid:
193
+ string: gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e
194
+ capacity:
195
+ memory: 80Gi
196
+ name: gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e
197
+ - basic:
198
+ attributes:
199
+ driverVersion:
200
+ version: 1.0.0
201
+ index:
202
+ int: 6
203
+ model:
204
+ string: LATEST-GPU-MODEL
205
+ uuid:
206
+ string: gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac
207
+ capacity:
208
+ memory: 80Gi
209
+ name: gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac
210
+ - basic:
211
+ attributes:
212
+ driverVersion:
213
+ version: 1.0.0
214
+ index:
215
+ int: 7
216
+ model:
217
+ string: LATEST-GPU-MODEL
218
+ uuid:
219
+ string: gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b
220
+ capacity:
221
+ memory: 80Gi
222
+ name: gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b
117
223
kind: List
118
224
metadata:
119
225
resourceVersion: ""
@@ -165,28 +271,28 @@ This should produce output similar to the following:
165
271
``` bash
166
272
gpu-test1:
167
273
pod0 ctr0:
168
- declare -x GPU_DEVICE_0=" GPU-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b "
274
+ declare -x GPU_DEVICE_0=" gpu-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747 "
169
275
pod1 ctr0:
170
- declare -x GPU_DEVICE_0=" GPU-ee3e4b55-fcda-44b8-0605-64b7a9967744 "
276
+ declare -x GPU_DEVICE_0=" gpu-f11773a1-5bfb-e48b-3d98-1beb5baaf08e "
171
277
172
278
gpu-test2:
173
279
pod0 ctr0:
174
- declare -x GPU_DEVICE_0=" GPU-9ede7e32-5825-a11b-fa3d-bab6d47e0243 "
280
+ declare -x GPU_DEVICE_0=" gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac "
175
281
pod0 ctr1:
176
- declare -x GPU_DEVICE_0=" GPU-9ede7e32-5825-a11b-fa3d-bab6d47e0243 "
282
+ declare -x GPU_DEVICE_0=" gpu-0159f35e-99ee-b2b5-74f1-9d18df3f22ac "
177
283
178
284
gpu-test3:
179
285
pod0 ctr0:
180
- declare -x GPU_DEVICE_0=" GPU-93d37703-997c-c46f-a531-755e3e0dc2ac "
286
+ declare -x GPU_DEVICE_0=" gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b "
181
287
pod1 ctr0:
182
- declare -x GPU_DEVICE_0=" GPU-93d37703-997c-c46f-a531-755e3e0dc2ac "
288
+ declare -x GPU_DEVICE_0=" gpu-657bd2e7-f5c2-a7f2-fbaa-0d1cdc32f81b "
183
289
184
290
gpu-test4:
185
291
pod0 ctr0:
186
- declare -x GPU_DEVICE_0=" GPU -18db0e85-99e9-c746-8531-ffeb86328b39"
187
- declare -x GPU_DEVICE_1=" GPU-e7b42cb1-4fd8-91b2-bc77-352a0c1f5747 "
188
- declare -x GPU_DEVICE_2=" GPU-f11773a1-5bfb-e48b-3d98-1beb5baaf08e "
189
- declare -x GPU_DEVICE_3=" GPU-0159f35e-99ee-b2b5-74f1-9d18df3f22ac "
292
+ declare -x GPU_DEVICE_0=" gpu -18db0e85-99e9-c746-8531-ffeb86328b39"
293
+ declare -x GPU_DEVICE_1=" gpu-93d37703-997c-c46f-a531-755e3e0dc2ac "
294
+ declare -x GPU_DEVICE_2=" gpu-ee3e4b55-fcda-44b8-0605-64b7a9967744 "
295
+ declare -x GPU_DEVICE_3=" gpu-9ede7e32-5825-a11b-fa3d-bab6d47e0243 "
190
296
```
191
297
192
298
In this example resource driver, no "actual" GPUs are made available to any
0 commit comments