Skip to content

Commit

Permalink
Fix the broken mount point before fuse start
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai-Zhang committed Dec 1, 2023
1 parent 3f0fef3 commit 2364648
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
14 changes: 14 additions & 0 deletions deploy/charts/alluxio/templates/csi/csi-fuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
16 changes: 15 additions & 1 deletion deploy/charts/alluxio/templates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 2364648

Please sign in to comment.