---
# Ceph RGW (S3) backup target for the ghp CNPG cluster, provisioned by the
# in-estate cephrgw-operator. One dedicated bucket + owner user per cluster.
apiVersion: ceph.unkin.net/v1alpha1
kind: ObjectStoreUser
metadata:
  name: cnpg-ghp-backup
  namespace: ghp
  annotations:
    argocd.argoproj.io/sync-wave: "0"
spec:
  displayName: "CNPG backup owner (ghp)"
  uid: cnpg-ghp-backup
  maxBuckets: 5
  secretName: cnpg-ghp-backup-s3
  retainOnDelete: true
---
apiVersion: ceph.unkin.net/v1alpha1
kind: Bucket
metadata:
  name: cnpg-ghp
  namespace: ghp
  annotations:
    argocd.argoproj.io/sync-wave: "0"
spec:
  placementTarget: ec
  bucketName: cnpg-ghp
  ownerRef: cnpg-ghp-backup
  versioning: false
  tags:
    app: ghp
    purpose: cnpg-backup
  retainOnDelete: true
---
# Nightly base backup; continuous WAL archiving is always-on via the Cluster's
# spec.backup.barmanObjectStore. Staggered off other clusters' schedules.
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
  name: cnpg-ghp-nightly
  namespace: ghp
  annotations:
    argocd.argoproj.io/sync-wave: "0"
spec:
  schedule: "0 50 1 * * *"
  immediate: false
  backupOwnerReference: self
  method: barmanObjectStore
  cluster:
    name: postgres
