You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to its documentation on how to install the csi driver.
215
+
216
+
First create a (non provisioning) storage class to differentiate SMB shares
217
+
from other storage.
218
+
219
+
```
220
+
apiVersion: storage.k8s.io/v1
221
+
kind: StorageClass
222
+
metadata:
223
+
name: smb
224
+
parameters:
225
+
type: smb
226
+
provisioner: kubernetes.io/no-provisioner
227
+
reclaimPolicy: Retain
228
+
volumeBindingMode: Immediate
229
+
```
230
+
231
+
When using Active Directory, the username and password to mount the share must match a
232
+
username/password pair that exists in your AD. When using pre-defined users &
233
+
groups the username/password pair must match one that is defined in the JSON
234
+
embedded in the secret associated with your SmbSecurityConfig.
235
+
236
+
```
237
+
apiVersion: v1
238
+
kind: Secret
239
+
metadata:
240
+
name: myshare-mount-creds
241
+
namespace mynamespace
242
+
type: Opaque
243
+
stringData:
244
+
username: user1
245
+
password: T0Psecre7
246
+
```
247
+
248
+
The following persistent volume will allow mounting the share.
249
+
Note the `spec.csi.volumeAttributes.source`: `myshare` is the share's service name, `mynamespace` the namespace the `SmbShare` is in and `My Great Share` is the share's `shareName` as configured or the share's name if not.
250
+
251
+
```
252
+
apiVersion: v1
253
+
kind: PersistentVolume
254
+
metadata:
255
+
name: pv-mynamespace-myshare
256
+
spec:
257
+
capacity:
258
+
storage: 1Gi
259
+
accessModes:
260
+
- ReadWriteMany
261
+
persistentVolumeReclaimPolicy: Retain
262
+
mountOptions:
263
+
- dir_mode=0777
264
+
- file_mode=0777
265
+
- vers=3.0
266
+
csi:
267
+
driver: smb.csi.k8s.io
268
+
readOnly: false
269
+
volumeHandle: mynamespace-myshare # make sure it's a unique id in the cluster
270
+
volumeAttributes:
271
+
source: "//myshare.mynamespace/My Great Share"
272
+
nodeStageSecretRef:
273
+
name: myshare-mount-creds
274
+
namespace: mynamespace
275
+
claimRef:
276
+
apiVersion: v1
277
+
kind: PersistentVolumeClaim
278
+
name: myshare-smb
279
+
namespace: mynamespace
280
+
```
281
+
282
+
Then the volume claim can be created and should bind shorty after to the persistent volume.
283
+
```
284
+
apiVersion: v1
285
+
kind: PersistentVolumeClaim
286
+
metadata:
287
+
name: myshare-smb
288
+
namespace mynamespace
289
+
spec:
290
+
accessModes:
291
+
- ReadWriteMany
292
+
resources:
293
+
requests:
294
+
storage: 1Gi
295
+
storageClassName: smb
296
+
volumeMode: Filesystem
297
+
volumeName: mynamespace-myshare-smb
298
+
```
299
+
300
+
201
301
# Create shares that are accessible outside the cluster
202
302
203
303
Unless you took extra steps on your own, the shares created in the previous
0 commit comments