Skip to main content
This document describes the disaster recovery (DR) strategy, Recovery Time Objective (RTO), and Recovery Point Objective (RPO) for the Odin AI Platform AWS/EKS infrastructure. It covers built-in HA capabilities, active backup systems, recovery procedures, and known gaps.
For deployment instructions, see Terragrunt Deployment Guide.

Architecture & High Availability Summary

Infrastructure Components

Current HA Capabilities


RTO / RPO Targets


Backup Systems

1. Terraform / Terragrunt State — S3

What is backed up: All infrastructure state (EKS, networking, IAM, Helm releases). Implementation:
  • S3 bucket per environment: ekb-terraform-state-<env-name> (bootstrapped via terragrunt/environments/<env-name>/state/)
  • Versioning enabled — any previous state version can be restored
  • Server-side encryption (AES-256)
  • DynamoDB table for state locking
Recovery: Roll back to any previous state version in S3, then re-run terragrunt apply. RPO: Every terragrunt apply commit — continuous.

2. EBS Persistent Volumes — AWS Data Lifecycle Manager

What is backed up: EBS volumes attached to pods (Automator PostgreSQL, Supabase MinIO, any stateful workloads). Implementation: AWS Data Lifecycle Manager (DLM) policy targeting environment tags.
Recovery:
RPO: Up to 24 hours (daily snapshots). Reduce by increasing DLM schedule frequency.

3. CloudNativePG (HA Supabase DB) — Barman Cloud Backups

Applies to: Environments with ENABLE_CNPG=true and ENABLE_HA_SUPABASE_DB=true. What is backed up: The CloudNativePG Postgres cluster (ha-supabase-db), including continuous WAL (Write-Ahead Log) streaming to S3 or MinIO, and scheduled full base backups via CNPG ScheduledBackup CRD. Implementation (configured in values/ha-supabase-db.yaml):
Verify backup status:
Point-in-time recovery (PITR):
RPO: Near-zero for WAL-enabled clusters (seconds of lag, bounded by WAL upload interval).

4. ElastiCache Redis — Multi-AZ Replication

Applies to: Environments with ENABLE_AWS_SERVICES=true. Redis is not a primary data store — it holds transient cache and session data. DR focus is on fast failover rather than backup/restore. Implementation:
  • Multi-AZ enabled with automatic failover
  • Encryption at-rest and in-transit
  • A primary node failure promotes a replica automatically (< 1 min)
RPO: Redis data is ephemeral by design. Cache misses after failover are expected; the application re-populates from the database.

5. Amazon MQ (RabbitMQ) — Message Queue

Applies to: Environments with ENABLE_AWS_SERVICES=true. Implementation:
  • Single-instance (default) or active/standby deployment
  • In-flight messages may be lost during a broker restart; design consumers to be idempotent
  • Management UI available on port 15671 (SSL)
RPO: Single-instance — messages in-flight at time of failure may be lost. Use active/standby deployment mode to reduce this risk.

Auto-Recovery Mechanisms

Karpenter — Node Provisioning & Recovery

  • Consolidation: WhenEmptyOrUnderutilized — idle nodes are terminated automatically
  • Spot interruption handling: Listens to SQS interruption events; drains and replaces Spot nodes before termination
  • Node drift: Nodes using outdated AMIs or configs are replaced automatically when enable_drift = true
  • Recovery time: New node provisioned in 0–10 minutes

KEDA — Pod Autoscaling

  • Minimum replicas: 2 for all services (Web, API, Celery, Automator) — prevents single-point-of-failure
  • CPU threshold: 60–70% triggers scale-out
  • Memory threshold: 80% triggers scale-out
  • Scale-down stabilisation: 30 seconds — avoids flapping
  • Recovery time: Failed pods rescheduled within 0–2 minutes

Kubernetes Pod Anti-Affinity

All stateless services use preferredDuringSchedulingIgnoredDuringExecution anti-affinity on kubernetes.io/hostname to spread pods across nodes and AZs.

Recovery Procedures

Scenario 1: AZ Failure

Expected behaviour: Karpenter provisions replacement nodes in the remaining AZs; KEDA reschedules pods; ALB stops routing to unhealthy targets. Verification:
No manual intervention is required under normal circumstances.

Scenario 2: Postgres Primary Node Failure (CloudNativePG)

CloudNativePG automatically promotes a replica to primary.
Applications reconnect via PgBouncer — no connection string change needed.

Scenario 3: Restore EBS Volume from Snapshot


Scenario 4: Full Infrastructure Recreation

Used after catastrophic failure or when rebuilding a region.
Estimated RTO: 30–60 minutes for full cluster; 60–120 minutes if EBS/CNPG data must be restored.

Scenario 5: Terragrunt State Rollback


Observability & Alerting (SigNoz)

When ENABLE_SIGNOZ=true, SigNoz is deployed to the monitoring namespace and provides:
  • Distributed tracing for all Odin AI Platform services
  • Cluster metrics via the k8s-infra DaemonSet agent (CPU, memory, pod status)
  • Log aggregation from all pods
  • Alerting — configure alert rules in SigNoz to notify on pod crash loops, high error rates, or node pressure
For DR purposes, SigNoz dashboards are the primary tool for diagnosing and confirming recovery after an incident. SigNoz data itself is stored on EBS PVs and is covered by the EBS snapshot policy.

Gaps & Recommendations