proper backup config

This commit is contained in:
2024-03-31 19:37:18 +02:00
parent deed24aa01
commit 49b21cde52
17 changed files with 19 additions and 64 deletions

View File

@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: backup
# nameSuffix: -backup
resources:
- ../../cronjobs-base
# - ./restic-commands.yaml
# patch the cronjob args field:
patches:
- 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-backup

View File

@@ -0,0 +1,30 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: restic-gdrive-backup
spec:
schedule: "0 2 * * *"
# at 2:00, every day
jobTemplate:
spec:
template:
spec:
initContainers:
- name: restic-base-container
args:
# >- strips newlines
# -r $(RESTIC_REPOSITORY) not needed, bc set as env var
- >-
restic backup
--verbose=2
/data
--exclude=s3/
&&
restic
list snapshots
containers:
- name: ntfy-command-send
env:
- name: OPERATION
value: "Restic backup to gdrive"