Aller au contenu principal
Platform

Disaster Recovery — RTO/RPO Matrix (per critical datastore)

Purpose (audit P3 — Recoverability): make recovery objectives explicit and honest per datastore, and surface which restores are proven (drill-tested) vs merely assumed. A backup you haven't restored is a hypothesis. DORA Art. 11–12 (business continuity) evidence.

Storage layers — where each copy lives (3-layer model)​

Three layers, each answering a different failure (not "more providers for their own sake"):

LayerWhereAnswersStatus
OperationalMinIO (controller, LAN 10.0.0.1:9000)fast local restore; day-to-day object storage✅ live
Disaster Recovery (off-site)Cloudflare R2physical loss of the controller/site — rebuild the SI✅ live — minicloud-backup-offsite (kine/vault/db) · minicloud-velero-offsite · minicloud-cnpg-offsite · minicloud-longhorn-offsite
Cyber Recovery (immutable)AWS S3 + Object Lockdeletion / corruption / ransomware — a backup an attacker-with-cluster-creds cannot erase❌ not built (target — crown jewels: Vault raft snapshot + kine + critical CNPG)

DR ≠ Cyber Recovery. R2 is off-site but its objects are deletable by anyone holding the creds — it survives a dead controller, not a compromised operator / ransomware that wipes the backups. That second failure needs immutable copies (Object Lock, independent provider) → the AWS S3 layer.

The backup tiers (increasing app-consistency)​

