From 503cfb1ae38eb98f554bf52c6d32026e46cf08e1 Mon Sep 17 00:00:00 2001 From: aggarwalakshun Date: Thu, 1 May 2025 12:19:22 +0530 Subject: [PATCH] Add init container to clean PostgreSQL data directory --- cluster/apps/invidious/invidious-db.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cluster/apps/invidious/invidious-db.yml b/cluster/apps/invidious/invidious-db.yml index f93499c..0dc7ed0 100644 --- a/cluster/apps/invidious/invidious-db.yml +++ b/cluster/apps/invidious/invidious-db.yml @@ -14,6 +14,17 @@ spec: labels: app: invidious-db spec: + initContainers: + - name: clean-db-dir + image: busybox + command: + - sh + - -c + - | + rm -rf /var/lib/postgresql/data/lost+found + volumeMounts: + - name: postgres-data + mountPath: /var/lib/postgresql/data containers: - name: postgres image: postgres:14 @@ -61,4 +72,4 @@ spec: volumes: - name: postgres-data persistentVolumeClaim: - claimName: longhorn-invidious-config \ No newline at end of file + claimName: longhorn-invidious-config