Feature: Back up OpenBao to RustFS every hour #80

Merged
kasun merged 5 commits from feature/automate-openbao-backups into main 2026-12-02 14:55:48 +01:00

Turns on OpenBao's hourly backups to RustFS on TrueNAS. Related to #65.

What it changes

  • Turns on the OpenBao Helm chart's snapshot CronJob (0 * * * *). It uploads to the openbao-backups bucket on rustfs.<domain>:30292.
  • The job logs in with Kubernetes auth (openbao-snapshot role), and its policy only allows reading sys/storage/raft/snapshot. It trusts OpenBao's internal CA.
  • Its RustFS key can only upload. The bucket uses GOVERNANCE object lock for 30 days, so the cluster can't delete or overwrite backups.
  • The job's own cleanup is off, because it would need delete access.
  • Adds a NetworkPolicy rule so the job can reach port 8200.
  • Adds the RustFS runbook (TrueNAS, Cloudflare, pfSense, RustFS, bucket and user), plus backup setup, checks and download steps in the OpenBao runbook.
  • Also includes an earlier CLAUDE.md commit that removes the "PRs only" limit on the Gitea script.

Before merging

  • Commit and push the 06-openbao config change (snapshotS3AccessKeyId, snapshotS3SecretAccessKey) in the private config repo. CI's preview fails until then.
  • OpenBao's Kubernetes auth, openbao-snapshot policy and role are set up (Set up backups, steps 3–6).
  • The RustFS bucket and upload-only user exist. A ZFS snapshot task covers the RustFS dataset.
  • The CI preview shows 1 to create (the Secret) and 1 to update (the Helm release), with no replacements.

After merging

Merging deploys 06-openbao. Run step 7 of Set up backups to start a manual backup and check its upload.

Testing

  • Typecheck passes. The local preview shows + 1 to create, ~ 1 to update, with no replacements.
  • helm template for chart 0.30.8 with these values renders the CronJob, CA mount, environment and NetworkPolicy as expected.
  • Tested on a temporary RustFS bucket:
    • The upload-only key can't list, read, delete or change locks.
    • Even the admin can't delete a locked version.
    • The snapshot agent image (0.4.5) uploads with --region=us-east-1.
    • A ZFS snapshot rollback restores the versions and locks.
  • Not tested yet: the job in the cluster, which runs after merging.

Not included

  • Automatic cleanup of old backups. A lifecycle rule is being tested on the temporary bucket until 5 December. Until then, the bucket keeps growing.
  • Alerts for failed or missed backups.
  • Managing OpenBao's settings in code. Planned as a separate stack.
Turns on OpenBao's hourly backups to RustFS on TrueNAS. Related to #65. ## What it changes - Turns on the OpenBao Helm chart's snapshot CronJob (`0 * * * *`). It uploads to the `openbao-backups` bucket on `rustfs.<domain>:30292`. - The job logs in with Kubernetes auth (`openbao-snapshot` role), and its policy only allows reading `sys/storage/raft/snapshot`. It trusts OpenBao's internal CA. - Its RustFS key can only upload. The bucket uses `GOVERNANCE` object lock for 30 days, so the cluster can't delete or overwrite backups. - The job's own cleanup is off, because it would need delete access. - Adds a NetworkPolicy rule so the job can reach port 8200. - Adds the RustFS runbook (TrueNAS, Cloudflare, pfSense, RustFS, bucket and user), plus backup setup, checks and download steps in the OpenBao runbook. - Also includes an earlier `CLAUDE.md` commit that removes the "PRs only" limit on the Gitea script. ## Before merging - [x] Commit and push the `06-openbao` config change (`snapshotS3AccessKeyId`, `snapshotS3SecretAccessKey`) in the private config repo. CI's preview fails until then. - [x] OpenBao's Kubernetes auth, `openbao-snapshot` policy and role are set up (Set up backups, steps 3–6). - [x] The RustFS bucket and upload-only user exist. A ZFS snapshot task covers the RustFS dataset. - [ ] The CI preview shows `1 to create` (the Secret) and `1 to update` (the Helm release), with no replacements. ## After merging Merging deploys `06-openbao`. Run step 7 of **Set up backups** to start a manual backup and check its upload. ## Testing - Typecheck passes. The local preview shows `+ 1 to create, ~ 1 to update`, with no replacements. - `helm template` for chart 0.30.8 with these values renders the CronJob, CA mount, environment and NetworkPolicy as expected. - Tested on a temporary RustFS bucket: - The upload-only key can't list, read, delete or change locks. - Even the admin can't delete a locked version. - The snapshot agent image (`0.4.5`) uploads with `--region=us-east-1`. - A ZFS snapshot rollback restores the versions and locks. - Not tested yet: the job in the cluster, which runs after merging. ## Not included - Automatic cleanup of old backups. A lifecycle rule is being tested on the temporary bucket until 5 December. Until then, the bucket keeps growing. - Alerts for failed or missed backups. - Managing OpenBao's settings in code. Planned as a separate stack.
claude-bot Bot added 4 commits 2026-12-02 04:29:41 +01:00
Turns on the Helm chart's snapshot CronJob. It logs in with Kubernetes auth and uploads with an upload-only RustFS key, so it can't read or delete backups. Its own pruning is off because it would need delete access; object lock and RustFS lifecycle rules handle retention.
docs: add OpenBao backup setup to runbooks
Secret Scan / Betterleaks (pull_request) Successful in 6s
Deploy Openbao / Pulumi Deploy (pull_request) Skipped
Deploy Openbao / Pulumi Preview (pull_request) Successful in 43s
d1c7412f07
kasun added 1 commit 2026-12-02 04:39:29 +01:00
docs: remove trailing space in CLAUDE.md
Deploy Openbao / Pulumi Deploy (pull_request) Skipped
Deploy Openbao / Pulumi Preview (pull_request) Successful in 1m29s
Secret Scan / Betterleaks (pull_request) Successful in 10s
86af2c6fcb
kasun merged commit 063688746e into main 2026-12-02 14:55:48 +01:00
Sign in to join this conversation.