@@ -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,46 +228,11 @@ 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
- ` ` `
264
-
265
- A mount option is a string which will be cumulatively joined and used while mounting volume to the disk.
233
+ A Kubernetes administrator can specify additional mount options for when a Persistent Volume is mounted on a node.
266
234
267
- Note that not all Persistent volume types support mount options. In Kubernetes version 1.6, the following
235
+ Note that not all Persistent volume types support mount options. The following
268
236
volume types support mount options.
269
237
270
238
* GCEPersistentDisk
@@ -281,6 +249,22 @@ volume types support mount options.
281
249
* Quobyte Volumes
282
250
* VMware Photon
283
251
252
+ Mount options are not validated, so mount will simply fail if one is invalid.
253
+
254
+ In the past, the annotation `volume.beta.kubernetes.io/mount-options` was used instead
255
+ of the `mountOptions` attribute. This annotation is still working, however
256
+ it will become fully deprecated in a future Kubernetes release.
257
+
258
+ # ## Phase
259
+
260
+ A volume will be in one of the following phases :
261
+
262
+ * Available -- a free resource that is not yet bound to a claim
263
+ * Bound -- the volume is bound to a claim
264
+ * Released -- the claim has been deleted, but the resource is not yet reclaimed by the cluster
265
+ * Failed -- the volume has failed its automatic reclamation
266
+
267
+ The CLI will show the name of the PVC bound to the PV.
284
268
285
269
# # PersistentVolumeClaims
286
270
@@ -412,6 +396,8 @@ metadata:
412
396
provisioner: kubernetes.io/aws-ebs
413
397
parameters:
414
398
type: gp2
399
+ mountOptions:
400
+ - debug
415
401
` ` `
416
402
417
403
# ## Provisioner
@@ -462,6 +448,14 @@ PV after it is created.
462
448
Persistent Volumes that are created manually and managed via a storage class will have
463
449
whatever reclaim policy they were assigned at creation.
464
450
451
+ # ## Mount Options
452
+ Persistent Volumes that are dynamically created by a storage class will have the
453
+ mount options specified in the `mountOptions` field of the class.
454
+
455
+ If the volume plugin does not support mount options but mount options are
456
+ specified, provisioning will fail. Mount options are not validated on neither
457
+ the class nor PV, so mount of the PV will simply fail if one is invalid.
458
+
465
459
# ## Parameters
466
460
Storage classes have parameters that describe volumes belonging to the storage
467
461
class. Different parameters may be accepted depending on the `provisioner`. For
0 commit comments