@@ -204,28 +204,7 @@ If `nodeName` is used in this case, the scheduler will be bypassed and PVC will
204
204
Instead, you can use node selector for ` kubernetes.io/hostname ` :
205
205
{{< /note >}}
206
206
207
- ``` yaml
208
- apiVersion : v1
209
- kind : Pod
210
- metadata :
211
- name : task-pv-pod
212
- spec :
213
- nodeSelector :
214
- kubernetes.io/hostname : kube-01
215
- volumes :
216
- - name : task-pv-storage
217
- persistentVolumeClaim :
218
- claimName : task-pv-claim
219
- containers :
220
- - name : task-pv-container
221
- image : nginx
222
- ports :
223
- - containerPort : 80
224
- name : " http-server"
225
- volumeMounts :
226
- - mountPath : " /usr/share/nginx/html"
227
- name : task-pv-storage
228
- ` ` `
207
+ {{% code_sample language="yaml" file="storage/storageclass/pod-volume-binding.yaml" %}}
229
208
230
209
## Allowed topologies
231
210
@@ -237,22 +216,7 @@ This example demonstrates how to restrict the topology of provisioned volumes to
237
216
zones and should be used as a replacement for the ` zone ` and ` zones ` parameters for the
238
217
supported plugins.
239
218
240
- ` ` ` yaml
241
- apiVersion: storage.k8s.io/v1
242
- kind: StorageClass
243
- metadata:
244
- name: standard
245
- provisioner: kubernetes.io/example
246
- parameters:
247
- type: pd-standard
248
- volumeBindingMode: WaitForFirstConsumer
249
- allowedTopologies:
250
- - matchLabelExpressions:
251
- - key: topology.kubernetes.io/zone
252
- values:
253
- - us-central-1a
254
- - us-central-1b
255
- ` ` `
219
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-topology.yaml" %}}
256
220
257
221
## Parameters
258
222
@@ -278,44 +242,14 @@ The Kubernetes project suggests that you use the [AWS EBS](https://github.com/ku
278
242
out-of-tree storage driver instead.
279
243
280
244
Here is an example StorageClass for the AWS EBS CSI driver:
281
- ` ` ` yaml
282
- apiVersion: storage.k8s.io/v1
283
- kind: StorageClass
284
- metadata:
285
- name: ebs-sc
286
- provisioner: ebs.csi.aws.com
287
- volumeBindingMode: WaitForFirstConsumer
288
- parameters:
289
- csi.storage.k8s.io/fstype: xfs
290
- type: io1
291
- iopsPerGB: "50"
292
- encrypted: "true"
293
- tagSpecification_1: "key1=value1"
294
- tagSpecification_2: "key2=value2"
295
- allowedTopologies:
296
- - matchLabelExpressions:
297
- - key: topology.ebs.csi.aws.com/zone
298
- values:
299
- - us-east-2c
300
-
301
- ` tagSpecification`: Tags with this prefix are applied to dynamically provisioned EBS volumes.
302
-
303
- ```
245
+
246
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-aws-ebs.yaml" %}}
247
+
304
248
### AWS EFS
305
249
306
250
To configure AWS EFS storage, you can use the out-of-tree [ AWS_EFS_CSI_DRIVER] ( https://github.com/kubernetes-sigs/aws-efs-csi-driver ) .
307
251
308
- ``` yaml
309
- kind : StorageClass
310
- apiVersion : storage.k8s.io/v1
311
- metadata :
312
- name : efs-sc
313
- provisioner : efs.csi.aws.com
314
- parameters :
315
- provisioningMode : efs-ap
316
- fileSystemId : fs-92107410
317
- directoryPerms : " 700"
318
- ` ` `
252
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-aws-efs.yaml" %}}
319
253
320
254
- ` provisioningMode ` : The type of volume to be provisioned by Amazon EFS. Currently, only access point based provisioning is supported (` efs-ap ` ).
321
255
- ` fileSystemId ` : The file system under which the access point is created.
@@ -330,17 +264,7 @@ To configure NFS storage, you can use the in-tree driver or the
330
264
[ NFS CSI driver for Kubernetes] ( https://github.com/kubernetes-csi/csi-driver-nfs#readme )
331
265
(recommended).
332
266
333
- ` ` ` yaml
334
- apiVersion: storage.k8s.io/v1
335
- kind: StorageClass
336
- metadata:
337
- name: example-nfs
338
- provisioner: example.com/external-nfs
339
- parameters:
340
- server: nfs-server.example.com
341
- path: /share
342
- readOnly: "false"
343
- ` ` `
267
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-nfs.yaml" %}}
344
268
345
269
- ` server ` : Server is the hostname or IP address of the NFS server.
346
270
- ` path ` : Path that is exported by the NFS server.
@@ -450,25 +374,7 @@ This internal provisioner of Ceph RBD is deprecated. Please use
450
374
[CephFS RBD CSI driver](https://github.com/ceph/ceph-csi).
451
375
{{< /note >}}
452
376
453
- ` ` ` yaml
454
- apiVersion: storage.k8s.io/v1
455
- kind: StorageClass
456
- metadata:
457
- name: fast
458
- provisioner: kubernetes.io/rbd
459
- parameters:
460
- monitors: 10.16.153.105:6789
461
- adminId: kube
462
- adminSecretName: ceph-secret
463
- adminSecretNamespace: kube-system
464
- pool: kube
465
- userId: kube
466
- userSecretName: ceph-secret-user
467
- userSecretNamespace: default
468
- fsType: ext4
469
- imageFormat: "2"
470
- imageFeatures: "layering"
471
- ` ` `
377
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-ceph-rbd.yaml" %}}
472
378
473
379
- `monitors` : Ceph monitors, comma delimited. This parameter is required.
474
380
- `adminId` : Ceph client ID that is capable of creating images in the pool.
@@ -512,17 +418,7 @@ storage driver instead.
512
418
513
419
# ## Azure File (deprecated) {#azure-file}
514
420
515
- ` ` ` yaml
516
- apiVersion: storage.k8s.io/v1
517
- kind: StorageClass
518
- metadata:
519
- name: azurefile
520
- provisioner: kubernetes.io/azure-file
521
- parameters:
522
- skuName: Standard_LRS
523
- location: eastus
524
- storageAccount: azure_storage_account_name
525
- ` ` `
421
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-azure-file.yaml" %}}
526
422
527
423
- `skuName` : Azure storage account SKU tier. Default is empty.
528
424
- `location` : Azure storage account location. Default is empty.
@@ -552,17 +448,7 @@ be read by other users.
552
448
553
449
# ## Portworx volume (deprecated) {#portworx-volume}
554
450
555
- ` ` ` yaml
556
- apiVersion: storage.k8s.io/v1
557
- kind: StorageClass
558
- metadata:
559
- name: portworx-io-priority-high
560
- provisioner: kubernetes.io/portworx-volume
561
- parameters:
562
- repl: "1"
563
- snap_interval: "70"
564
- priority_io: "high"
565
- ` ` `
451
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-portworx-volume.yaml" %}}
566
452
567
453
- `fs` : filesystem to be laid out: `none/xfs/ext4` (default: `ext4`).
568
454
- `block_size` : block size in Kbytes (default: `32`).
@@ -586,14 +472,7 @@ parameters:
586
472
587
473
# ## Local
588
474
589
- ` ` ` yaml
590
- apiVersion: storage.k8s.io/v1
591
- kind: StorageClass
592
- metadata:
593
- name: local-storage
594
- provisioner: kubernetes.io/no-provisioner
595
- volumeBindingMode: WaitForFirstConsumer
596
- ` ` `
475
+ {{% code_sample language="yaml" file="storage/storageclass/storageclass-local.yaml" %}}
597
476
598
477
Local volumes do not support dynamic provisioning in Kubernetes {{< skew currentVersion >}};
599
478
however a StorageClass should still be created to delay volume binding until a Pod is actually
0 commit comments