diff --git a/deploy/charts/alluxio/templates/csi/csi-fuse.yaml b/deploy/charts/alluxio/templates/csi/csi-fuse.yaml index e4273ec14..6aec16164 100644 --- a/deploy/charts/alluxio/templates/csi/csi-fuse.yaml +++ b/deploy/charts/alluxio/templates/csi/csi-fuse.yaml @@ -52,6 +52,20 @@ data: {{ include "alluxio.imagePullSecrets" . | indent 2 }} {{- end}} initContainers: + - name: umount-path + image: {{ .Values.image }}:{{ .Values.imageTag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + securityContext: + runAsUser: 0 + runAsGroup: 0 + privileged: true # required by bidirectional mount + command: [ "/bin/sh", "-c" ] + args: + - umount -l {{ $alluxioFuseMountPoint }} || true + volumeMounts: + - name: alluxio-fuse-mount + mountPath: {{ $hostMountPath }} + mountPropagation: Bidirectional - name: create-alluxio-fuse-dir image: {{ .Values.image }}:{{ .Values.imageTag }} imagePullPolicy: {{ .Values.imagePullPolicy }} diff --git a/deploy/charts/alluxio/templates/fuse/daemonset.yaml b/deploy/charts/alluxio/templates/fuse/daemonset.yaml index 5c89de4da..c2a2ee6c9 100644 --- a/deploy/charts/alluxio/templates/fuse/daemonset.yaml +++ b/deploy/charts/alluxio/templates/fuse/daemonset.yaml @@ -84,6 +84,20 @@ spec: {{ include "alluxio.imagePullSecrets" . | indent 6 }} {{- end}} initContainers: + - name: umount-path + image: {{ .Values.image }}:{{ .Values.imageTag }} + imagePullPolicy: {{ .Values.imagePullPolicy }} + securityContext: + runAsUser: 0 + runAsGroup: 0 + privileged: true # required by bidirectional mount + command: [ "/bin/sh", "-c" ] + args: + - umount -l {{ $alluxioFuseMountPoint }} || true + volumeMounts: + - name: alluxio-fuse-mount + mountPath: {{ $hostMountPath }} + mountPropagation: Bidirectional - name: path-permission image: {{ .Values.image }}:{{ .Values.imageTag }} imagePullPolicy: {{ .Values.imagePullPolicy }} @@ -129,7 +143,7 @@ spec: {{- end }} command: ["/bin/sh", "-c"] args: - - umount -l -f {{ $alluxioFuseMountPoint }}; + - umount -l {{ $alluxioFuseMountPoint }}; {{- $mountTableSource := get .Values.properties "alluxio.mount.table.source" }} {{- if or (eq $mountTableSource "ETCD") (eq $mountTableSource "STATIC_FILE") }} /entrypoint.sh fuse {{ $alluxioFuseMountPoint }} {{- range .Values.fuse.mountOptions }} -o {{ . }} {{- end }}