Skip to content

Commit

Permalink
Fix the broken mount point before fuse start (#95)
Browse files Browse the repository at this point in the history
* Fix the broken mount point before fuse start

* Fix tests
  • Loading branch information
Kai-Zhang authored Dec 4, 2023
1 parent 3f0fef3 commit 906fa87
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
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
14 changes: 14 additions & 0 deletions tests/helm/expectedTemplates/csi/csi-fuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ data:
- name: dummySecret1
- name: dummySecret2
initContainers:
- name: umount-path
image: dummy/dummy:dummy
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: true # required by bidirectional mount
command: [ "/bin/sh", "-c" ]
args:
- umount -l /mnt/alluxio/fuse || true
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPropagation: Bidirectional
- name: create-alluxio-fuse-dir
image: dummy/dummy:dummy
imagePullPolicy: IfNotPresent
Expand Down
16 changes: 15 additions & 1 deletion tests/helm/expectedTemplates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,20 @@ spec:
- name: dummySecret1
- name: dummySecret2
initContainers:
- name: umount-path
image: dummy/dummy:dummy
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: true # required by bidirectional mount
command: [ "/bin/sh", "-c" ]
args:
- umount -l /mnt/alluxio/fuse || true
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPropagation: Bidirectional
- name: path-permission
image: dummy/dummy:dummy
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -139,7 +153,7 @@ spec:
memory: 1Gi
command: ["/bin/sh", "-c"]
args:
- umount -l -f /mnt/alluxio/fuse;
- umount -l /mnt/alluxio/fuse;
/entrypoint.sh fuse /dummy/dataset/path /mnt/alluxio/fuse -o allow_other -o entry_timeout=3600 -o attr_timeout=3600
env:
- name: ALLUXIO_CLIENT_HOSTNAME
Expand Down

0 comments on commit 906fa87

Please sign in to comment.