Skip to content

Commit ad1a47b

Browse files
authored
Merge pull request #521 from vlboiko/propagate_host_mount_config
feat: propagate default host configuration files to csi node
2 parents 3faec17 + fda9ff2 commit ad1a47b

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

charts/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The following table lists the configurable parameters of the latest NFS CSI Driv
4747
| `driver.mountPermissions` | default mounted folder permissions | `0`
4848
| `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` |
4949
| `feature.enableInlineVolume` | enable inline volume | `false` |
50+
| `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` |
5051
| `kubeletDir` | alternative kubelet directory | `/var/lib/kubelet` |
5152
| `image.nfs.repository` | csi-driver-nfs image | `registry.k8s.io/sig-storage/nfsplugin` |
5253
| `image.nfs.tag` | csi-driver-nfs image tag | `latest` |
102 Bytes
Binary file not shown.

charts/latest/csi-driver-nfs/templates/csi-nfs-node.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ spec:
125125
- name: pods-mount-dir
126126
mountPath: {{ .Values.kubeletDir }}/pods
127127
mountPropagation: "Bidirectional"
128+
{{- if .Values.feature.propagateHostMountOptions }}
129+
- name: host-nfsmount-conf
130+
mountPath: /etc/nfsmount.conf
131+
- name: host-nfsmount-conf-d
132+
mountPath: /etc/nfsmount.conf.d
133+
{{- end }}
128134
resources: {{- toYaml .Values.node.resources.nfs | nindent 12 }}
129135
volumes:
130136
- name: socket-dir
@@ -139,3 +145,13 @@ spec:
139145
path: {{ .Values.kubeletDir }}/plugins_registry
140146
type: Directory
141147
name: registration-dir
148+
{{- if .Values.feature.propagateHostMountOptions }}
149+
- hostPath:
150+
path: /etc/nfsmount.conf
151+
type: FileOrCreate
152+
name: host-nfsmount-conf
153+
- hostPath:
154+
path: /etc/nfsmount.conf.d
155+
type: DirectoryOrCreate
156+
name: host-nfsmount-conf-d
157+
{{- end }}

charts/latest/csi-driver-nfs/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ driver:
4141
feature:
4242
enableFSGroupPolicy: true
4343
enableInlineVolume: false
44+
propagateHostMountOptions: false
4445

4546
kubeletDir: /var/lib/kubelet
4647

0 commit comments

Comments
 (0)