feat(backups): Configure WAL and schedule backups

This commit is contained in:
Tanguy Herbron 2024-12-01 23:20:02 +01:00
parent a54c41da9d
commit 0fc7740ac3
4 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,10 @@
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
name: gitea-db-backup
namespace: gitea
spec:
schedule: "0 0 * * *"
backupOwnerReference: self
cluster:
name: gitea-db

View File

@ -0,0 +1,8 @@
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: gitea-db-ondemand-backup
namespace: gitea
spec:
cluster:
name: gitea-db

View File

@ -22,6 +22,24 @@ spec:
pg_hba:
- host all all all md5
backup:
barmanObjectStore:
destinationPath: "s3://halis/cloudnativepg"
endpointURL: https://s3.halia.dev
s3Credentials:
accessKeyId:
name: s3-secret
key: AWS_ACCESS_KEY_ID
secretAccessKey:
name: s3-secret
key: AWS_SECRET_ACCESS_KEY
region:
name: s3-secret
key: AWS_REGION
wal:
compression: gzip
maxParallel: 8
resources:
requests:
cpu: 100m

View File

@ -5,6 +5,7 @@ resources:
- namespace.yaml
- secrets.yaml
- database.yaml
- database-backup.yaml
- service.yaml
- servicemonitor.yaml
- ingress.yaml