From b4dc78965bad0d90f8f25461b193006e7e59e882 Mon Sep 17 00:00:00 2001 From: Clemens Date: Fri, 21 Oct 2022 11:01:50 +0200 Subject: [PATCH] Fixed db-backup cron problem --- doc/BackupAndRestore.md | 2 +- src/main/resources/backup/cron.yaml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/BackupAndRestore.md b/doc/BackupAndRestore.md index b15d4a1..31c7aa4 100644 --- a/doc/BackupAndRestore.md +++ b/doc/BackupAndRestore.md @@ -21,7 +21,7 @@ 1. apply backup-and-restore pod: `kubectl scale deployment backup-restore --replicas=1` -2. exec into pod and execute restore pod (press tab to get your exact pod name) +2. exec into pod and execute backup pod (press tab to get your exact pod name) `kubectl exec -it backup-restore-... -- /usr/local/bin/backup.sh` 3. remove backup-and-restore pod: `kubectl scale deployment backup-restore --replicas=0` diff --git a/src/main/resources/backup/cron.yaml b/src/main/resources/backup/cron.yaml index 7ee682e..5282c54 100644 --- a/src/main/resources/backup/cron.yaml +++ b/src/main/resources/backup/cron.yaml @@ -18,6 +18,27 @@ spec: imagePullPolicy: IfNotPresent command: ["/entrypoint.sh"] env: + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-user + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-secret + key: postgres-password + - name: POSTGRES_DB + valueFrom: + configMapKeyRef: + name: postgres-config + key: postgres-db + - name: POSTGRES_HOST + value: "postgresql-service:5432" + - name: POSTGRES_SERVICE + value: "postgresql-service" + - name: POSTGRES_PORT + value: "5432" - name: AWS_DEFAULT_REGION value: eu-central-1 - name: AWS_ACCESS_KEY_ID_FILE @@ -31,6 +52,8 @@ spec: key: restic-repository - name: RESTIC_PASSWORD_FILE value: /var/run/secrets/backup-secrets/restic-password + - name: CERTIFICATE_FILE + value: "" volumeMounts: - name: gitea-data-volume mountPath: /var/backups