diff --git a/manifests/database-backup.yaml b/manifests/database-backup.yaml new file mode 100644 index 0000000..a2d1ffd --- /dev/null +++ b/manifests/database-backup.yaml @@ -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 diff --git a/manifests/database-ondemande-backup.yaml b/manifests/database-ondemande-backup.yaml new file mode 100644 index 0000000..f6bf36e --- /dev/null +++ b/manifests/database-ondemande-backup.yaml @@ -0,0 +1,8 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Backup +metadata: + name: gitea-db-ondemand-backup + namespace: gitea +spec: + cluster: + name: gitea-db diff --git a/manifests/database.yaml b/manifests/database.yaml index b498506..83a8af2 100644 --- a/manifests/database.yaml +++ b/manifests/database.yaml @@ -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 diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml index d1a652e..82cbaf3 100644 --- a/manifests/kustomization.yaml +++ b/manifests/kustomization.yaml @@ -5,6 +5,7 @@ resources: - namespace.yaml - secrets.yaml - database.yaml + - database-backup.yaml - service.yaml - servicemonitor.yaml - ingress.yaml