User and operator guide · Deployment
High Availability
On this page
PurposeHA OutcomeProduction BaselineReference TopologySupported HA PatternsPattern A: Managed PostgreSQL With Stable Writer EndpointPattern B: Self-Managed PostgreSQL With Pgpool-II And HA ControllerPattern C: Docker Lab Failover DemonstrationAtlas Stateful DependenciesDatabase URL ContractPostgreSQL HA Design DecisionsBuild Procedure1. Select The HA Database Pattern2. Create PostgreSQL Roles And Databases3. Require TLS To PostgreSQL4. Deploy PostgreSQL With Replication And Failover5. Place Pgpool-II In Front Of PostgreSQL6. Configure Atlas Services To Use Pgpool7. Size Connections8. Configure Shared Cache And Sessions9. Configure RabbitMQ Or Managed Broker HA10. Configure Vault Or Secret Provider HA11. Configure Application Replica HA12. Control Migrations|
Important
|
Atlas high availability is an application, database, cache, broker, secrets, ingress, and operations property. Running more Atlas pods is not sufficient. Production HA requires a replicated PostgreSQL topology with tested failover, a stable database endpoint, shared cache/session infrastructure, durable event delivery, externalized secrets, backups, monitoring, and repeatable failover drills. |
Purpose
This page describes a production high-availability setup for Atlas using PostgreSQL, Pgpool-II, and supporting platform services. It is written for operators who need Atlas to survive node loss, pod restarts, database failover, rolling upgrades, and ingress maintenance without turning demos into unsupported production infrastructure.
Use this page with:
-
deployment:kubernetes-deployment.html for Kubernetes deployment mechanics.
-
deployment:reverse-proxy.html for ingress, reverse proxy, TLS, WebSocket, and forwarded-header requirements.
-
deployment:enterprise-deployment.html for enterprise evidence, approval, and operational handoff.
-
security:certificate-authority-management.html for CA ownership and TLS trust-bundle evidence.
HA Outcome
The target outcome is that Atlas operators can demonstrate:
-
two or more Atlas application replicas can serve traffic behind a load balancer
-
no Atlas application pod stores authoritative user, policy, session, audit, or lifecycle state only on local disk
-
every Atlas service that needs PostgreSQL connects through an HA endpoint rather than a single primary hostname
-
PostgreSQL primary failure promotes or selects a healthy primary without changing Atlas configuration
-
Atlas Cache or Redis-compatible session storage is shared and highly available
-
RabbitMQ or the selected broker survives one broker-node loss without losing required events
-
Vault or the enterprise secret provider is highly available and recoverable
-
gateway, API, authentication, lifecycle, policy, and audit workflows continue after controlled rolling restarts
-
backup, restore, point-in-time recovery, and failover drills have current evidence
This page does not claim that Atlas replaces every capability of a managed identity platform. It defines the infrastructure floor required before Atlas can credibly support enterprise IAM availability expectations for ICAM/IGA workflows.
Production Baseline
Minimum production HA requires the following baseline.
| Layer | Requirement | Why it matters |
|---|---|---|
Ingress |
Two or more ingress/load-balancer instances or a managed regional load balancer; TLS enabled; proxy headers preserved as documented in deployment:reverse-proxy.html. |
Atlas must keep the same public origin during pod, node, or gateway failover. SAML, OIDC, WebAuthn, cookies, and callback URLs are origin-sensitive. |
Atlas application plane |
At least two replicas for gateway and stateless services that are in the traffic path, with readiness probes and PodDisruptionBudgets. |
Rolling updates and node loss should not remove the only serving process. |
PostgreSQL |
One primary and at least two standby nodes across failure domains, with tested automatic failover and point-in-time recovery. |
Identity, authorization, lifecycle, governance, directory, and audit-adjacent state depend on durable relational storage. |
Database endpoint |
Pgpool-II, a managed database writer endpoint, or an equivalent stable service endpoint. |
Atlas configuration should not change during database failover. |
Session/cache |
Highly available Atlas Cache or managed Redis-compatible service, reachable by every Atlas replica. |
Sticky sessions are not a substitute for shared session and revocation state. |
Event broker |
RabbitMQ cluster using quorum queues or an approved managed broker equivalent. |
Authentication, session, lifecycle, and governance events must survive broker-node loss. |
Secrets |
Vault HA, cloud KMS-backed secret manager, or enterprise secret provider with rotation, recovery, and audit logs. |
Database credentials, JWT keys, SCIM tokens, SAML keys, and TLS private keys must not depend on a single pod or local file. |
Audit and evidence |
Authoritative logs are shipped to a durable log platform or SIEM, with retention and integrity controls. |
Local pod logs are not an HA audit record. |
Backups |
PostgreSQL base backups plus WAL archiving, restore tests, and documented RPO/RTO. |
Failover protects availability; backups protect recoverability. |
Reference Topology
The drawing shows Pgpool-II as the stable endpoint and routing layer. Pgpool-II does not replace the PostgreSQL failover controller. Use Patroni, CloudNativePG, EDB Postgres for Kubernetes, a managed PostgreSQL service, or another approved HA controller to perform leader election, promotion, fencing, and replication management.
Supported HA Patterns
Pattern A: Managed PostgreSQL With Stable Writer Endpoint
Use this pattern when the enterprise platform already provides Amazon Aurora/RDS, Google Cloud SQL, Azure Database for PostgreSQL, Crunchy Bridge, EDB, or an equivalent managed PostgreSQL service.
Required operator actions:
-
Request a production PostgreSQL cluster with multi-AZ or equivalent zone redundancy.
-
Enable TLS and require verified server certificates from Atlas workloads.
-
Create an Atlas database role that is not a PostgreSQL superuser.
-
Create separate roles for application access, migrations, monitoring, backup, and Pgpool health checks when Pgpool remains in front of the managed endpoint.
-
Point Atlas
*_DATABASE_URLvariables at the managed writer endpoint or at Pgpool in front of that endpoint. -
Confirm that failover keeps the same DNS name or service endpoint.
-
Capture failover drill evidence before accepting production traffic.
This is the preferred pattern when the organization already trusts the managed database control plane. It reduces the amount of database cluster automation that the Atlas team must operate.
Pattern B: Self-Managed PostgreSQL With Pgpool-II And HA Controller
Use this pattern when Atlas must run in a Kubernetes cluster, disconnected environment, classified environment, or platform where managed PostgreSQL is unavailable.
Required components:
-
PostgreSQL primary plus at least two standbys
-
synchronous or asynchronous streaming replication selected by RPO requirements
-
an HA controller such as Patroni or a Kubernetes PostgreSQL operator
-
Pgpool-II replicas for stable client endpoint, health checks, and optional connection pooling
-
persistent volumes on approved encrypted storage classes
-
WAL archiving to durable storage
-
automated base backups
-
tested restore runbook
Do not deploy a single PostgreSQL StatefulSet from demo manifests and call it HA. The k8s/components/infrastructure and docker/atlas-infrastructure.yml assets exist for demo and validation support unless the platform team explicitly accepts and hardens them.
Pattern C: Docker Lab Failover Demonstration
Docker Compose can demonstrate the shape of HA, but it is not a production HA deployment. Use it only for operator training, local failure injection, and documentation rehearsal.
Acceptable Docker lab goals:
-
show that Atlas can use a Pgpool endpoint instead of a direct PostgreSQL host
-
rehearse which environment variables change when introducing Pgpool
-
demonstrate that Atlas application replicas must share database, cache, broker, and secret services
-
teach failover evidence collection
Do not use Docker Compose as production evidence for node-failure tolerance, storage failure tolerance, multi-zone PostgreSQL HA, or enterprise backup coverage.
Atlas Stateful Dependencies
| Dependency | Atlas use | HA requirement | Repository references |
|---|---|---|---|
PostgreSQL |
Identity, authentication, session records, Universal Directory data, authorization policy, governance, lifecycle jobs, application integrations, risk/device/PAM/incident domain stores where enabled. |
Replicated cluster with a stable endpoint, TLS, backup, restore, and failover evidence. |
Identity, authentication, session, directory, authorization, governance, and lifecycle service configuration. |
Atlas Cache / Redis-compatible cache |
Session state, revocation state, trust/cache data, and runtime coordination depending on enabled modules. |
Shared HA cache endpoint. Do not rely on per-pod memory or local cache when more than one replica is active. |
|
RabbitMQ / event broker |
Authentication and session events, lifecycle events, governance workflows, asynchronous jobs. |
Three-node broker cluster or managed broker with quorum queues, durable exchanges, TLS, and monitored queue depth. |
|
Vault / secret provider |
JWT keys, database credentials, SAML/OIDC secrets, SCIM bearer tokens, TLS material, audit Merkle material. |
HA secret provider with sealed/unsealed state monitored, recovery keys controlled, and rotation evidence. |
|
Ingress / reverse proxy |
Browser access, API access, SAML/OIDC callbacks, WebAuthn origin checks, CAC/PIV flows, optional WebSockets. |
HA load balancer or ingress with correct forwarded headers and TLS behavior. |
|
Audit and logs |
Operational audit, identity lifecycle evidence, authentication traceability, security validation evidence. |
Logs must be shipped to durable centralized storage or SIEM. Local container logs are insufficient as the authoritative record. |
deployment:enterprise-deployment.html and the configured audit/log forwarding path. |
Database URL Contract
Atlas services should connect to the database endpoint through service-specific environment variables. In HA deployments, these variables should resolve to Pgpool-II, a managed writer endpoint, or another stable HA database endpoint, not to an individual PostgreSQL primary pod.
| Variable | Used by | HA instruction |
|---|---|---|
|
Identity service. |
Point to the HA PostgreSQL endpoint. Size connection pools against the number of identity replicas. |
|
Authentication service and direct MFA backend. |
Point to the HA PostgreSQL endpoint. Authentication writes must route to the current primary. |
|
Session service. |
Point to the HA PostgreSQL endpoint for durable session records. |
|
Directory service. |
Point to the HA PostgreSQL endpoint so LDAP/Universal Directory reads survive primary replacement. |
|
Authorization/PDP service. |
Point to the HA PostgreSQL endpoint because policy catalog loading fails closed when the URL is missing. |
|
Governance service. |
Point to the HA PostgreSQL endpoint outside development/test environments. |
|
Lifecycle and SCIM runtime. |
Point to the HA PostgreSQL endpoint. If omitted, the gateway can fall back to |
|
Gateway direct identity backend, lifecycle fallback, Vector Registry, and revisioned Advanced group-rule state. |
Required when Vector authoring or Advanced group rules are enabled in production. Point every gateway replica to the same HA endpoint; |
|
API access service when enabled. |
Point to the HA PostgreSQL endpoint or a service-specific database behind the same HA posture. |
|
PAM service when enabled. |
Point to the HA PostgreSQL endpoint or a service-specific database behind the same HA posture. |
|
Risk service when enabled. |
Point to the HA PostgreSQL endpoint or a service-specific database behind the same HA posture. |
|
Device assurance service when enabled. |
Point to the HA PostgreSQL endpoint or a service-specific database behind the same HA posture. |
|
Mission service when enabled. |
Point to the HA PostgreSQL endpoint or a service-specific database behind the same HA posture. |
|
Incident service when enabled. |
Point to the HA PostgreSQL endpoint or a service-specific database behind the same HA posture. |
|
Oracle compatibility service when enabled. |
Point to the HA PostgreSQL endpoint or a service-specific database behind the same HA posture. |
|
DDIL runtime when enabled. |
Point to the HA PostgreSQL endpoint. Document disconnected-mode behavior separately from normal HA. |
If a service still falls back to ATLAS_PHASE4_DATABASE_URL or generic DATABASE_URL, treat that as compatibility behavior, not the production contract. Production manifests should set the service-specific variable explicitly so failover evidence can be mapped to a named Atlas component.
PostgreSQL HA Design Decisions
Record these decisions before deployment.
| Decision | Recommended default | When to change it |
|---|---|---|
Database layout |
One PostgreSQL cluster with separate databases or schemas per Atlas domain, separate roles per service, and shared backup policy. |
Use separate clusters only when compliance, noisy-neighbor risk, data residency, or independent recovery windows require it. |
Failover controller |
Managed PostgreSQL control plane, Patroni, CloudNativePG, EDB operator, Crunchy operator, or another approved controller. |
Do not ask Pgpool alone to solve leader election, promotion safety, and fencing. |
Pgpool role |
Stable endpoint, health checks, connection control, and optional conservative read routing. |
Remove Pgpool only when the managed provider endpoint already satisfies endpoint stability, pooling, TLS, observability, and failover requirements. |
Read load balancing |
Disabled at first. |
Enable only after confirming every Atlas query path tolerates replica lag, transaction semantics, and read-after-write requirements. |
Replication mode |
Asynchronous streaming replication with strict RPO documentation, or synchronous replication for workflows that require lower data-loss exposure. |
Use synchronous replication only after measuring write latency and failure behavior across the selected failure domains. |
TLS |
|
Use weaker settings only for local lab testing. |
Connection pooling |
Conservative database/sql pools plus Pgpool limits sized below PostgreSQL capacity. |
Increase only after load testing and observing connection saturation, transaction latency, lock waits, and memory pressure. |
Migrations |
Run as a controlled one-shot job before scaling application replicas. |
Allow application-start migrations only where the code path is proven idempotent and guarded against concurrent execution. |
Build Procedure
1. Select The HA Database Pattern
Choose one pattern and record it in the deployment evidence:
-
managed PostgreSQL with native HA endpoint
-
self-managed PostgreSQL with Patroni or approved PostgreSQL operator plus Pgpool-II
-
disconnected/self-contained PostgreSQL HA for classified or DDIL environments
Record:
-
database owner
-
cluster name
-
namespaces or accounts used
-
database version
-
storage class or managed storage tier
-
regions, zones, or failure domains
-
backup destination
-
RPO and RTO
-
failover owner
-
restore owner
-
maintenance window
2. Create PostgreSQL Roles And Databases
Create at least these role classes:
| Role | Purpose | Required properties |
|---|---|---|
|
Runtime application access for Atlas services. |
No superuser; no replication; no createdb; least privileges on Atlas schemas. |
|
Schema migrations and controlled deployment changes. |
Has DDL permissions only for Atlas schemas; not used by steady-state pods. |
|
Pgpool health checks and service readiness validation. |
LOGIN only; can connect to health-check database; no write privileges. |
|
Database and replication monitoring. |
Read-only monitoring role; may need |
|
Backup and restore automation where not provider-managed. |
Limited to backup tooling requirements; credentials stored in secret manager. |
Use separate service roles when the deployment requires stronger blast-radius reduction:
-
atlas_identity_app -
atlas_authn_app -
atlas_session_app -
atlas_directory_app -
atlas_authz_app -
atlas_governance_app -
atlas_lifecycle_app
3. Require TLS To PostgreSQL
Atlas database URLs should use verified TLS in production.
postgresql://atlas_app:${ATLAS_DB_PASSWORD}@pgpool.atlas-db.svc.cluster.local:5432/atlas?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt
If client certificates are required:
postgresql://atlas_app:${ATLAS_DB_PASSWORD}@pgpool.atlas-db.svc.cluster.local:5432/atlas?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt&sslcert=/etc/atlas/db-client/tls.crt&sslkey=/etc/atlas/db-client/tls.key
Operator requirements:
-
mount the database CA bundle read-only into every Atlas pod that connects to PostgreSQL
-
rotate database server certificates through a rehearsed procedure
-
ensure Pgpool validates PostgreSQL backends when TLS is used between Pgpool and database nodes
-
preserve a separate trust chain for browser-facing TLS and database TLS unless the enterprise PKI policy explicitly combines them
-
document certificate subject names and DNS names used by
sslmode=verify-full
4. Deploy PostgreSQL With Replication And Failover
For self-managed PostgreSQL, the database platform team should provide:
-
primary and standby scheduling across failure domains
-
replication slots or equivalent retention policy sized for expected lag
-
WAL archiving to durable storage
-
automated base backups
-
failover controller configuration
-
fencing or split-brain prevention
-
anti-affinity and PodDisruptionBudgets
-
encrypted persistent volumes
-
upgrade procedure
-
restore procedure
Before connecting Atlas, verify from an operator workstation or validation pod:
psql "$ATLAS_DATABASE_ADMIN_URL" -c "select version();"
psql "$ATLAS_DATABASE_ADMIN_URL" -c "select pg_is_in_recovery();"
psql "$ATLAS_DATABASE_ADMIN_URL" -c "select application_name, state, sync_state, replay_lag from pg_stat_replication;"
Expected result:
-
the primary returns
pg_is_in_recovery = f -
standby nodes appear in replication views from the primary
-
replication lag is within the documented RPO
-
WAL archiving reports current successful archives
5. Place Pgpool-II In Front Of PostgreSQL
Use Pgpool-II as the endpoint Atlas services use when the managed database endpoint is not sufficient by itself.
Key rules:
-
run at least two Pgpool-II replicas behind a Kubernetes
Serviceor enterprise load balancer -
configure Pgpool backend nodes by stable DNS names
-
enable health checks
-
set
backend_clustering_mode = 'streaming-replication'for PostgreSQL streaming replication -
start with
load_balance_mode = off -
do not route read-after-write Atlas flows to stale standbys until the query paths are explicitly validated
-
set connection limits so Pgpool cannot exhaust PostgreSQL
-
restrict the Pgpool PCP/admin interface to operator networks only
-
store Pgpool credentials in the secret provider, not in ConfigMaps
Illustrative Pgpool settings:
listen_addresses = '*'
port = 5432
backend_clustering_mode = 'streaming-replication'
backend_hostname0 = 'postgres-0.postgres.atlas-db.svc.cluster.local'
backend_port0 = 5432
backend_weight0 = 0
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_application_name0 = 'postgres-0'
backend_hostname1 = 'postgres-1.postgres.atlas-db.svc.cluster.local'
backend_port1 = 5432
backend_weight1 = 0
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_application_name1 = 'postgres-1'
backend_hostname2 = 'postgres-2.postgres.atlas-db.svc.cluster.local'
backend_port2 = 5432
backend_weight2 = 0
backend_flag2 = 'ALLOW_TO_FAILOVER'
backend_application_name2 = 'postgres-2'
health_check_period = 10
health_check_timeout = 5
health_check_user = 'atlas_health'
health_check_database = 'postgres'
health_check_max_retries = 3
health_check_retry_delay = 2
sr_check_period = 10
sr_check_user = 'atlas_monitor'
sr_check_database = 'postgres'
delay_threshold_by_time = 5000
log_standby_delay = 'if_over_threshold'
load_balance_mode = off
disable_load_balance_on_write = 'transaction'
num_init_children = 64
max_pool = 2
reserved_connections = 4
enable_pool_hba = on
ssl = on
Tune these values for the actual Atlas replica count and PostgreSQL max_connections. The official Pgpool-II documentation notes that num_init_children is the concurrent client connection limit and that backend connections are approximately max_pool * num_init_children. Keep this below PostgreSQL capacity after reserving superuser, replication, health-check, backup, and operator connections.
6. Configure Atlas Services To Use Pgpool
Store database URLs in Kubernetes Secrets, Vault, or the enterprise secret provider. Do not place passwords in checked-in manifests.
Example Kubernetes secret shape:
apiVersion: v1
kind: Secret
metadata:
name: atlas-database-urls
namespace: atlas
type: Opaque
stringData:
ATLAS_IDENTITY_DATABASE_URL: "postgresql://atlas_identity_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_identity?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
ATLAS_AUTHN_DATABASE_URL: "postgresql://atlas_authn_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_authn?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
ATLAS_SESSION_DATABASE_URL: "postgresql://atlas_session_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_session?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
ATLAS_DIRECTORY_DATABASE_URL: "postgresql://atlas_directory_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_directory?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
ATLAS_AUTHZ_DATABASE_URL: "postgresql://atlas_authz_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_authz?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
ATLAS_GOVERNANCE_DATABASE_URL: "postgresql://atlas_governance_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_governance?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
ATLAS_LIFECYCLE_DATABASE_URL: "postgresql://atlas_lifecycle_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_lifecycle?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
ATLAS_API_GATEWAY_IDENTITY_DATABASE_URL: "postgresql://atlas_gateway_app:$PASSWORD@pgpool.atlas-db.svc.cluster.local:5432/atlas_identity?sslmode=verify-full&sslrootcert=/etc/atlas/db-ca/ca.crt"
Replace the placeholder password token with secret-manager injection, external-secrets rendering, sealed secret material, or another approved secret delivery mechanism. The example is a shape, not a manifest to commit with real values.
Every deployment that consumes these values should also mount the database CA bundle:
volumeMounts:
- name: atlas-db-ca
mountPath: /etc/atlas/db-ca
readOnly: true
volumes:
- name: atlas-db-ca
secret:
secretName: atlas-db-ca
7. Size Connections
Calculate maximum database pressure before scaling replicas.
total_possible_connections =
sum(service_replicas * max_open_connections_per_process)
+ pgpool_health_check_connections
+ pgpool_streaming_replication_check_connections
+ migration_connections
+ monitoring_connections
+ backup_connections
+ operator_reserved_connections
The result must be lower than:
postgres_max_connections - superuser_reserved_connections - reserved_connections
Initial guidance:
-
identity service defaults in
config/atlas/identity.yamlshowmax_connections: 100; reduce or override this in HA if multiple identity replicas would exceed database capacity -
atlas-authzsetsSetMaxOpenConns(4)andSetMaxIdleConns(2), which is suitable for a polling policy service but still multiplies by replica count -
services that rely on Go
database/sqldefaults should be reviewed before production load testing -
Pgpool
num_init_children * max_poolmust fit inside PostgreSQL limits -
keep spare PostgreSQL slots for failover, health checks, restore validation, and emergency operator access
Do not increase PostgreSQL max_connections as the only response to saturation. First reduce per-service pools, add Pgpool/PgBouncer where appropriate, and measure query latency, lock waits, deadlocks, and CPU/memory pressure.
8. Configure Shared Cache And Sessions
Atlas session HA requires shared cache/session state.
Set:
ATLAS_SESSION_REDIS_URL=rediss://atlas-cache.atlas-cache.svc.cluster.local:6379/0
Operator requirements:
-
use TLS for cache connections when supported by the selected cache service
-
enable authentication and rotate cache credentials
-
deploy cache replicas across failure domains
-
monitor memory saturation, evictions, replication lag, reconnects, and command latency
-
validate that login, logout, session revocation, and step-up authentication behavior works with multiple gateway/session replicas
-
avoid relying on ingress sticky sessions for correctness
Sticky sessions may reduce cross-node cache traffic, but Atlas HA must remain correct when the same user is routed to a different gateway replica.
9. Configure RabbitMQ Or Managed Broker HA
Authentication and session configuration reference RabbitMQ through:
ATLAS_AUTHN_RABBITMQ_URL=amqps://atlas-authn:$PASSWORD@rabbitmq.atlas-broker.svc.cluster.local:5671/atlas
ATLAS_SESSION_RABBITMQ_URL=amqps://atlas-session:$PASSWORD@rabbitmq.atlas-broker.svc.cluster.local:5671/atlas
Production broker requirements:
-
at least three RabbitMQ nodes or a managed broker with equivalent HA
-
quorum queues for durable workflow queues
-
durable exchanges and queues
-
publisher confirms for critical events where implemented
-
TLS for client connections
-
per-service users and permissions
-
monitored queue depth, redelivery rate, consumer count, unacked messages, and disk alarms
-
backup or declarative export of broker definitions
If a workflow is not yet durable through the broker, record it as an HA gap and test behavior under broker restart.
10. Configure Vault Or Secret Provider HA
Atlas services reference Vault settings in the configuration files. Production must use HA Vault, a cloud secret manager, or an enterprise secret provider.
Requirements:
-
no static root tokens in Kubernetes Secrets
-
workload identity, Kubernetes auth, SPIFFE/SPIRE, or platform-approved secret injection
-
Vault HA storage or managed secret backend
-
auto-unseal or documented operator unseal process
-
recovery keys controlled outside the Atlas namespace
-
audit logging enabled for secret reads and writes
-
secret rotation procedures for database credentials, JWT signing keys, SCIM tokens, SAML keys, OIDC client secrets, and TLS keys
-
break-glass access procedure
Validate that a rolling restart after credential rotation does not strand old replicas with invalid credentials.
11. Configure Application Replica HA
For Kubernetes deployments:
-
run at least two replicas for the gateway and traffic-path services
-
configure readiness probes so pods leave service endpoints before shutdown
-
configure liveness probes conservatively so dependency jitter does not cause restart storms
-
add PodDisruptionBudgets for gateway, authn, session, identity, lifecycle, policy, and any required domain services
-
set topology spread constraints or pod anti-affinity across nodes and zones
-
use rolling update settings that keep at least one ready replica during upgrades
-
prevent multiple replicas from running schema migrations concurrently unless the migration code is proven safe
Illustrative deployment controls:
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 1
template:
spec:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/part-of: atlas
Illustrative PodDisruptionBudget:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: atlas-gateway
namespace: atlas
spec:
minAvailable: 2
selector:
matchLabels:
app.kubernetes.io/name: atlas-gateway
12. Control Migrations
Schema changes are an availability risk. Treat migrations as a release phase, not a side effect of starting arbitrary replicas.
Recommended rollout:
-
Scale application replicas to the previous stable version.
-
Put the release under a change record.
-
Run migration prechecks against the Pgpool or managed writer endpoint.
-
Execute migrations once through a Kubernetes Job or controlled operator command using the
atlas_migratorrole. -
Verify schema version and required tables.
-
Roll application deployments.
-
Run live workflow checks.
-
Keep rollback SQL or restore decision points in the change record.
If a service currently calls EnsureSchema at startup, verify that the operation is idempotent and safe under concurrent pod starts. Until that is proven, deploy that service with one replica during first schema creation, then scale after the schema exists.
Ingress And Session Behavior
Use deployment:reverse-proxy.html for the complete reverse-proxy procedure. HA-specific requirements are:
-
every gateway replica must see the same public scheme and host through preserved
Host,X-Forwarded-Host,X-Forwarded-Proto, and related headers -
the proxy must strip spoofed incoming forwarded headers before setting trusted values
-
TLS termination must be documented, and edge-to-gateway TLS should remain enabled unless the environment records an approved exception
-
cookies must keep stable
Secure,HttpOnly,SameSite, path, and domain behavior across replicas -
SAML ACS URLs, OIDC redirect URIs, and WebAuthn origins must reference the load-balanced public URL
-
WebSocket upgrade headers must be preserved when WebSocket features are enabled
-
CAC/PIV and client-certificate behavior must be tested through the exact ingress path used by operators
-
sticky sessions may be enabled for efficiency, but correctness must not depend on stickiness
Failover Procedures
Planned PostgreSQL Switchover
Use this for maintenance or controlled primary replacement.
-
Announce the maintenance window and record expected impact.
-
Confirm Atlas application replicas are healthy.
-
Confirm Pgpool sees all PostgreSQL backends.
-
Confirm replication lag is inside the approved threshold.
-
Pause nonessential batch jobs if they create heavy write load.
-
Perform the managed database switchover or HA-controller switchover.
-
Confirm the new primary returns
pg_is_in_recovery = f. -
Confirm Pgpool routes writes to the new primary.
-
Restart Pgpool pods only if the selected controller requires it.
-
Run Atlas smoke tests.
-
Resume paused jobs.
-
Attach logs, commands, timestamps, and outcomes to the evidence record.
Validation commands:
psql "$ATLAS_AUTHN_DATABASE_URL" -c "select now(), inet_server_addr(), pg_is_in_recovery();"
psql "$ATLAS_AUTHN_DATABASE_URL" -c "show transaction_read_only;"
psql "$ATLAS_AUTHN_DATABASE_URL" -c "create temporary table atlas_ha_write_check(id int);"
Expected result:
-
pg_is_in_recoveryisffor the write endpoint -
transaction_read_onlyisoff -
temporary write check succeeds
-
Atlas login, session refresh, My Apps/application access, policy decision, lifecycle job read, and audit/event checks pass
Unplanned PostgreSQL Primary Failure
Use this drill before production and after database platform changes.
-
Start evidence capture.
-
Terminate or isolate the primary using the approved chaos/failover method.
-
Observe HA controller detection and promotion.
-
Observe Pgpool backend status and failover handling.
-
Watch Atlas gateway and service error rates.
-
Verify stale database connections reconnect without manual configuration changes.
-
Restart Atlas pods only if the application cannot recover existing pooled connections.
-
Run the same smoke tests as planned switchover.
-
Record actual detection time, promotion time, application error window, and full recovery time.
-
Compare results to the documented RTO/RPO.
Evidence to capture:
-
database HA-controller logs
-
Pgpool logs and
SHOW POOL NODES -
Atlas service logs around failover
-
ingress 5xx rate
-
authentication success/failure counts
-
failed lifecycle job count
-
replication lag before failure
-
selected new primary
-
any manual operator steps
Pgpool Failure
Pgpool must also be redundant.
Drill:
-
Run two or more Pgpool replicas.
-
Confirm the Atlas database DNS name resolves to the Pgpool service/load balancer.
-
Delete or stop one Pgpool pod.
-
Confirm existing and new Atlas database connections continue through remaining Pgpool pods.
-
Confirm Kubernetes or the process supervisor replaces the failed Pgpool instance.
-
Confirm no Atlas configuration changed.
If one Pgpool process is a single point of failure, the deployment is not HA even if PostgreSQL itself is replicated.
Atlas Pod Or Node Failure
Drill:
-
Start a user workflow: login, view application assignments, run a policy decision, start a lifecycle job.
-
Delete one gateway pod.
-
Delete one authn/session/identity pod.
-
Drain one Kubernetes node if the environment allows it.
-
Confirm the workflow continues or returns a bounded retryable error.
-
Confirm the user can continue on a different gateway replica without losing correctness.
-
Confirm session revocation and logout still work.
Expected result: no local pod contains authoritative state that prevents another replica from serving the next request.
Backup And Recovery
Failover is not backup. Backups must be tested independently.
PostgreSQL backup requirements:
-
base backups on a scheduled cadence
-
continuous WAL archiving for point-in-time recovery
-
backup encryption
-
backup integrity validation
-
restore tests into an isolated environment
-
documented RPO and RTO
-
retention policy aligned to compliance requirements
-
runbook for restoring a single database/schema where feasible
-
runbook for full-cluster restore
-
backup access controls and audit logs
Atlas recovery dependencies:
-
database backups must align with Vault/secret-provider recovery
-
JWT signing keys and SAML/OIDC keys must be recoverable or intentionally rotated with user-impact analysis
-
RabbitMQ definitions and durable queue state must be recoverable where workflows require it
-
cache data may be treated as transient only if session and revocation behavior after cache loss is acceptable and documented
-
audit logs should be recoverable from the authoritative log platform or SIEM, not only from PostgreSQL
Restore drill:
-
Select a restore timestamp.
-
Restore PostgreSQL into an isolated namespace or database environment.
-
Restore or provide matching secrets.
-
Start Atlas against the restored endpoint with external traffic blocked.
-
Validate identity lookup, authentication test user, policy catalog, lifecycle jobs, directory reads, and audit/event history.
-
Record data loss window and restore duration.
-
Destroy or secure the restored environment according to data-handling policy.
Observability And Alerts
Create alerts before accepting production traffic.
| Area | Alert | Reason |
|---|---|---|
Atlas gateway |
Replica count below minimum, readiness failures, high 5xx rate, login latency, callback errors. |
Detect user-facing availability loss. |
Authentication/session |
Authentication failure spike, session creation failure, cache connection failures, token signing errors. |
Detect identity-plane failures quickly. |
PostgreSQL primary |
Primary down, failover event, high CPU, high memory, disk saturation, WAL archiving failure. |
Protect the durable state plane. |
PostgreSQL replicas |
Replica down, replication lag above threshold, replication slot retained WAL growth. |
Prevent stale reads and failed failover. |
Pgpool |
Pgpool pod down, backend node down, all backends unavailable, connection saturation, health-check failures. |
Detect endpoint and routing failures. |
Connections |
PostgreSQL active connections near limit, Pgpool client connections near |
Avoid cascading application failures. |
Broker |
RabbitMQ node down, quorum queue unavailable, disk alarm, memory alarm, queue depth growth, unacked growth. |
Protect asynchronous lifecycle and auth/session event flow. |
Secrets |
Vault sealed, Vault standby unavailable, secret read failures, approaching certificate or credential expiry. |
Prevent authentication and database outage caused by secret loss. |
Backups |
Backup missing, WAL archive stale, restore validation overdue. |
Detect recoverability failure before an incident. |
Audit/logging |
SIEM forwarder down, log ingestion stale, audit integrity check failure. |
Maintain evidence and security traceability. |
Recommended dashboards:
-
Atlas request rate, error rate, and latency by route
-
authentication success/failure and MFA/CAC step-up outcomes
-
active sessions, revocations, and cache errors
-
database pool usage per service
-
Pgpool backend status and client saturation
-
PostgreSQL primary/standby health and replication lag
-
RabbitMQ queue depth and consumer health
-
Vault health and secret read errors
-
ingress TLS certificate expiry and callback errors
Validation Checklist
Run this checklist for every HA environment and after meaningful platform changes.
| Status | Check | Evidence |
|---|---|---|
|
Atlas gateway has at least two ready replicas. |
|
|
Identity/authn/session/lifecycle/policy services have HA replica counts or documented exceptions. |
Rendered manifests and runtime pod listing. |
|
All production |
Secret inventory with values redacted. |
|
Database TLS uses verified server certificates. |
Connection string policy and certificate-chain validation. |
|
PostgreSQL has primary plus at least two standbys or an approved managed equivalent. |
Database platform evidence. |
|
Pgpool has at least two replicas or the managed database endpoint replaces it by design. |
Pgpool pod/service listing or managed endpoint attestation. |
|
Read load balancing is disabled or explicitly validated for Atlas read-after-write behavior. |
Pgpool config and validation notes. |
|
PostgreSQL failover drill completed. |
Drill log with timestamps, RPO/RTO, Atlas smoke tests, and operator steps. |
|
Pgpool failure drill completed. |
Drill log and Atlas continuity evidence. |
|
Atlas pod and node failure drill completed. |
Drill log and user workflow validation. |
|
Backup and point-in-time restore tested. |
Restore evidence and data validation. |
|
Atlas Cache or Redis-compatible service is HA and shared. |
Cache topology, failover, and session validation. |
|
RabbitMQ or broker HA is configured and tested. |
Cluster/quorum evidence and queue behavior under node loss. |
|
Vault or secret provider HA is configured and tested. |
Health, unseal/recovery, auth method, and rotation evidence. |
|
Reverse proxy preserves required headers and supports TLS/WebSocket/callback behavior. |
deployment:reverse-proxy.html validation output. |
|
Alerts exist for Atlas, Pgpool, PostgreSQL, cache, broker, secrets, backups, and logging. |
Alert rule export and test notifications. |
Smoke Tests After Failover
Use application-level checks after each infrastructure failover. Infrastructure health alone is not enough.
Required workflow checks:
-
Load the Atlas login page through the public URL.
-
Complete the configured login path, including CAC/PIV, WebAuthn, MFA, OIDC, or SAML where enabled.
-
Confirm the session survives a gateway pod restart.
-
Open the Universal Directory or identity view and resolve a known user.
-
Open My Apps or an application assignment view.
-
Perform an authorization decision or policy-backed action.
-
Trigger or inspect a lifecycle/SCIM job.
-
Confirm RabbitMQ-backed events are consumed.
-
Confirm audit/log events appear in the authoritative log destination.
-
Log out and confirm session revocation.
Record:
-
exact public URL
-
user or test identity
-
timestamp
-
Atlas image tag or digest
-
database endpoint
-
failover event
-
observed user impact
-
failed checks and remediation
Common Failure Modes
| Symptom | Likely cause | Corrective action |
|---|---|---|
Atlas fails after database primary promotion. |
Services hold stale connections or Pgpool did not update backend state. |
Verify Pgpool node status, restart affected Pgpool pods if required, and confirm application reconnect behavior. Add a failover drill to release gates. |
Authentication works on one gateway replica but not another. |
Session/cache state is local, cache endpoint differs by pod, or secret material differs by replica. |
Use shared HA cache, common secret provider, and consistent config rendering. |
SAML or OIDC callbacks fail only after enabling ingress HA. |
Public host/scheme differs by proxy path or forwarded headers are not preserved. |
Apply deployment:reverse-proxy.html and validate callback URLs against the public load-balanced origin. |
WebAuthn fails after DNS or proxy changes. |
Relying party ID or origin no longer matches the public URL. |
Update WebAuthn configuration and retest through the production ingress path. |
Database reaches connection limit during failover. |
Replica count multiplied by service pools exceeds PostgreSQL/Pgpool capacity. |
Reduce per-service pools, lower Pgpool limits, add pooling, or increase database capacity after load testing. |
Lifecycle jobs duplicate or get stuck after pod restart. |
Job ownership, retry, or broker behavior is not validated for multiple replicas. |
Test lifecycle workers with concurrent replicas and broker failover; document singleton workers where required. |
Pgpool routes reads to stale standby. |
Load balancing enabled without read-after-write validation or lag thresholds. |
Disable read load balancing until query paths and lag controls are proven. |
Failover loses audit visibility. |
Logs are only on local pods or database restore does not include audit dependencies. |
Ship logs to durable SIEM/log storage and validate audit after failover and restore. |
Restore succeeds but Atlas cannot start. |
Secrets, certificates, or database roles were not restored with compatible versions. |
Include secret-provider recovery and CA material in restore drills. |
Acceptance Criteria
Atlas HA is acceptable only when all of the following are true:
-
all production Atlas database URLs use a stable HA endpoint
-
database TLS and trust bundles are validated
-
PostgreSQL failover drill has current passing evidence
-
Pgpool or managed endpoint failover has current passing evidence
-
application pod/node failure drill has current passing evidence
-
backup and restore drill has current passing evidence
-
cache, broker, and secret-provider HA have current passing evidence
-
ingress and reverse-proxy behavior is validated through the public URL
-
SAML/OIDC/WebAuthn/CAC/PIV flows used in the environment are tested through the HA ingress path
-
monitoring alerts are active and routed to owners
-
RPO/RTO targets are stated and matched by drill results
-
known non-HA workflows are documented as gaps with owner and remediation date
Operator Evidence Package
For each HA deployment or drill, store:
artifacts/deployment/ha/<run-id>/
source-revision.txt
rendered-manifests/
redacted-runtime-config/
database/
topology.txt
pgpool-show-pool-nodes.txt
replication-status.txt
failover-drill.log
restore-drill.log
application/
pods-before.txt
pods-after.txt
smoke-tests.log
atlas-errors.log
ingress/
public-url.txt
tls-chain.txt
reverse-proxy-validation.log
dependencies/
cache-health.txt
broker-health.txt
vault-health.txt
monitoring/
alert-rules.txt
dashboard-links.txt
decision/
rpo-rto-results.txt
exceptions-and-gaps.md
Do not store secret values in the evidence package. Redact database URLs, bearer tokens, private keys, session cookies, SAML assertions, OIDC tokens, and user PII unless the evidence repository is approved for those data types.