K3s-cluster/synapse/cronjob.yaml
Tanguy Herbron 20f32fd24b feat(synapse): Add basic Matrix configuration
Added different manifests for deployment, routing, backups and configuration around Synapse server for Matrix.
2022-09-24 01:03:07 +02:00

26 lines
991 B
YAML

apiVersion: batch/v1
kind: CronJob
metadata:
name: backup-job
namespace: synapse
spec:
schedule: "0 4 * * *" # Every day at 4AM
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: postgres-backup
image: postgres:14-alpine3.15
command: ["sh", "-c", "PGPASSWORD=aberation /usr/local/bin/pg_dumpall -U synapse -h synapse-svc.synapse.svc.cluster.local > /backup/synapse/backup-$(date +'%H_%M-%d_%m_%Y').sql"]
volumeMounts:
- name: synapse-backup
mountPath: /backup/synapse
subPath: synapse
volumes:
- name: synapse-backup
persistentVolumeClaim:
claimName: synapse-backup-pvc
restartPolicy: OnFailure