net-kingdom/sso-mfa/k8s/postgresql/scheduled-backup.yaml

27 lines
1 KiB
YAML
Raw Normal View History

# CloudNativePG ScheduledBackup — net-kingdom-pg
#
# PREREQUISITE: WAL archiving must be enabled in cluster.yaml (backup.barmanObjectStore
# section) before this ScheduledBackup will succeed. Uncomment cluster.yaml backup
# block first, apply it, confirm WAL archiving is healthy, then apply this file.
#
# Schedule: daily at 02:00 UTC, keeping 7 daily backups.
# Adjust schedule and retentionPolicy to match your RPO/RTO requirements.
#
# See T03 restore drill procedure in README.md before marking T03 done.
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
name: net-kingdom-pg-daily
namespace: databases
labels:
app.kubernetes.io/part-of: net-kingdom-sso-mfa
net-kingdom/component: databases
spec:
# Daily at 02:00 UTC
schedule: "0 0 2 * * *" # CloudNativePG uses Go cron format: seconds minutes hours dom month dow
backupOwnerReference: self
cluster:
name: net-kingdom-pg
# Immediate: if the schedule is missed (e.g. pod restart), take a backup immediately
immediate: true