backup(portal): barman-cloud PITR via a Linode-side Garage WAL archive

sirius-growth/portal had a 24h-RPO pg_dump and no way to roll forward. This adds
continuous WAL archiving + a daily base backup into a second, independent Garage
node on the Linode (bucket pg-wal-archive, 10.10.0.5:3900, WireGuard-only), and
proves a restore to a point in time end to end.

- infrastructure/garage-linode/: podman+quadlet unit (the Linode is a kubelet
  node, no docker), garage.toml bound to 10.10.0.5 only, nft guard in PREROUTING
  -140, install.sh, README with the measured disk sizing, pitr-restore.md with
  the rehearsal transcript.
- apps/base/sirius-growth/cluster.yaml: spec.backup.barmanObjectStore
  (destinationPath s3://pg-wal-archive, gzip WAL+data, retentionPolicy 14d),
  credentials from Secret sirius-growth/portal-wal-s3 (out of band, not in git).
- apps/base/sirius-growth/scheduled-backup.yaml: ScheduledBackup portal-daily,
  03:20 UTC, six-field cron.
- docs/cluster-overview.md: §5.1 the WAL store, §8.1 coverage + sizing + gaps,
  §8.3 the PITR restore recipe.

forgejo/pg is deliberately left on pg_dump only (a day of git history is
annoying, not costly); portal keeps its nightly dump as the logical second copy.

Rehearsed 2026-11-19: marker row at 22:35:06Z, unwanted row at 22:35:28Z,
throwaway cluster restored to targetTime 22:35:15Z came back with the marker and
without the later row. See infrastructure/garage-linode/pitr-restore.md.
This commit is contained in:
Lance Walters 2026-11-19 17:46:27 -05:00
commit 953be9f3cf
12 changed files with 801 additions and 9 deletions

View file

@ -0,0 +1,47 @@
# Garage v1.1.0 — WAL archive for CloudNativePG, on the Linode hub.
#
# Installed to /etc/garage/garage.toml (root:root 0644) by install.sh.
#
# This is a SECOND, independent Garage node — not a cluster peer of the Pi's
# node `d053db4dfc97bf78`. It exists because a WAL archive must live off-site:
# the Pi and the CNPG primary (siriussec) share a building, power domain and
# internet uplink, so archiving WALs there is a second copy of the same
# failure. Different node_key, different metadata dir, `replication_factor = 1`,
# nothing shared with the Pi's store.
#
# Listeners are bound to explicit addresses here AND the ports are guarded by
# host/wal-archive-firewall.nft before Docker-style DNAT could ever matter.
# `10.10.0.5` is the Linode worker's WireGuard-mesh InternalIP (dummy-k8s) —
# the only address any cluster pod can reach this on. eth0 (50.116.38.217) is
# not bound at all, so an off-mesh scan sees a filtered port, not a listener.
#
# rpc_secret is NOT in this file: GARAGE_RPC_SECRET comes from
# /etc/garage/garage.env (0600, out of git), same as the Pi's node.
metadata_dir = "/data/meta"
data_dir = "/data/data"
db_engine = "sqlite"
replication_factor = 1
# Single node: nothing outside the container speaks RPC. Garage still needs the
# listener for its own CLI-over-loopback calls (`garage status`, `garage key`).
rpc_bind_addr = "127.0.0.1:3901"
rpc_public_addr = "127.0.0.1:3901"
[s3_api]
s3_region = "garage"
# WireGuard address only. An empty/i.e. 0.0.0.0 bind here would put barman's
# archive on the Linode's public interface.
api_bind_addr = "10.10.0.5:3900"
# Admin API + Prometheus metrics, mesh-only. No metrics_token: the port does not
# leave the WireGuard mesh. Add one here (and a bearer token in the scrape
# config) if 3903 is ever exposed beyond it. Not scraped today — the archive's
# growth is asserted from the filesystem in the backup README instead.
[admin]
api_bind_addr = "10.10.0.5:3903"
# node_key is generated on first start and lives in metadata_dir (/data/meta).
# It is part of /root/garage-backup for the Pi's node; this node's meta/ is
# covered by the cluster-backup mirror on the same host. Restore meta/ before
# data/ or the layout no longer names this node and every bucket is orphaned.