From ea96be6e176e145440a1ec9ff56c793e998a3ead Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Wed, 22 Nov 2023 10:03:03 +0100 Subject: [PATCH] now working with the secret reference --- .../backup/overlays/backup/kustomization.yaml | 16 ++++++++++++---- .../backup/overlays/backup/restic-commands.yaml | 9 ++------- .../backup/overlays/prune/kustomization.yaml | 15 +++++++++++---- .../backup/overlays/prune/restic-commands.yaml | 7 +------ 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/infrastructure/backup/overlays/backup/kustomization.yaml b/infrastructure/backup/overlays/backup/kustomization.yaml index 3da5d5d..64d3fcc 100644 --- a/infrastructure/backup/overlays/backup/kustomization.yaml +++ b/infrastructure/backup/overlays/backup/kustomization.yaml @@ -1,8 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -# namespace: backup -nameSuffix: -backup +namespace: backup +# nameSuffix: -backup resources: - ../../base # - ./restic-commands.yaml @@ -10,7 +10,15 @@ resources: # patch the cronjob args field: patches: - - path: ./restic-commands.yaml + - path: restic-commands.yaml target: kind: CronJob - \ No newline at end of file + name: restic-rclone-gdrive + - target: + kind: CronJob + name: restic-rclone-gdrive + # replace the name of the cronjob + patch: |- + - op: replace + path: /metadata/name + value: restic-gdrive-backup \ No newline at end of file diff --git a/infrastructure/backup/overlays/backup/restic-commands.yaml b/infrastructure/backup/overlays/backup/restic-commands.yaml index 0f3bbe1..1db68bb 100644 --- a/infrastructure/backup/overlays/backup/restic-commands.yaml +++ b/infrastructure/backup/overlays/backup/restic-commands.yaml @@ -1,7 +1,7 @@ apiVersion: batch/v1 kind: CronJob metadata: - name: backup-patch + name: restic-gdrive-backup spec: schedule: "0 2 * * *" # at 2:00, every day @@ -22,9 +22,4 @@ spec: --exclude=s3/ && restic - list snapshots - env: - - name: RESTIC_PASSWORD - valueFrom: - secretKeyRef: - name: restic-gdrive-credentials-backup \ No newline at end of file + list snapshots \ No newline at end of file diff --git a/infrastructure/backup/overlays/prune/kustomization.yaml b/infrastructure/backup/overlays/prune/kustomization.yaml index a2079af..4f3afb5 100644 --- a/infrastructure/backup/overlays/prune/kustomization.yaml +++ b/infrastructure/backup/overlays/prune/kustomization.yaml @@ -1,15 +1,22 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -# namespace: backup -nameSuffix: -prune +namespace: backup resources: - ../../base - # - ./restic-commands.yaml # patch the cronjob args field: patches: - - path: ./restic-commands.yaml + - path: restic-commands.yaml target: kind: CronJob + name: restic-rclone-gdrive + - target: + kind: CronJob + name: restic-rclone-gdrive + # replace the name of the cronjob + patch: |- + - op: replace + path: /metadata/name + value: restic-gdrive-prune \ No newline at end of file diff --git a/infrastructure/backup/overlays/prune/restic-commands.yaml b/infrastructure/backup/overlays/prune/restic-commands.yaml index 8608d50..636b57a 100644 --- a/infrastructure/backup/overlays/prune/restic-commands.yaml +++ b/infrastructure/backup/overlays/prune/restic-commands.yaml @@ -1,7 +1,7 @@ apiVersion: batch/v1 kind: CronJob metadata: - name: prune-patch + name: restic-gdrive-prune spec: schedule: "0 0 1/15 * *" # at midnight, the first and 15. of every month @@ -22,8 +22,3 @@ spec: --verbose=2 --keep-daily 7 --keep-weekly 5 --prune - env: - - name: RESTIC_PASSWORD - valueFrom: - secretKeyRef: - name: restic-gdrive-credentials-backup