From 40d4c92271f138d002813911dd6893ffdb67f573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Tue, 14 Apr 2026 16:58:31 +0100 Subject: [PATCH] init container to fix permissions on volumeMounts --- deploy/app/helm-values.yaml | 54 ++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/deploy/app/helm-values.yaml b/deploy/app/helm-values.yaml index 4c5341d..36102d2 100644 --- a/deploy/app/helm-values.yaml +++ b/deploy/app/helm-values.yaml @@ -89,10 +89,57 @@ cronjob: nextcloud: + + extraInitContainers: + - name: data-folder-structure-fix + image: busybox + command: + - sh + - -c + - | + # Create only parents + mkdir -p /mnt/users + mkdir -p /mnt/shared + + # Fix permissions on parents pvc folder data-folder-structure + chown 33:33 /mnt/users + chown 33:33 /mnt/shared + chown 33:33 /mnt/users/marcio.fernandes + chown 33:33 /mnt/users/marcio.fernandes/Documents + chown 33:33 /mnt/users/marcio.fernandes/Photos + chown 33:33 /mnt/shared/Gaming + chown 33:33 /mnt/shared/Music + chown 33:33 /mnt/shared/Videos + chown 33:33 /mnt/shared/NerdStuff + + volumeMounts: + - name: data-folder-structure + mountPath: /mnt + - name: mf-nextcloud + mountPath: /mnt/users/marcio.fernandes + - name: mf-documents + mountPath: /mnt/users/marcio.fernandes/Documents + - name: mf-photos + mountPath: /mnt/users/marcio.fernandes/Photos + - name: media-gaming + mountPath: /mnt/shared/Gaming + - name: media-music + mountPath: /mnt/shared/Music + - name: media-videos + mountPath: /mnt/shared/Videos + - name: it-storage + mountPath: /mnt/shared/NerdStuff + securityContext: + runAsUser: 33 + runAsGroup: 33 + fsGroup: 33 + fsGroupChangePolicy: "OnRootMismatch" + phpConfigs: php.ini: |- memory_limit = 512M extraVolumes: + - name: mf-documents persistentVolumeClaim: claimName: mf-documents-limbosolutions-com @@ -114,9 +161,14 @@ nextcloud: - name: mf-nextcloud persistentVolumeClaim: claimName: mf-nextcloud-limbosolutions-com - + - name: data-folder-structure + emptyDir: {} extraVolumeMounts: + + - name: data-folder-structure + mountPath: /mnt + - name: mf-nextcloud mountPath: /mnt/users/marcio.fernandes