@@ -118,6 +118,20 @@ provisioner: dobs.csi.digitalocean.com
118
118
119
119
---
120
120
121
+ # NOTE(arslan): this will probably fail , because the CRD is created via the
122
+ # csi-snapshotter sidecar, that is part of the csi-do-controller statefulset.
123
+ # We need to create this seperately.
124
+ kind : VolumeSnapshotClass
125
+ apiVersion : snapshot.storage.k8s.io/v1alpha1
126
+ metadata :
127
+ name : do-block-storage
128
+ namespace : kube-system
129
+ annotations :
130
+ snapshot.storage.kubernetes.io/is-default-class : " true"
131
+ snapshotter : dobs.csi.digitalocean.com
132
+
133
+ ---
134
+
121
135
# #############################################
122
136
# ########## ############
123
137
# ########## Controller plugin ############
@@ -165,6 +179,18 @@ spec:
165
179
volumeMounts :
166
180
- name : socket-dir
167
181
mountPath : /var/lib/csi/sockets/pluginproxy/
182
+ - name : csi-snapshotter
183
+ image : quay.io/k8scsi/csi-snapshotter:v0.4.1
184
+ args :
185
+ - " --connection-timeout=15s"
186
+ - " --csi-address=$(ADDRESS)"
187
+ env :
188
+ - name : ADDRESS
189
+ value : /var/lib/csi/sockets/pluginproxy/csi.sock
190
+ imagePullPolicy : Always
191
+ volumeMounts :
192
+ - name : socket-dir
193
+ mountPath : /var/lib/csi/sockets/pluginproxy/
168
194
- name : csi-do-plugin
169
195
image : digitalocean/do-csi-plugin:dev
170
196
args :
@@ -190,46 +216,140 @@ spec:
190
216
emptyDir : {}
191
217
---
192
218
193
- apiVersion : v1
194
219
kind : ServiceAccount
220
+ apiVersion : v1
195
221
metadata :
196
222
name : csi-do-controller-sa
197
223
namespace : kube-system
198
224
225
+ ---
226
+ kind : ClusterRole
227
+ apiVersion : rbac.authorization.k8s.io/v1
228
+ metadata :
229
+ name : csi-do-provisioner-role
230
+ rules :
231
+ - apiGroups : [""]
232
+ resources : ["secrets"]
233
+ verbs : ["get", "list"]
234
+ - apiGroups : [""]
235
+ resources : ["persistentvolumes"]
236
+ verbs : ["get", "list", "watch", "create", "delete"]
237
+ - apiGroups : [""]
238
+ resources : ["persistentvolumeclaims"]
239
+ verbs : ["get", "list", "watch", "update"]
240
+ - apiGroups : ["storage.k8s.io"]
241
+ resources : ["storageclasses"]
242
+ verbs : ["get", "list", "watch"]
243
+ - apiGroups : [""]
244
+ resources : ["events"]
245
+ verbs : ["list", "watch", "create", "update", "patch"]
246
+ - apiGroups : ["snapshot.storage.k8s.io"]
247
+ resources : ["volumesnapshots"]
248
+ verbs : ["get", "list"]
249
+ - apiGroups : ["snapshot.storage.k8s.io"]
250
+ resources : ["volumesnapshotcontents"]
251
+ verbs : ["get", "list"]
252
+
199
253
---
200
254
201
255
kind : ClusterRoleBinding
202
256
apiVersion : rbac.authorization.k8s.io/v1
203
257
metadata :
204
- name : csi-do-controller-provisioner-binding
205
- namespace : kube-system
258
+ name : csi-do-provisioner-binding
206
259
subjects :
207
260
- kind : ServiceAccount
208
261
name : csi-do-controller-sa
209
262
namespace : kube-system
210
263
roleRef :
211
264
kind : ClusterRole
212
- name : system: csi-external -provisioner
265
+ name : csi-do -provisioner-role
213
266
apiGroup : rbac.authorization.k8s.io
214
267
215
268
---
269
+ # Attacher must be able to work with PVs, nodes and VolumeAttachments
270
+ kind : ClusterRole
271
+ apiVersion : rbac.authorization.k8s.io/v1
272
+ metadata :
273
+ name : csi-do-attacher-role
274
+ rules :
275
+ - apiGroups : [""]
276
+ resources : ["persistentvolumes"]
277
+ verbs : ["get", "list", "watch", "update"]
278
+ - apiGroups : [""]
279
+ resources : ["nodes"]
280
+ verbs : ["get", "list", "watch"]
281
+ - apiGroups : ["csi.storage.k8s.io"]
282
+ resources : ["csinodeinfos"]
283
+ verbs : ["get", "list", "watch"]
284
+ - apiGroups : ["storage.k8s.io"]
285
+ resources : ["volumeattachments"]
286
+ verbs : ["get", "list", "watch", "update"]
216
287
288
+ ---
217
289
kind : ClusterRoleBinding
218
290
apiVersion : rbac.authorization.k8s.io/v1
219
291
metadata :
220
- name : csi-do-controller-attacher-binding
221
- namespace : kube-system
292
+ name : csi-do-attacher-binding
222
293
subjects :
223
294
- kind : ServiceAccount
224
295
name : csi-do-controller-sa
225
296
namespace : kube-system
226
297
roleRef :
227
298
kind : ClusterRole
228
- name : system: csi-external -attacher
299
+ name : csi-do -attacher-role
229
300
apiGroup : rbac.authorization.k8s.io
230
301
231
302
---
232
303
304
+ kind : ClusterRole
305
+ apiVersion : rbac.authorization.k8s.io/v1
306
+ metadata :
307
+ name : csi-do-snapshotter-role
308
+ rules :
309
+ - apiGroups : [""]
310
+ resources : ["persistentvolumes"]
311
+ verbs : ["get", "list", "watch"]
312
+ - apiGroups : [""]
313
+ resources : ["persistentvolumeclaims"]
314
+ verbs : ["get", "list", "watch"]
315
+ - apiGroups : ["storage.k8s.io"]
316
+ resources : ["storageclasses"]
317
+ verbs : ["get", "list", "watch"]
318
+ - apiGroups : [""]
319
+ resources : ["events"]
320
+ verbs : ["list", "watch", "create", "update", "patch"]
321
+ - apiGroups : [""]
322
+ resources : ["secrets"]
323
+ verbs : ["get", "list"]
324
+ - apiGroups : ["snapshot.storage.k8s.io"]
325
+ resources : ["volumesnapshotclasses"]
326
+ verbs : ["get", "list", "watch"]
327
+ - apiGroups : ["snapshot.storage.k8s.io"]
328
+ resources : ["volumesnapshotcontents"]
329
+ verbs : ["create", "get", "list", "watch", "update", "delete"]
330
+ - apiGroups : ["snapshot.storage.k8s.io"]
331
+ resources : ["volumesnapshots"]
332
+ verbs : ["get", "list", "watch", "update"]
333
+ - apiGroups : ["apiextensions.k8s.io"]
334
+ resources : ["customresourcedefinitions"]
335
+ verbs : ["create", "list", "watch", "delete"]
336
+
337
+ ---
338
+ kind : ClusterRoleBinding
339
+ apiVersion : rbac.authorization.k8s.io/v1
340
+ metadata :
341
+ name : csi-do-snapshotter-binding
342
+ subjects :
343
+ - kind : ServiceAccount
344
+ name : csi-do-controller-sa
345
+ namespace : kube-system
346
+ roleRef :
347
+ kind : ClusterRole
348
+ name : csi-do-snapshotter-role
349
+ apiGroup : rbac.authorization.k8s.io
350
+
351
+
352
+
233
353
234
354
# #######################################
235
355
# ########## ############
@@ -336,11 +456,22 @@ metadata:
336
456
337
457
---
338
458
459
+ kind : ClusterRole
460
+ apiVersion : rbac.authorization.k8s.io/v1
461
+ metadata :
462
+ name : csi-do-driver-registrar-role
463
+ namespace : kube-system
464
+ rules :
465
+ - apiGroups : [""]
466
+ resources : ["events"]
467
+ verbs : ["get", "list", "watch", "create", "update", "patch"]
468
+
469
+ ---
470
+
339
471
kind : ClusterRoleBinding
340
472
apiVersion : rbac.authorization.k8s.io/v1
341
473
metadata :
342
474
name : csi-do-driver-registrar-binding
343
- namespace : kube-system
344
475
subjects :
345
476
- kind : ServiceAccount
346
477
name : csi-do-node-sa
@@ -350,19 +481,3 @@ roleRef:
350
481
name : csi-do-driver-registrar-role
351
482
apiGroup : rbac.authorization.k8s.io
352
483
353
-
354
- ---
355
-
356
- kind : ClusterRole
357
- apiVersion : rbac.authorization.k8s.io/v1
358
- metadata :
359
- name : csi-do-driver-registrar-role
360
- namespace : kube-system
361
- rules :
362
- - apiGroups : [""]
363
- resources : ["nodes"]
364
- verbs : ["get", "list", "update"]
365
- - apiGroups : [""]
366
- resources : ["events"]
367
- verbs : ["list", "watch", "create", "update", "patch"]
368
-
0 commit comments