@@ -150,6 +150,9 @@ Each PV contains a spec and status, which is the specification and status of the
150
150
- ReadWriteOnce
151
151
persistentVolumeReclaimPolicy: Recycle
152
152
storageClassName: slow
153
+ mountOptions:
154
+ - hard
155
+ - nfsvers=4.1
153
156
nfs:
154
157
path: /tmp
155
158
server: 172.17.0.2
@@ -225,47 +228,14 @@ Current reclaim policies are:
225
228
226
229
Currently, only NFS and HostPath support recycling. AWS EBS, GCE PD, Azure Disk, and Cinder volumes support deletion.
227
230
228
- # ## Phase
229
-
230
- A volume will be in one of the following phases :
231
-
232
- * Available -- a free resource that is not yet bound to a claim
233
- * Bound -- the volume is bound to a claim
234
- * Released -- the claim has been deleted, but the resource is not yet reclaimed by the cluster
235
- * Failed -- the volume has failed its automatic reclamation
236
-
237
- The CLI will show the name of the PVC bound to the PV.
238
-
239
231
# ## Mount Options
240
232
241
- A Kubernetes administrator can specify additional mount options for when a Persistent Volume is being mounted on a node.
242
-
243
- You can specify a mount option by using the annotation `volume.beta.kubernetes.io/mount-options` on
244
- your Persistent Volume.
245
-
246
- For example :
247
-
248
- ` ` ` yaml
249
- apiVersion: "v1"
250
- kind: "PersistentVolume"
251
- metadata:
252
- name: gce-disk-1
253
- annotations:
254
- volume.beta.kubernetes.io/mount-options: "discard"
255
- spec:
256
- capacity:
257
- storage: "10Gi"
258
- accessModes:
259
- - "ReadWriteOnce"
260
- gcePersistentDisk:
261
- fsType: "ext4"
262
- pdName: "gce-disk-1"
263
- ` ` `
233
+ A Kubernetes administrator can specify additional mount options for when a Persistent Volume is mounted on a node.
264
234
265
- A mount option is a string which will be cumulatively joined and used while mounting volume to the disk.
235
+ **Note:** Not all Persistent volume types support mount options.
236
+ {: .note}
266
237
267
- Note that not all Persistent volume types support mount options. In Kubernetes version 1.6, the following
268
- volume types support mount options.
238
+ The following volume types support mount options :
269
239
270
240
* GCEPersistentDisk
271
241
* AWSElasticBlockStore
@@ -281,6 +251,22 @@ volume types support mount options.
281
251
* Quobyte Volumes
282
252
* VMware Photon
283
253
254
+ Mount options are not validated, so mount will simply fail if one is invalid.
255
+
256
+ In the past, the annotation `volume.beta.kubernetes.io/mount-options` was used instead
257
+ of the `mountOptions` attribute. This annotation is still working, however
258
+ it will become fully deprecated in a future Kubernetes release.
259
+
260
+ # ## Phase
261
+
262
+ A volume will be in one of the following phases :
263
+
264
+ * Available -- a free resource that is not yet bound to a claim
265
+ * Bound -- the volume is bound to a claim
266
+ * Released -- the claim has been deleted, but the resource is not yet reclaimed by the cluster
267
+ * Failed -- the volume has failed its automatic reclamation
268
+
269
+ The CLI will show the name of the PVC bound to the PV.
284
270
285
271
# # PersistentVolumeClaims
286
272
@@ -355,8 +341,10 @@ to Kubernetes cluster by addon manager during installation.
355
341
356
342
When a PVC specifies a `selector` in addition to requesting a `StorageClass`,
357
343
the requirements are ANDed together : only a PV of the requested class and with
358
- the requested labels may be bound to the PVC. Note that currently, a PVC with a
359
- non-empty `selector` can't have a PV dynamically provisioned for it.
344
+ the requested labels may be bound to the PVC.
345
+
346
+ **Note:** Currently, a PVC with a non-empty `selector` can't have a PV dynamically provisioned for it.
347
+ {: .note}
360
348
361
349
In the past, the annotation `volume.beta.kubernetes.io/storage-class` was used instead
362
350
of `storageClassName` attribute. This annotation is still working, however
@@ -412,6 +400,8 @@ metadata:
412
400
provisioner: kubernetes.io/aws-ebs
413
401
parameters:
414
402
type: gp2
403
+ mountOptions:
404
+ - debug
415
405
` ` `
416
406
417
407
# ## Provisioner
@@ -462,6 +452,14 @@ PV after it is created.
462
452
Persistent Volumes that are created manually and managed via a storage class will have
463
453
whatever reclaim policy they were assigned at creation.
464
454
455
+ # ## Mount Options
456
+ Persistent Volumes that are dynamically created by a storage class will have the
457
+ mount options specified in the `mountOptions` field of the class.
458
+
459
+ If the volume plugin does not support mount options but mount options are
460
+ specified, provisioning will fail. Mount options are not validated on neither
461
+ the class nor PV, so mount of the PV will simply fail if one is invalid.
462
+
465
463
# ## Parameters
466
464
Storage classes have parameters that describe volumes belonging to the storage
467
465
class. Different parameters may be accepted depending on the `provisioner`. For
0 commit comments