36fbaf171a
Document the Hetzner Cloud Firewall posture (inbound from private/home only, outbound allow-all, egress-only IPv6, public IPs on workers) in a new `Cluster_admin/firewall.md` and reference it from `AGENTS.md`, `Environment.md`, and `README.md`. Update the Mailu README to note that SMTP/IMAP ports are not currently exposed. Add `HomeAccess/` with a privileged DaemonSet and README that give cluster nodes a route to `192.168.8.0/24` via point-to-point GRE tunnels to the master and its WireGuard tunnel. Wire Open WebUI to ComfyUI on pop-os through a new `openwebui-imagegen` ConfigMap consumed via `envFrom`, with migration notes covering the PersistentConfig DB override. Bump kube-prometheus-stack to 88.6.1 with an 8GB `retentionSize` cap, grow the postgres PVC to 50Gi, and add a PostgreSQL backup plan for pg_dumpall/rclone streaming to a Hetzner Storage Box.
3.0 KiB
3.0 KiB
PostgreSQL Backup Plan — Hetzner Storage Box
Goal: automated backups of the postgres-hetzner database (namespace database)
to an off-cluster Hetzner Storage Box, using the plain-manifest style of this repo.
Current state
- Postgres: single-replica Deployment
postgres-hetzner, nsdatabase, data onhcloud-volumesPVC (postgres-hetzner-pvc). - Image:
rg.mariushome.lt/custom-postgres(postgres 18.4 + pgvector, already contains rclone — can talk SFTP directly, no new image build needed). - Credentials live in existing
postgres-secret(POSTGRES_USER / POSTGRES_PASSWORD). - No backup automation exists today.
Proposed approach
CronJob + pg_dump + rclone over SFTP (logical backups, no sidecar,
no new Docker image, no extra PVC — stream dump into rclone rcat).
1. Storage Box (one-time, manual)
- Create sub-account/directory, e.g.
postgres-backups/. - SFTP endpoint:
uXXXXX@uXXXXX.your-storagebox.de:23.
2. Secrets (gitignored — never committed)
- New Secret
postgres-backup-secretindatabasens:SFTP_HOST,SFTP_USER,SFTP_PASS(orSFTP_KEY).
- DB credentials reused from existing
postgres-secret.
3. New manifests — PostgreSQL/backup/
postgres_backup_rclone_configmap.yaml— rclone.conf withstoragebox:SFTP remote.postgres_backup_cronjob.yaml— CronJob:- schedule: (TBD, e.g. daily
0 3 * * *) - image
rg.mariushome.lt/custom-postgres - command:
pg_dumpall | rclone rcat storagebox:postgres-backups/dump-$(date).pgdump - retention:
rclone delete --min-age Nd(TBD) before/after upload concurrencyPolicy: Forbid, history limits 1/1backoffLimit: 2
- schedule: (TBD, e.g. daily
4. Verification
- Test run:
kubectl create job --from=cronjob/postgres-backup backup-test -n database - Check logs; verify file on Storage Box via
rclone lsdfrom a debug pod. - Document restore procedure (
pg_restore/psql) in this file after first successful backup.
5. Later (optional)
- PrometheusRule alert on failed/timed-out CronJob (kube-prometheus-stack already selects all).
- Restore drill runbook.
Open questions (fill in before implementation)
- Backup scope:
pg_dumpall(all DBs + roles/globals) vs. per-databasepg_dumploop? → - Physical vs. logical: logical
pg_dumpallassumed OK (small homelab DB, simple restore). PITR/WAL archiving is out of scope — confirm? → - Schedule: e.g. daily at 03:00 UTC? →
- Retention: keep N days? also keep weeklies/monthlies? →
- Storage Box auth: SSH key or password? →
- Storage Box host/account: hostname + username once the sub-account exists? →
- Backup filename scheme: OK with
postgres-backup-YYYYMMDD-HHMM.pgdump? → - Alerting: add PrometheusRule for failed CronJob now, or later? →
Notes / constraints
- Dump size must fit in pod ephemeral storage if not streaming; streaming via
rclone rcatavoids any local disk requirement. - Storage Box SFTP uses port 23 (Hetzner default).
- Downtime is NOT required —
pg_dumpallis online and consistent per DB.