Skip to content

Commit 19c68b7

Browse files
committed
chart: move autofs root to hostPath
This commit makes it so that the nodeplugin shares its internal /cvmfs autofs root via a hostPath instead of an emptyDir. kubelet periodically scrapes metrics from all emptyDir volumes by walking trough them recursively, stat()-ing each item. This however resets the autofs mount expiry timeout, making it impossible to automatically unmount unused CVMFS repos. The workaround for this is to share /cvmfs via a hostPath which is not included by the metrics, avoiding the issue.
1 parent 74e06e9 commit 19c68b7

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

deployments/helm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ Alternatively, a YAML file that specifies the values of the parameters can be pr
102102
| `kubeletDirectory` | Kubelet's plugin directory path. |
103103
| `cvmfsCSIPluginSocketFile` | Name of the CVMFS CSI socket file. |
104104
| `startAutomountDaemon` | Whether CVMFS CSI nodeplugin Pod should run automount daemon. |
105+
| `automountHostPath` | Path on the host where to mount the autofs-managed CVMFS root. The directory will be created if it doesn't exist. |
105106
| `automountStorageClass.create` | Whether a CVMFS CSI storage class using the automounter should be created automatically. |
106107
| `automountStorageClass.name` | The name for the CVMFS CSI storage class using the automounter if created. |
107108
| `specificRepositoryStorageClasses` | A list of specific CVMFS repos you wish to generate a `storageClass` for. |

deployments/helm/cvmfs-csi/templates/nodeplugin-daemonset.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ spec:
8282
readOnly: true
8383
- name: host-dev
8484
mountPath: /dev
85-
- name: autofs-cvmfs
85+
- name: autofs-root
8686
mountPath: /cvmfs
8787
mountPropagation: Bidirectional
88+
{{- with .Values.nodeplugin.plugin.extraVolumeMounts }}
89+
{{- toYaml . | nindent 12 }}
90+
{{- end }}
8891
{{- with .Values.nodeplugin.plugin.resources }}
8992
resources: {{ toYaml . | nindent 12 }}
9093
{{- end }}
@@ -113,7 +116,7 @@ spec:
113116
readOnly: true
114117
- name: host-dev
115118
mountPath: /dev
116-
- name: autofs-cvmfs
119+
- name: autofs-root
117120
mountPath: /cvmfs
118121
mountPropagation: Bidirectional
119122
- name: cvmfs-localcache
@@ -191,10 +194,12 @@ spec:
191194
- name: host-dev
192195
hostPath:
193196
path: /dev
194-
- name: autofs-cvmfs
195-
emptyDir: {}
196197
- name: runtime-metadata
197198
emptyDir: {}
199+
- name: autofs-root
200+
hostPath:
201+
path: {{ .Values.automountHostPath }}
202+
type: DirectoryOrCreate
198203
- name: cvmfs-localcache
199204
{{- toYaml .Values.cache.local.volumeSpec | nindent 10 }}
200205
{{- if .Values.cache.alien.enabled }}

deployments/helm/cvmfs-csi/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ kubeletDirectory: /var/lib/kubelet
234234
# <kubeletPluginDirectory>/plugins/<csiDriverName>/<cvmfsCSIPluginSocketFile>.
235235
cvmfsCSIPluginSocketFile: csi.sock
236236

237+
# Path on the host where to mount the autofs-managed CVMFS root.
238+
# The directory will be created if it doesn't exist.
239+
automountHostPath: /var/cvmfs
240+
237241
# Number of seconds to wait for automount daemon to start up before exiting.
238242
automountDaemonStartupTimeout: 10
239243
# Number of seconds of idle time after which an autofs-managed CVMFS mount will

0 commit comments

Comments
 (0)