From 4ecc91b6b4f8b532584bf56cc368bf05c747612e Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Wed, 28 Jun 2017 19:35:13 -0400 Subject: [PATCH 1/2] Proposal for taking mount option to GA Also add support for specifying mount options in storage classes. --- .../design-proposals/mount-options.md | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/contributors/design-proposals/mount-options.md b/contributors/design-proposals/mount-options.md index 4d4de87fa..f4282adb6 100644 --- a/contributors/design-proposals/mount-options.md +++ b/contributors/design-proposals/mount-options.md @@ -13,9 +13,31 @@ Mount time options that are operationally important and have no security implica ## Design -We are going to add support for mount options in PVs as a beta feature to begin with. +### Mount option support in Persistent Volume Objects + +Mount options can be specified as a field on PVs. For example: + +``` yaml + apiVersion: v1 + kind: PersistentVolume + metadata: + name: pv0003 + spec: + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Recycle + mountOptions: "hard,nolock,nfsvers=3" + nfs: + path: /tmp + server: 172.17.0.2 +``` + + +Beta support for mount options introduced via `mount-options` annotation will be supported for near future +and deprecated in future. -Mount options can be specified as `mount-options` annotations in PV. For example: ``` yaml apiVersion: v1 @@ -35,6 +57,28 @@ Mount options can be specified as `mount-options` annotations in PV. For example server: 172.17.0.2 ``` +### Mount option support in Storage Classes + +Kubernetes admin can also specify mount option as a parameter in storage class. + +```yaml +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: slow +provisioner: kubernetes.io/glusterfs +parameters: + type: gp2 + mountOptions: "auto_mount" +``` + +The mount option specified in Storage Class will be used while provisioning persistent volumes +and added as a field to PVs. + +If admin has configured mount option for a storage type that does not support mount options, +then `mountOptions` parameter will be simply ignored for such volume types. Also, if configured +mount option is invalid then corresponding mount time failure error will be added to pod object. + ## Preventing users from specifying mount options in inline volume specs of Pod @@ -42,7 +86,7 @@ While mount options enable more flexibility in how volumes are mounted, it can r in user specifying options that are not supported or are known to be problematic when using inline volume specs. -After much deliberation it was decided that - `mount-options` as an API parameter will not be supported +After much deliberation it was decided that - `mountOptions` as an API parameter will not be supported for inline volume specs. ### Error handling and plugins that don't support mount option From 58f9efd524a0753cc8b576675f6fe84683f28634 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Wed, 12 Jul 2017 14:24:20 -0400 Subject: [PATCH 2/2] Update error handling description --- contributors/design-proposals/mount-options.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contributors/design-proposals/mount-options.md b/contributors/design-proposals/mount-options.md index f4282adb6..099e86024 100644 --- a/contributors/design-proposals/mount-options.md +++ b/contributors/design-proposals/mount-options.md @@ -76,8 +76,9 @@ The mount option specified in Storage Class will be used while provisioning pers and added as a field to PVs. If admin has configured mount option for a storage type that does not support mount options, -then `mountOptions` parameter will be simply ignored for such volume types. Also, if configured -mount option is invalid then corresponding mount time failure error will be added to pod object. +then a "provisioning failed" event will be added to PVC and PVC will stay in pending state. + +Also, if configured mount option is invalid then corresponding mount time failure error will be added to pod object. ## Preventing users from specifying mount options in inline volume specs of Pod