Rehearsing media PostgreSQL recovery on QNAP
This push adds a daily media-postgres-restore-verification CronJob that restores the six logical dumps from the read‑only backup claim into a private directory on the QNAP export, exercises bounded synchronous commits, forces a PostgreSQL process crash and restart, then validates the restored heaps and indexes. The job publishes a private .restore-verification receipt with the source backup ID, transaction count, and timing, and the disaster‑recovery overlay can suspend it alongside the backup CronJob.
CronJob behavior and receipt
The CronJob runs at 04:45 America/Los_Angeles on zimaboard-1 using the Talos Unix‑only seccomp profile. It restores today’s six logical dumps from the read‑only backup claim into a private directory on media-postgres-qnap. After restore, it tests bounded synchronous commits, simulates a PostgreSQL crash and restart, and verifies the committed rows, heaps, and indexes. A private .restore-verification receipt is written to the root of the rehearsal claim containing the source backup ID, transaction count, and timing. Operators verify the Job’s Complete condition and read the receipt through the mounted QNAP export with authenticated talosctl.
Documentation updates
docs/storage-nfs.md now notes that the daily verification Job reports completion through Kubernetes and writes its receipt at the claim root. It also explains how to match the UTC backup ID and completion time to the Job, and how to stop the daily verifier with a Git revert while retaining the claim and last receipt. The architecture wiki (openwiki/architecture/storage-and-state.md) received a longer entry describing the restore flow, crash‑recovery test, receipt format, and the requirement to verify the materialized seccomp profile on zimaboard-1 before reconciling the CronJob.
CI guardrails
scripts/ci/offline-checks.sh grew a new assertion block that validates the rendered media-postgres-restore-verification CronJob and its accompanying NetworkPolicy. The checks enforce concurrencyPolicy: Forbid, no service‑account token automount, runAsUser: 65534 / runAsGroup: 65534, a node selector pinning to zimaboard-1, the Talos Unix‑only localhost seccomp profile, all capabilities dropped, and a file‑based termination message at /root/restore-termination-log. The NetworkPolicy must also exist and be singular.
Verification and next steps
After the GitOps sync, confirm the CronJob and NetworkPolicy appear without validation errors. Trigger a manual run or wait for the 04:45 schedule, then check the Job’s Complete condition and read the .restore-verification receipt from the QNAP mount via talosctl. If the seccomp profile is not materialized on zimaboard-1, the Talos node will reject the pod—verify the profile first. The disaster‑recovery overlay can be applied to suspend both the backup and verification CronJobs in a single operation.