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 viaterragrunt/environments/<env-name>/state/) - Versioning enabled — any previous state version can be restored
- Server-side encryption (AES-256)
- DynamoDB table for state locking
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.3. CloudNativePG (HA Supabase DB) — Barman Cloud Backups
Applies to: Environments withENABLE_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):
4. ElastiCache Redis — Multi-AZ Replication
Applies to: Environments withENABLE_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)
5. Amazon MQ (RabbitMQ) — Message Queue
Applies to: Environments withENABLE_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)
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 usepreferredDuringSchedulingIgnoredDuringExecution 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.Scenario 3: Restore EBS Volume from Snapshot
Scenario 4: Full Infrastructure Recreation
Used after catastrophic failure or when rebuilding a region.Scenario 5: Terragrunt State Rollback
Observability & Alerting (SigNoz)
WhenENABLE_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

