Add init container to clean PostgreSQL data directory

This commit is contained in:
2025-05-01 12:19:22 +05:30
parent 2f7c325b81
commit 503cfb1ae3

View File

@@ -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
claimName: longhorn-invidious-config