diff --git a/charts/README.md b/charts/README.md index 93ca1c8c3..42de31dfb 100644 --- a/charts/README.md +++ b/charts/README.md @@ -47,6 +47,7 @@ The following table lists the configurable parameters of the latest NFS CSI Driv | `driver.mountPermissions` | default mounted folder permissions | `0` | `feature.enableFSGroupPolicy` | enable [`fsGroupPolicy`](https://kubernetes.io/blog/2020/12/14/kubernetes-release-1.20-fsgroupchangepolicy-fsgrouppolicy/#allow-csi-drivers-to-declare-support-for-fsgroup-based-permissions) on a k8s 1.20+ cluster | `true` | | `feature.enableInlineVolume` | enable inline volume | `false` | +| `feature.propagateHostMountOptions` | use the default host NFS mount configuration file [`/etc/nfsmount.conf`](https://man7.org/linux/man-pages/man5/nfsmount.conf.5.html) and/or the default host `/etc/nfsmount.d` mount configuration directory as source for mount options | `false` | | `kubeletDir` | alternative kubelet directory | `/var/lib/kubelet` | | `image.nfs.repository` | csi-driver-nfs image | `registry.k8s.io/sig-storage/nfsplugin` | | `image.nfs.tag` | csi-driver-nfs image tag | `latest` | diff --git a/charts/latest/csi-driver-nfs-v0.0.0.tgz b/charts/latest/csi-driver-nfs-v0.0.0.tgz index 4af2ce5ca..e43baa08a 100644 Binary files a/charts/latest/csi-driver-nfs-v0.0.0.tgz and b/charts/latest/csi-driver-nfs-v0.0.0.tgz differ diff --git a/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml b/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml index 602c8ac07..aac988537 100644 --- a/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml +++ b/charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml @@ -125,6 +125,12 @@ spec: - name: pods-mount-dir mountPath: {{ .Values.kubeletDir }}/pods mountPropagation: "Bidirectional" + {{- if .Values.feature.propagateHostMountOptions }} + - name: host-nfsmount-conf + mountPath: /etc/nfsmount.conf + - name: host-nfsmount-conf-d + mountPath: /etc/nfsmount.conf.d + {{- end }} resources: {{- toYaml .Values.node.resources.nfs | nindent 12 }} volumes: - name: socket-dir @@ -139,3 +145,13 @@ spec: path: {{ .Values.kubeletDir }}/plugins_registry type: Directory name: registration-dir + {{- if .Values.feature.propagateHostMountOptions }} + - hostPath: + path: /etc/nfsmount.conf + type: FileOrCreate + name: host-nfsmount-conf + - hostPath: + path: /etc/nfsmount.conf.d + type: DirectoryOrCreate + name: host-nfsmount-conf-d + {{- end }} diff --git a/charts/latest/csi-driver-nfs/values.yaml b/charts/latest/csi-driver-nfs/values.yaml index 8ecc109a9..07a217c3c 100755 --- a/charts/latest/csi-driver-nfs/values.yaml +++ b/charts/latest/csi-driver-nfs/values.yaml @@ -41,6 +41,7 @@ driver: feature: enableFSGroupPolicy: true enableInlineVolume: false + propagateHostMountOptions: false kubeletDir: /var/lib/kubelet