fix for nfs-photo not exporting root dir

This commit is contained in:
azykov@mail.ru
2026-08-16 20:42:10 +03:00
parent 0455b4a745
commit db517dbcbc
5 changed files with 38 additions and 12 deletions
+23 -11
View File
@@ -25,14 +25,6 @@ spec:
- sh - sh
- -c - -c
- chmod -R a+rwX /disks/base /disks/sub1 - chmod -R a+rwX /disks/base /disks/sub1
mtab-setup:
image:
repository: hectorm/nfs-ganesha
tag: v10
command:
- sh
- -c
- cat /proc/self/mounts > /mtab-vol/mtab
# native sidecar (restartPolicy: Always): mounts the two disks and # native sidecar (restartPolicy: Always): mounts the two disks and
# exposes their union at /disks/merged via FUSE. It must be up and # exposes their union at /disks/merged via FUSE. It must be up and
# actually mounted *before* the "app" container is created, since # actually mounted *before* the "app" container is created, since
@@ -46,7 +38,6 @@ spec:
mergerfs: mergerfs:
dependsOn: dependsOn:
- fix-permissions - fix-permissions
- mtab-setup
restartPolicy: Always restartPolicy: Always
image: image:
repository: ghcr.io/hotio/mergerfs repository: ghcr.io/hotio/mergerfs
@@ -77,6 +68,24 @@ spec:
memory: 64Mi memory: 64Mi
limits: limits:
memory: 512Mi memory: 512Mi
# runs after mergerfs is confirmed mounted (see dependsOn) and has
# /export mounted too, so the /proc/self/mounts snapshot it takes
# actually includes the fuse.mergerfs line for /export. ganesha's
# FSAL_VFS resolves export paths against this frozen /etc/mtab, not
# the live /proc/mounts - if /export is missing from it (e.g. this
# ran before mergerfs, or without /export mounted at all), ganesha
# fails at startup with "resolve_posix_filesystem(/export) ...
# No such file or directory" even though /export is mounted fine.
mtab-setup:
dependsOn:
- mergerfs
image:
repository: hectorm/nfs-ganesha
tag: v10
command:
- sh
- -c
- cat /proc/self/mounts > /mtab-vol/mtab
containers: containers:
app: app:
image: image:
@@ -141,7 +150,7 @@ spec:
type: persistentVolumeClaim type: persistentVolumeClaim
accessMode: ReadWriteOnce accessMode: ReadWriteOnce
size: 100Gi size: 100Gi
storageClass: longhorn storageClass: longhorn-single-replica
retain: true retain: true
advancedMounts: advancedMounts:
app: app:
@@ -153,7 +162,7 @@ spec:
type: persistentVolumeClaim type: persistentVolumeClaim
accessMode: ReadWriteOnce accessMode: ReadWriteOnce
size: 100Gi size: 100Gi
storageClass: longhorn storageClass: longhorn-single-replica
retain: true retain: true
advancedMounts: advancedMounts:
app: app:
@@ -171,6 +180,9 @@ spec:
app: app:
- path: /export - path: /export
mountPropagation: HostToContainer mountPropagation: HostToContainer
mtab-setup:
- path: /export
mountPropagation: HostToContainer
dev-fuse: dev-fuse:
type: hostPath type: hostPath
hostPath: /dev/fuse hostPath: /dev/fuse
+1 -1
View File
@@ -94,7 +94,7 @@ spec:
type: persistentVolumeClaim type: persistentVolumeClaim
existingClaim: nfs-photo-export existingClaim: nfs-photo-export
globalMounts: globalMounts:
- path: /webdav/photo - path: /webdav/photo/library
sda2: sda2:
type: persistentVolumeClaim type: persistentVolumeClaim
existingClaim: nas1-sda2 existingClaim: nas1-sda2
@@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- longhorn-no-retain.yaml - longhorn-no-retain.yaml
- longhorn-single-replica.yaml
@@ -0,0 +1,12 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn-single-replica
annotations:
storageclass.kubernetes.io/is-default-class: "false"
provisioner: driver.longhorn.io
reclaimPolicy: Retain
allowVolumeExpansion: true
parameters:
numberOfReplicas: "1"
staleReplicaTimeout: "30"
@@ -15,3 +15,4 @@ resources:
- ../../base/namespaces/finance.yaml - ../../base/namespaces/finance.yaml
- ../../base/namespaces/nfs.yaml - ../../base/namespaces/nfs.yaml
- ../../base/namespaces/syncthing.yaml - ../../base/namespaces/syncthing.yaml
- ../../base/namespaces/photo-stats.yaml