feat: added borg backup job with offsite borg sync

This commit is contained in:
2025-03-10 21:22:09 +00:00
parent 9445b85859
commit 4929cf97b7
4 changed files with 138 additions and 13 deletions

View File

@@ -18,26 +18,24 @@ spec:
args:
- |
echo "INFO: Starting export"
. /run/database-access-secret/database
. /root/.gitea-inline-config/database
export PGPASSWORD=$PASSWD
echo "INFO: Exporting database"
pg_dump -h gitea-postgresql.git-limbosolutions-com.svc.cluster.local -U $USER -d $NAME > /data/postgresql-export/db_backup.sql
if [ $? -ne 0 ]; then
echo "ERROR: Exporting database failed"
exit 1
fi
fi
echo "INFO: Exporting database finished"
volumeMounts:
- name: db-postgresql-data
mountPath: /var/lib/postgresql/data
- name: backup-run-data
mountPath: /data/postgresql-export
subPath: postgresql-export
- name: database-access-secret
mountPath: /run/database-access-secret
- name: gitea-inline-config
mountPath: /root/.gitea-inline-config
readOnly: true
containers:
@@ -96,6 +94,6 @@ spec:
- name: backup-run-data
emptyDir: {}
- name: database-access-secret
- name: gitea-inline-config
secret:
secretName: gitea-inline-config