Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use the same mount path inside fuse pod as on host machine #97

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions deploy/charts/alluxio/templates/csi/csi-fuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
{{- $name := include "alluxio.name" . }}
{{- $fullName := include "alluxio.fullname" . }}
{{- $chart := include "alluxio.chart" . }}
{{- $hostMountPath := include "alluxio.mount.basePath" "" }}
{{- $alluxioFuseMountPoint := include "alluxio.mount.basePath" "/fuse" }}
{{- $alluxioFuseLogDir := include "alluxio.basePath" "/logs"}}
{{- $alluxioFuseLogVolumeName := include "alluxio.getVolumeName" (dict "prefix" $fullName "component" "fuse-log") }}

Expand Down Expand Up @@ -64,18 +62,18 @@ data:
privileged: true # required by bidirectional mount
command: [ "/bin/sh", "-c" ]
args:
- umount -l {{ $alluxioFuseMountPoint }} || true
- umount -l {{ .Values.fuse.hostPathForMount }} || true
volumeMounts:
- name: alluxio-fuse-mount
mountPath: {{ $hostMountPath }}
mountPath: {{ .Values.fuse.hostPathForMount | dir }}
mountPropagation: Bidirectional
- name: create-alluxio-fuse-dir
image: {{ .Values.image }}:{{ .Values.imageTag }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "mkdir", "-p", {{ $alluxioFuseMountPoint }}]
command: [ "mkdir", "-p", {{ .Values.fuse.hostPathForMount }}]
volumeMounts:
- name: alluxio-fuse-mount
mountPath: {{ $hostMountPath }}
mountPath: {{ .Values.fuse.hostPathForMount | dir }}
{{- if .Values.master.enabled }}
- name: wait-master
image: {{ .Values.image }}:{{ .Values.imageTag }}
Expand All @@ -94,12 +92,12 @@ data:
{{- end }}
command: ["/bin/sh", "-c"]
args:
- umount -l {{ $alluxioFuseMountPoint }};
- umount -l {{ .Values.fuse.hostPathForMount }};
{{- $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 }}
/entrypoint.sh fuse {{ .Values.fuse.hostPathForMount }} {{- range .Values.fuse.mountOptions }} -o {{ . }} {{- end }}
{{- else }}
/entrypoint.sh fuse {{ required "The path of the dataset must be set." .Values.dataset.path }} {{ $alluxioFuseMountPoint }} {{- range .Values.fuse.mountOptions }} -o {{ . }} {{- end }}
/entrypoint.sh fuse {{ required "The path of the dataset must be set." .Values.dataset.path }} {{ .Values.fuse.hostPathForMount }} {{- range .Values.fuse.mountOptions }} -o {{ . }} {{- end }}
{{- end }}
env:
{{- range $key, $value := .Values.fuse.env }}
Expand All @@ -111,12 +109,12 @@ data:
lifecycle:
preStop:
exec:
command: ["fusermount", "-u", {{ $alluxioFuseMountPoint }}]
command: ["fusermount", "-u", {{ .Values.fuse.hostPathForMount }}]
volumeMounts:
- name: {{ $fullName }}-alluxio-conf
mountPath: /opt/alluxio/conf
- name: alluxio-fuse-mount
mountPath: {{ $hostMountPath }}
mountPath: {{ .Values.fuse.hostPathForMount | dir }}
mountPropagation: Bidirectional
{{- if .Values.hostPathForLogging }}
- name: {{ $alluxioFuseLogVolumeName }}
Expand Down
24 changes: 11 additions & 13 deletions deploy/charts/alluxio/templates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
{{- $name := include "alluxio.name" . }}
{{- $fullName := include "alluxio.fullname" . }}
{{- $chart := include "alluxio.chart" . }}
{{- $hostMountPath := include "alluxio.mount.basePath" "" }}
{{- $alluxioFuseMountPoint := include "alluxio.mount.basePath" "/fuse" }}
{{- $alluxioFuseLogDir := include "alluxio.basePath" "/logs"}}
{{- $alluxioFuseLogVolumeName := include "alluxio.getVolumeName" (dict "prefix" $fullName "component" "fuse-log") }}

