P3: PostgreSQL disaster recovery test and borgmatic k8s-pg backup (#32)
## Summary - Fixed borgmatic `borg: command not found` by adding `local_path` config option - Successfully tested disaster recovery: restored miniflux data from borgmatic backup to k8s-pg - Added borgmatic user to k8s-pg via CloudNativePG managed roles - Configured borgmatic to backup both localhost and k8s-pg PostgreSQL databases - Added Tailscale ACL grant for `tag:homelab` → `tag:k8s` on port 5432 - Disabled selfHeal on apps app to allow manual revision changes during development ## Changes - `ansible/roles/borgmatic/` - Added `local_path` and k8s-pg database entry - `ansible/roles/postgresql/tasks/main.yml` - Added k8s-pg to `.pgpass` - `argocd/apps/apps.yaml` - Disabled selfHeal - `argocd/manifests/databases/blumeops-pg.yaml` - Added borgmatic managed role - `argocd/manifests/databases/secret-borgmatic.yaml.tpl` - New secret template - `pulumi/policy.hujson` - Added ACL grant for backup access ## Deployment and Testing - [x] Borgmatic backup runs successfully - [x] Miniflux data restored to k8s-pg (2 users, 2 feeds, 44 entries verified) - [x] borgmatic user created in k8s-pg with pg_read_all_data role - [x] Both localhost and k8s-pg databases in backup archive - [x] zk documentation updated (borgmatic.md, postgresql.md) - [ ] After merge: set blumeops-pg app back to main revision 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: https://forge.tail8d86e.ts.net/eblume/blumeops/pulls/32
This commit is contained in:
parent
f2541c3f77
commit
eb952aae01
8 changed files with 52 additions and 9 deletions
|
|
@ -3,6 +3,9 @@ borgmatic_config: /Users/erichblume/.config/borgmatic/config.yaml
|
|||
borgmatic_config_dir: /Users/erichblume/.config/borgmatic
|
||||
borgmatic_log_dir: /Users/erichblume/Library/Logs
|
||||
|
||||
# Full path to borg binary since LaunchAgent doesn't have homebrew in PATH
|
||||
borgmatic_local_path: /opt/homebrew/bin/borg
|
||||
|
||||
# Schedule: runs daily at 2:00 AM
|
||||
borgmatic_schedule_hour: 2
|
||||
borgmatic_schedule_minute: 0
|
||||
|
|
@ -42,7 +45,13 @@ borgmatic_keep_yearly: 1000
|
|||
# pg_dump_command must be full path since LaunchAgent doesn't have homebrew in PATH
|
||||
borgmatic_pg_dump_command: /opt/homebrew/opt/postgresql@18/bin/pg_dump
|
||||
borgmatic_postgresql_databases:
|
||||
# Brew PostgreSQL on indri (current production)
|
||||
- name: miniflux
|
||||
hostname: localhost
|
||||
port: 5432
|
||||
username: borgmatic
|
||||
# k8s PostgreSQL (CloudNativePG) - backup both during migration
|
||||
- name: miniflux
|
||||
hostname: k8s-pg.tail8d86e.ts.net
|
||||
port: 5432
|
||||
username: borgmatic
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
# Path to borg binary (LaunchAgent doesn't have homebrew in PATH)
|
||||
local_path: {{ borgmatic_local_path }}
|
||||
|
||||
source_directories:
|
||||
{% for dir in borgmatic_source_directories %}
|
||||
- {{ dir }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue