diff --git a/clusters/base/apps/nfs-photo/configmap.yaml b/clusters/base/apps/nfs-photo/configmap.yaml index f70a151..ca23170 100644 --- a/clusters/base/apps/nfs-photo/configmap.yaml +++ b/clusters/base/apps/nfs-photo/configmap.yaml @@ -46,6 +46,50 @@ data: } } + # individual disks, exported alongside the merged /export view so + # clients (webdav) can also see each underlying disk on its own. + EXPORT { + Export_Id = 2; + + Path = /disks/base; + Pseudo = /base; + + SecType = sys; + Protocols = NFSv4; + + FSAL { + Name = VFS; + } + + CLIENT { + Clients = *; + Access_Type = RW; + Squash = No_Root_Squash; + Protocols = NFSv4; + } + } + + EXPORT { + Export_Id = 3; + + Path = /disks/sub1; + Pseudo = /sub1; + + SecType = sys; + Protocols = NFSv4; + + FSAL { + Name = VFS; + } + + CLIENT { + Clients = *; + Access_Type = RW; + Squash = No_Root_Squash; + Protocols = NFSv4; + } + } + LOG { Default_Log_Level = INFO; } diff --git a/clusters/base/apps/nfs-photo/helmrelease.yaml b/clusters/base/apps/nfs-photo/helmrelease.yaml index 0497b4e..828a8c3 100644 --- a/clusters/base/apps/nfs-photo/helmrelease.yaml +++ b/clusters/base/apps/nfs-photo/helmrelease.yaml @@ -69,13 +69,14 @@ spec: limits: 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. + # /export, /disks/base and /disks/sub1 all mounted too, so the + # /proc/self/mounts snapshot it takes covers every path ganesha + # exports. ganesha's FSAL_VFS resolves each EXPORT's Path against + # this frozen /etc/mtab, not the live /proc/mounts - any exported + # path missing from it (e.g. this ran before mergerfs, or without + # that path mounted here at all) fails at startup with + # "resolve_posix_filesystem() ... No such file or directory" + # even though the path is mounted fine in every other container. mtab-setup: dependsOn: - mergerfs @@ -162,6 +163,12 @@ spec: - path: /disks/base fix-permissions: - path: /disks/base + # exported directly as its own NFS share (Pseudo=/base, see + # configmap.yaml) alongside the merged /export view. + app: + - path: /disks/base + mtab-setup: + - path: /disks/base sub1: type: persistentVolumeClaim accessMode: ReadWriteOnce @@ -174,6 +181,12 @@ spec: - path: /disks/sub1 fix-permissions: - path: /disks/sub1 + # exported directly as its own NFS share (Pseudo=/sub1, see + # configmap.yaml) alongside the merged /export view. + app: + - path: /disks/sub1 + mtab-setup: + - path: /disks/sub1 merged: type: emptyDir advancedMounts: diff --git a/clusters/base/apps/webdav/helmrelease.yaml b/clusters/base/apps/webdav/helmrelease.yaml index 099250b..0db73e2 100644 --- a/clusters/base/apps/webdav/helmrelease.yaml +++ b/clusters/base/apps/webdav/helmrelease.yaml @@ -95,6 +95,16 @@ spec: existingClaim: nfs-photo-export globalMounts: - path: /webdav/photo/library + photo-base: + type: persistentVolumeClaim + existingClaim: nfs-photo-base + globalMounts: + - path: /webdav/photo/library-base + photo-sub1: + type: persistentVolumeClaim + existingClaim: nfs-photo-sub1 + globalMounts: + - path: /webdav/photo/library-sub1 sda2: type: persistentVolumeClaim existingClaim: nas1-sda2 diff --git a/clusters/base/apps/webdav/pv-pvc-data.yaml b/clusters/base/apps/webdav/pv-pvc-data.yaml index 167a8a0..56d540a 100644 --- a/clusters/base/apps/webdav/pv-pvc-data.yaml +++ b/clusters/base/apps/webdav/pv-pvc-data.yaml @@ -76,6 +76,78 @@ spec: --- apiVersion: v1 kind: PersistentVolume +metadata: + name: nfs-photo-base-nfs +spec: + capacity: + storage: 100Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: "" + mountOptions: + - nfsvers=4.1 + nfs: + server: 10.43.166.34 + path: /base + claimRef: + namespace: webdav + name: nfs-photo-base +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nfs-photo-base + namespace: webdav + annotations: + helm.sh/resource-policy: keep +spec: + accessModes: + - ReadWriteMany + storageClassName: "" + volumeName: nfs-photo-base-nfs + resources: + requests: + storage: 100Gi +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nfs-photo-sub1-nfs +spec: + capacity: + storage: 100Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: "" + mountOptions: + - nfsvers=4.1 + nfs: + server: 10.43.166.34 + path: /sub1 + claimRef: + namespace: webdav + name: nfs-photo-sub1 +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: nfs-photo-sub1 + namespace: webdav + annotations: + helm.sh/resource-policy: keep +spec: + accessModes: + - ReadWriteMany + storageClassName: "" + volumeName: nfs-photo-sub1-nfs + resources: + requests: + storage: 100Gi +--- +apiVersion: v1 +kind: PersistentVolume metadata: name: nas1-sda2-nfs spec: