mirror of
https://github.com/auricom/home-cluster.git
synced 2025-09-17 18:24:14 +02:00
54 lines
1.9 KiB
YAML
54 lines
1.9 KiB
YAML
---
|
|
apiVersion: batch/v1
|
|
kind: CronJob
|
|
metadata:
|
|
name: &app cloudnative-pg-external-backup
|
|
namespace: default
|
|
spec:
|
|
schedule: "@daily"
|
|
jobTemplate:
|
|
spec:
|
|
ttlSecondsAfterFinished: 86400
|
|
template:
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: *app
|
|
image: prodrigestivill/postgres-backup-local:15-alpine@sha256:4cbe067cdde2d5a8c1b0cb76b8d55ff2c95d52d6382b034cb973f20b49542b83
|
|
env:
|
|
- name: POSTGRES_HOST
|
|
value: ${POSTGRES_HOST}
|
|
- name: POSTGRES_DB
|
|
value: "authelia,bazarr,freshrss,gatus,ghostfolio,kresus,immich,invidious,joplin,linkding,lldap,lychee,outline,paperless,prowlarr_main,pushover-notifier,radarr_main,semaphore,sharry,tandoor,vaultwarden,vikunja,wallabag"
|
|
- name: POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: cloudnative-pg-secret
|
|
key: username
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: cloudnative-pg-secret
|
|
key: password
|
|
- name: POSTGRES_EXTRA_OPTS
|
|
value: "-Z9 --schema=public --blobs"
|
|
- name: BACKUP_KEEP_DAYS
|
|
value: "7"
|
|
- name: BACKUP_KEEP_WEEKS
|
|
value: "4"
|
|
- name: BACKUP_KEEP_MONTHS
|
|
value: "3"
|
|
- name: HEALTHCHECK_PORT
|
|
value: "8080"
|
|
command:
|
|
- "/backup.sh"
|
|
volumeMounts:
|
|
- name: backups
|
|
mountPath: /backups
|
|
volumes:
|
|
- name: backups
|
|
nfs:
|
|
server: "${LOCAL_LAN_TRUENAS}"
|
|
path: /mnt/storage/backups/postgresql
|