From 44a14036486ca60ec1db5873bdfa5cc0082f9d9f Mon Sep 17 00:00:00 2001 From: Nick Adam Date: Mon, 19 Jan 2026 13:13:49 +0100 Subject: [PATCH] fix: pg pvc for outline --- apps/authentik/dependencies.yaml | 16 ++++++++++++++++ apps/outline/dependencies.yaml | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/apps/authentik/dependencies.yaml b/apps/authentik/dependencies.yaml index e84cb48..fa40e85 100644 --- a/apps/authentik/dependencies.yaml +++ b/apps/authentik/dependencies.yaml @@ -79,6 +79,22 @@ spec: labels: app: authentik-postgresql spec: + # InitContainer: Bereinige lost+found Verzeichnis von Longhorn + initContainers: + - name: init-postgres-data + image: busybox:latest + command: ["sh", "-c"] + args: + - | + # Entferne lost+found Verzeichnis (wird von Longhorn/ext4 erstellt) + rm -rf /var/lib/postgresql/data/lost+found + # Stelle sicher, dass das Verzeichnis leer ist (nur bei neuem Volume) + find /var/lib/postgresql/data -mindepth 1 -maxdepth 1 ! -name "lost+found" -exec rm -rf {} + || true + securityContext: + runAsUser: 0 + volumeMounts: + - name: postgres-data + mountPath: /var/lib/postgresql/data containers: - name: postgres image: postgres:15-alpine diff --git a/apps/outline/dependencies.yaml b/apps/outline/dependencies.yaml index 5952398..2f0b19c 100644 --- a/apps/outline/dependencies.yaml +++ b/apps/outline/dependencies.yaml @@ -78,6 +78,22 @@ spec: labels: app: outline-postgres spec: + # InitContainer: Bereinige lost+found Verzeichnis von Longhorn + initContainers: + - name: init-postgres-data + image: busybox:latest + command: ["sh", "-c"] + args: + - | + # Entferne lost+found Verzeichnis (wird von Longhorn/ext4 erstellt) + rm -rf /var/lib/postgresql/data/lost+found + # Stelle sicher, dass das Verzeichnis leer ist + find /var/lib/postgresql/data -mindepth 1 -maxdepth 1 ! -name "lost+found" -exec rm -rf {} + || true + securityContext: + runAsUser: 0 + volumeMounts: + - name: postgres-data + mountPath: /var/lib/postgresql/data containers: - name: postgres image: postgres:15-alpine