Backups
Backup and restore automation for OpenG2P production - PostgreSQL via pgBackRest, etcd snapshots, rancher-backup for Kubernetes resources, restic for NFS data and configs. Pull-based and encrypted. Op
This page is the entry point for the OpenG2P backup automation that lives at automation/backups/openg2p-backup.sh in the deployment repo. It complements the Production Automation: the production script gets the platform up, the backup automation keeps it recoverable.
What this is, in one paragraph
A 4th "backup" node, on the same VPC, runs cron-driven backups of every part of an OpenG2P production install — PostgreSQL via pgBackRest with WAL streaming for ~1-minute RPO, etcd snapshots from RKE2's built-in mechanism, Kubernetes resources via the rancher-backup operator, NFS data via restic with a sidecar manifest that maps NFS UUID directories back to their PVC/namespace/app, filesystem state (Wireguard, Nginx, RKE2 TLS) via restic over SSH-tar, and (opt-in) MinIO/S3 object data via rclone read-only mount + restic. All repos are encrypted at rest. Install also wires Prometheus textfile metrics, an independent WAL-health probe, optional SMTP daily/failure mail, and a PrometheusRule into cattle-monitoring-system. Drills run weekly. Restores are deliberate — staged into temp dirs, never overwriting live data without an operator's runbook step.
Sub-pages
Architecture — the tools, why each is here, what's deliberately not used
What gets backed up — the per-component table and the rationale for what's lost vs. recreated on a fresh install
Prerequisites — backup-node sizing, network, secret custody (p12 keystore model)
Configuration —
backup-config.yamlreferenceOperations —
install,run,verify,list,status,wal-health,daily-report, group togglesDrills — weekly verify + dry-run-restore harness, interpreting
.status.jsonRestoration — index of restore scenarios
Alerting — Prometheus dead-man's switch, WAL probes, operator email
TL;DR — get backups running
After install, cron on the backup host runs the daily/weekly schedule plus WAL-health (every 5m) and daily-report (morning email when SMTP is enabled). Operators interact via the orchestrator from their laptop for ad-hoc runs, status checks, and restores. See Alerting to confirm PrometheusRule + metrics scrape.
Recovery objectives
PostgreSQL (with WAL streaming)
≈1 min
minutes (PITR), 10s of minutes (full restore)
Kubernetes resources (Secrets, CRs, PV/PVCs)
24h (nightly)
5–15 min (rancher-backup Restore CR)
NFS data
24h
minutes per PVC, hours for full export
etcd snapshots
6h
5–10 min (cluster-reset restore)
RP/compute filesystem state (WG, Nginx, RKE2 TLS)
24h
minutes per subsystem
Object store (MinIO/S3, if groups.objectstore)
24h (nightly)
minutes (restic restore from backup host)
All of these are configurable via backup-config.yaml schedules. The defaults match a 6-month retention window and assume a 1 TB backup volume; smaller volumes work but shorten retention before pruning.
What this does not do
Multi-site / offsite replication. The default keeps one copy on one volume on the backup node. The 3-2-1 rule says 3 copies on 2 media with 1 offsite — plan a second offsite target later via
restic copyor pgBackRest's secondary repo. Opt-inobjectstorebacks up MinIO/S3 onto the backup host; it is not itself an offsite copy.Scraping the backup host for you.
installwrites textfile metrics and applies a PrometheusRule intocattle-monitoring-system, but Prometheus only sees those metrics if node_exporter (or Pushgateway) on the backup host is scraped. See Alerting.Full disaster-recovery rehearsal. Weekly drills do per-component verify + dry-run-restore. Cluster-wide rehearsals into a sandbox VPC are a manual, separately-scheduled operator activity.
Restoring to a different cluster topology. Restore assumes you're rebuilding into the same production shape. Cross-version or cross-architecture restore is out of scope.
Reference
Last updated
Was this helpful?