Expand Down Expand Up @@ -102,10 +100,10 @@ spec:
privileged: true # required by bidirectional mount
command: [ "/bin/sh", "-c" ]
args:
- umount -l {{ $alluxioFuseMountPoint }} || true
- umount -l {{ .Values.fuse.hostPathForMount }} || true
volumeMounts:
- name: alluxio-fuse-mount
mountPath: {{ $hostMountPath }}
mountPath: {{ .Values.fuse.hostPathForMount | dir }}
mountPropagation: Bidirectional
- name: path-permission
image: {{ .Values.image }}:{{ .Values.imageTag }}
Expand All @@ -116,24 +114,24 @@ spec:
command: [ "chown", "-R" ]
args:
- {{ .Values.user }}:{{ .Values.group }}
- {{ $hostMountPath }}
- {{ .Values.fuse.hostPathForMount | dir }}
{{- if .Values.hostPathForLogging }}
- {{ $alluxioFuseLogDir }}
{{- end }}
volumeMounts:
- name: alluxio-fuse-mount
mountPath: {{ $hostMountPath }}
mountPath: {{ .Values.fuse.hostPathForMount | dir }}
{{- if .Values.hostPathForLogging }}
- name: {{ $alluxioFuseLogVolumeName }}
mountPath: {{ $alluxioFuseLogDir }}
{{- end }}
- name: create-alluxio-fuse-dir
image: {{ .Values.image }}:{{ .Values.imageTag }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
command: [ "mkdir", "-p", {{ $alluxioFuseMountPoint }}]
command: [ "mkdir", "-p", {{ .Values.fuse.hostPathForMount }}]
volumeMounts:
- name: alluxio-fuse-mount
mountPath: {{ $hostMountPath }}
mountPath: {{ .Values.fuse.hostPathForMount | dir }}
{{- if .Values.master.enabled }}
- name: wait-master
image: {{ .Values.image }}:{{ .Values.imageTag }}
Expand All @@ -152,12 +150,12 @@ spec:
{{- end }}
command: ["/bin/sh", "-c"]
args:
- umount -l {{ $alluxioFuseMountPoint }};
- umount -l {{ .Values.fuse.hostPathForMount }};
{{- $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 }}
/entrypoint.sh fuse {{ .Values.fuse.hostPathForMount }} {{- range .Values.fuse.mountOptions }} -o {{ . }} {{- end }}
{{- else }}
/entrypoint.sh fuse {{ required "The path of the dataset must be set." .Values.dataset.path }} {{ $alluxioFuseMountPoint }} {{- range .Values.fuse.mountOptions }} -o {{ . }} {{- end }}
/entrypoint.sh fuse {{ required "The path of the dataset must be set." .Values.dataset.path }} {{ .Values.fuse.hostPathForMount }} {{- range .Values.fuse.mountOptions }} -o {{ . }} {{- end }}
{{- end }}
env:
- name: ALLUXIO_CLIENT_HOSTNAME
Expand All @@ -173,10 +171,10 @@ spec:
lifecycle:
preStop:
exec:
command: ["fusermount", "-u", {{ $alluxioFuseMountPoint }}]
command: ["fusermount", "-u", {{ .Values.fuse.hostPathForMount }}]
volumeMounts:
- name: alluxio-fuse-mount
mountPath: {{ $hostMountPath }}
mountPath: {{ .Values.fuse.hostPathForMount | dir }}
mountPropagation: Bidirectional
- name: {{ $fullName }}-alluxio-conf
mountPath: /opt/alluxio/conf
Expand Down
2 changes: 2 additions & 0 deletions tests/helm/config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ proxy:
fuse:
# Whether to launch Fuse pods
enabled: true
# The path on the host machine for mount Alluxio Fuse
hostPathForMount: /dummy/path/for/fuse/mount
# Extra environment variables for the Alluxio fuse pods. Format:
# env:
# <key1>: <value1>
Expand Down
18 changes: 9 additions & 9 deletions tests/helm/expectedTemplates/csi/csi-fuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ data:
privileged: true # required by bidirectional mount
command: [ "/bin/sh", "-c" ]
args:
- umount -l /mnt/alluxio/fuse || true
- umount -l /dummy/path/for/fuse/mount || true
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPath: /dummy/path/for/fuse
mountPropagation: Bidirectional
- name: create-alluxio-fuse-dir
image: dummy/dummy:dummy
imagePullPolicy: IfNotPresent
command: [ "mkdir", "-p", /mnt/alluxio/fuse]
command: [ "mkdir", "-p", /dummy/path/for/fuse/mount]
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPath: /dummy/path/for/fuse
- name: wait-master
image: dummy/dummy:dummy
command: ["/bin/sh", "-c"]
Expand All @@ -75,8 +75,8 @@ data:
memory: 1Gi
command: ["/bin/sh", "-c"]
args:
- 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
- umount -l /dummy/path/for/fuse/mount;
/entrypoint.sh fuse /dummy/dataset/path /dummy/path/for/fuse/mount -o allow_other -o entry_timeout=3600 -o attr_timeout=3600
env:
- name: "fuseEnvKey1"
value: "fuseEnvVal1"
Expand All @@ -87,12 +87,12 @@ data:
lifecycle:
preStop:
exec:
command: ["fusermount", "-u", /mnt/alluxio/fuse]
command: ["fusermount", "-u", /dummy/path/for/fuse/mount]
volumeMounts:
- name: dummy-alluxio-alluxio-conf
mountPath: /opt/alluxio/conf
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPath: /dummy/path/for/fuse
mountPropagation: Bidirectional
- name: dummy-alluxio-fuse-log-volume
mountPath: /opt/alluxio/logs
Expand All @@ -118,7 +118,7 @@ data:
volumes:
- name: alluxio-fuse-mount
hostPath:
path: /mnt/alluxio
path: /dummy/path/for/fuse
type: DirectoryOrCreate
- name: dummy-alluxio-alluxio-conf
configMap:
Expand Down
22 changes: 11 additions & 11 deletions tests/helm/expectedTemplates/fuse/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ spec:
privileged: true # required by bidirectional mount
command: [ "/bin/sh", "-c" ]
args:
- umount -l /mnt/alluxio/fuse || true
- umount -l /dummy/path/for/fuse/mount || true
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPath: /dummy/path/for/fuse
mountPropagation: Bidirectional
- name: path-permission
image: dummy/dummy:dummy
Expand All @@ -125,20 +125,20 @@ spec:
command: [ "chown", "-R" ]
args:
- 1000:1000
- /mnt/alluxio
- /dummy/path/for/fuse
- /opt/alluxio/logs
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPath: /dummy/path/for/fuse
- name: dummy-alluxio-fuse-log-volume
mountPath: /opt/alluxio/logs
- name: create-alluxio-fuse-dir
image: dummy/dummy:dummy
imagePullPolicy: IfNotPresent
command: [ "mkdir", "-p", /mnt/alluxio/fuse]
command: [ "mkdir", "-p", /dummy/path/for/fuse/mount]
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPath: /dummy/path/for/fuse
- name: wait-master
image: dummy/dummy:dummy
command: ["/bin/sh", "-c"]
Expand All @@ -159,8 +159,8 @@ spec:
memory: 1Gi
command: ["/bin/sh", "-c"]
args:
- 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
- umount -l /dummy/path/for/fuse/mount;
/entrypoint.sh fuse /dummy/dataset/path /dummy/path/for/fuse/mount -o allow_other -o entry_timeout=3600 -o attr_timeout=3600
env:
- name: ALLUXIO_CLIENT_HOSTNAME
valueFrom:
Expand All @@ -175,10 +175,10 @@ spec:
lifecycle:
preStop:
exec:
command: ["fusermount", "-u", /mnt/alluxio/fuse]
command: ["fusermount", "-u", /dummy/path/for/fuse/mount]
volumeMounts:
- name: alluxio-fuse-mount
mountPath: /mnt/alluxio
mountPath: /dummy/path/for/fuse
mountPropagation: Bidirectional
- name: dummy-alluxio-alluxio-conf
mountPath: /opt/alluxio/conf
Expand Down Expand Up @@ -206,7 +206,7 @@ spec:
volumes:
- name: alluxio-fuse-mount
hostPath:
path: /mnt/alluxio
path: /dummy/path/for/fuse
type: DirectoryOrCreate
- name: dummy-alluxio-alluxio-conf
configMap:
Expand Down