TierMechanismConsistencyScheduleOff-site (DR → R2)Immutable (cyber → S3)
VolumeVelero daily-full (all PVCs)crash-consistent03:00 UTC daily✅ minicloud-velero-offsite❌ (tool-GC'd — keep deletable)
Logicalpg_dump/dump → MinIO db-logical/ + db-backups/app-consistentdaily✅ mirror → minicloud-backup-offsite❌ → target: S3 Object Lock
CNPG PITRbarman WAL archive + streaming replicaapp-consistent, continuouscontinuous WAL✅ minicloud-cnpg-offsite❌ (barman-GC'd — keep deletable)
Kinek3s SQLite VACUUM INTO + integrity-checkapp-consistentdaily (+02:30 controller timer)✅ minicloud-backup-offsite/db-backups/kine❌ → target: S3 Object Lock
Vaultraft snapshot (vault-snapshot)app-consistentdaily (02:30 controller timer)✅ minicloud-backup-offsite/db-backups/vault❌ → target: S3 Object Lock

Immutable column — the rule (do not get this wrong): Object Lock = WORM = the object cannot be deleted until retention expires. Apply it only to the self-managed copies (kine · Vault raft snapshot · logical dumps — you own their retention). Never on tool-GC'd prefixes (Velero/Longhorn/barman) — those tools must delete old backups to manage incremental chains, and Object Lock would break their GC → pile-up/errors.

Off-site freshness IS alerted in-cluster (MinioR2MirrorStale on the backup-offsite-mirror CronJob, 26 h; + OffsiteRestoreVerifyStale). The ~3-day lag in the 2026-11-23→26 outage was the whole cluster being off (Prometheus down too) → an external heartbeat is the residual. See gap #6.

Only one restore is drill-proven: chat/synapse via app-restore-drill (CronJob 02:45 UTC → restores the latest dump into a throwaway Postgres and asserts table/row counts → AppRestoreDrillStale alert if it stops passing). Everything else's RTO/RPO below is an estimate from the backup type, not a measured restore — those are the gaps to close.

The matrix​

DatastoreRole / criticalityBackup(s)RPORTO (est.)Restore-tested?
authentik-cnpgSSO — criticalCNPG PITR + streaming replica + Velero~minutes (WAL)~10–20 min (PITR / promote)⚠️ replica-rebuild proven 2026-09-27; full PITR not drilled
chat/synapseMatrix chatlogical dump + Velero≤24 h~5–15 min✅ drill-proven (02:45 UTC)
ktayl-prod/ktayl-postgresinsurance business — criticalVelero volume ONLY≤24 h~15–30 min❌ + no app-consistent dump
erp/erpnext-mariadbHR/ERP — criticalVelero volume ONLY≤24 h~15–30 min❌ + no logical dump
retrieva/retrieva-postgrescert productlogical dump + Velero≤24 h~10 min❌ not drilled
nextcloud-postgresqlfiles/collablogical dump + Velero≤24 h~10 min❌
backstage-postgresqldev portallogical dump + Velero≤24 h~10 min❌
temporal-postgresqlworkflow engineVelero volume≤24 h~15 min❌
ai/postgresql-aiAI appsVelero volume≤24 h~15 min❌
vaultsecrets — criticalraft snapshot (db-backups/vault) + Velero≤24 h~10 min (+ KMS auto-unseal)❌ (unseal path proven; data restore not drilled)
langfuse-clickhouseLLM tracesVelero volume≤24 h~20 min❌ (low priority — recreatable)
ai/qdrantvector storeVelero volume≤24 hre-ingestn/a — re-ingestable
kine (control plane)cluster state — criticalSQLite backup (integrity-checked) + offsite≤24 h~5–40 min✅ integrity-verified + rebuild runbook (DR Scenario G)
Redis (nextcloud/langfuse/plane)caches— (none)n/arecreaten/a — ephemeral

RTO estimates assume the primary site is up and the restore target exists; a full site loss adds the DR-node / rebuild time (see Scenario F/G in the DR Runbook).

Recovery objectives — targets (by criticality tier)​

The matrix above is today's estimate; these are the objectives that should drive backup frequency, retention and the immutable-copy scope (objectives first, mechanism second):

TierScopeRPO targetRTO target
P0Vault · kine / K3s≤ 24 h30 min – 1 h
P0IAM / Authentik≤ 15 min (WAL)1 h
P1Ktayl business data≤ 15 min (WAL)2 h
P1Platform services≤ 24 h4 h
P2AI Platform≤ 24 h8 h
P3Observability history≤ 48 h24 h

The "≤ 15 min" RPO is met only where CNPG WAL PITR is wired (authentik etc.); ktayl-prod / erpnext are volume-only today → see gap #1. Targets are proposed, not yet validated by drill.

Honest DR posture + the gaps to close (priority order)​

Maturity ≈ level 3–4 (automated backups + offsite + documented restore + one tested restore). To reach level 5 (regularly-tested DR), the ordered gaps:

  1. ktayl-prod + erpnext have NO app-consistent backup — only crash-consistent Velero volume. These are the highest business criticality yet the weakest coverage. Action: add daily pg_dump (ktayl) / mysqldump (erpnext) CronJobs → MinIO db-logical/, same pattern as synapse.
  2. Expand the app-restore-drill pattern beyond synapse to the critical DBs — ktayl-prod, erpnext, authentik-cnpg (a CNPG PITR restore drill) — so their RTO/RPO become measured.
  3. Drill a full CNPG PITR restore for authentik-cnpg (only the replica-rebuild path is proven).
  4. Vault data-restore drill (the KMS auto-unseal path is proven; a raft-snapshot data restore is not).
  5. No immutable / cyber-recovery copy — every off-site copy is STANDARD (deletable): an operator or attacker holding the MinIO/R2 creds can erase all backups. Action: an AWS S3 + Object Lock vault (independent provider, Governance → Compliance) for the crown jewels (Vault raft snapshot + kine
    • 1 critical CNPG). Object Lock only on these self-managed copies, never on tool-GC'd prefixes. Pair it with scoped IAM (Backup-Writer: put-only, no delete · Recovery-Reader · Infra-Admin via OpenTofu · Break-glass) — the creds to recover Vault must not live only in Vault.
  6. No EXTERNAL (off-cluster) monitoring for a full-site outage — in-cluster freshness is already alerted (MinioR2MirrorStale on the backup-offsite-mirror CronJob @26 h, OffsiteRestoreVerifyStale, K3sSQLiteBackupStale, CNPGBackupStale — all in 00-prometheusrule.yaml). But those alerts live inside the cluster: when the whole platform is powered off (the 2026-11-23→26 outage), Prometheus + Alertmanager are down too, so the ~3-day off-site lag passed silently until power-on. Action: an off-cluster heartbeat (the cloud-adoption.md always-free AWS Lambda Anchor 1) that watches backup freshness / cluster liveness and pages when the platform itself is dark — the one thing in-cluster monitoring structurally cannot do.
  7. Full-site rebuild ("from zero") not drilled end-to-end — Scenario F/G are documented, but the RTO/RPO of a complete reconstruction (bootstrap → infra → control-plane → Vault unseal → platform → data → IS) is not measured. The break-glass kit (Shamir recovery keys + R2/S3 reader creds + age identity) must be proven reachable off-cluster — Vault auto-unseals via AWS KMS, so a "lost AWS" scenario needs the offline recovery keys, and Vaultwarden (on-cluster) can't be the only home.

What IS solid today​

  • Every PVC is offsited (Velero → R2) and the R2 BSL is Available again (P0-2b).
  • Crown jewels ARE off-site — kine + the Vault raft snapshot mirror to R2 minicloud-backup-offsite/db-backups/ (verified 2026-11-26), not MinIO-only. (What's still missing is immutability + external-outage monitoring, not the off-site copy itself — gaps #5/#6.)
  • Off-site is monitored AND restore-verified in-cluster — the backup-offsite-mirror CronJob (04:30 UTC, MinIO→R2) is alerted by MinioR2MirrorStale, and offsite-restore-verify + OffsiteRestoreVerifyStale prove the R2 copy actually restores (not just exists). The one blind spot is a full-cluster outage (in-cluster monitoring is down with it) → gap #6.
  • Synapse restore is continuously proven (drill + alert).
  • Control-plane (kine) backups are integrity-checked at write time + have a rehearsable rebuild runbook (Scenario G).
  • authentik-cnpg has continuous WAL PITR + a streaming replica (RPO minutes) — the best-protected DB.