Using Atlas
Configuration
Every ATLAS_* setting and key rotation.
All settings are environment variables with the ATLAS_ prefix. The
annotated reference is .env.example. The most important
ones:
The node can also load a KEY=value file selected by ATLAS_CONFIG_FILE.
Non-empty environment values override file entries. Keep this file private
when it contains gossip keys or API tokens. TLS certificates already reload
automatically. Send SIGHUP to reload gossip keys, API tokens, node admission,
rate limits, trusted proxies, and log level. Listener, node identity, database,
TLS mode, and timing changes require a restart.
| Variable | Default | Description |
|---|---|---|
ATLAS_ENV | development | production enforces TLS. |
ATLAS_DEV | auto | Dev mode generates the gossip key and an API token into dev-credentials.json next to the database, enables DNS on :5353, and prints a start banner. auto enables it only in development with no key, credentials or seeds configured; true forces it (refused in production); false disables it. |
ATLAS_NODE_ID | hostname | Unique node name. |
ATLAS_REGION | local / FLY_REGION | Used for region-aware routing. |
ATLAS_SEEDS | โ | host:port list; DNS names may resolve to many nodes. |
ATLAS_ALLOWED_NODE_IDS | empty | Optional comma-separated node-ID admission allowlist; each node must list itself. |
ATLAS_GOSSIP_KEY ๐ | required | base64 256-bit key (atlas-cli keygen). |
ATLAS_GOSSIP_KEYS_SECONDARY ๐ | โ | Decrypt-only keys for rotation. |
ATLAS_API_TOKENS ๐ | one credential option | Comma-separated legacy tokens, โฅ 32 chars; grant full API access without expiry. |
ATLAS_API_CREDENTIALS ๐ | one credential option | JSON array of {token, scopes, expires_at}; scopes are read, write, admin; expiry is required RFC3339. |
ATLAS_TLS_ENABLED | false | HTTPS for the API (TLS 1.3). |
ATLAS_GRPC_ADDR | 0.0.0.0:8082 | gRPC listener using the same TLS and bearer-token settings. |
ATLAS_PPROF_ADDR | 127.0.0.1:6060 | Local-only Go pprof listener; configuration rejects non-loopback bind addresses. |
ATLAS_XDS_ADDR / ATLAS_XDS_CLUSTER | off / atlas_xds | Serve Envoy REST xDS (CDS and EDS) on this address; see Envoy (xDS). Production requires a loopback bind unless client certificates are required. |
ATLAS_CORS_ORIGINS | empty (* in dev mode) | Browser origins allowed to call the API, such as the Atlas Console's URL: comma-separated https://host[:port], or * for any. Tokens are still required and no cookies are used. |
ATLAS_LOCATION | empty | latitude,longitude for the console's cluster map. Unset, the map places the node by its region code (Fly.io, AWS, GCP, Azure). |
ATLAS_CONSOLE_URL | empty | Where the Atlas Console is hosted. / and /dashboard redirect there, and the dev-mode banner prints a one-click connect link. |
ATLAS_TRUSTED_PROXIES | empty | Comma-separated CIDRs allowed to supply X-Forwarded-For client addresses. Add the cluster's own network so forwarded writes are rate-limited per original client rather than per forwarding node. |
ATLAS_API_ADVERTISE_ADDR | derived | Base URL peers use to forward writes here, for example https://atlas-2.internal:8080. Unset, it's the gossip advertise host with the ATLAS_HTTP_ADDR port. With TLS, peers verify this name against the node certificate, which must also allow client authentication. |
ATLAS_DB_PATH | data/atlas.db | Per-node SQLite file for service registry persistence. |
ATLAS_HEALTH_CHECK_INTERVAL / _TIMEOUT | 5s / 1s | Default probe interval (a service can set check_interval_seconds) and the deadline for each probe. Up to 16 probes run at once. |
ATLAS_ORPHAN_SERVICE_REAP | 10m | Delete services whose owning node has been gone this long; 0 disables. Minimum 1m, so a restarting node keeps its services. |
ATLAS_ROUTING_STALE_POLICY | prefer-live | How lookups and DNS treat instances whose owning node isn't alive: include, prefer-live or exclude. |
ATLAS_ROUTING_LATENCY / _TOLERANCE | nearest / 5ms | Prefer the nearest measured nodes (nearest) or ignore latency (off); the tolerance makes nodes this close to the nearest count as equal. |
ATLAS_HISTORY_RETENTION | 168h | How long service change history is kept; 0 turns history off. |
ATLAS_ANALYTICS_ENABLED | false | Accept anonymous usage events from a hosted console at POST /v1/telemetry/event. Visitor IDs are stored only as day-scoped hashes; data is capped per day and kept 90 days. |
ATLAS_TELEMETRY_KEY ๐ | โ | Shared key (32+ characters) that telemetry events must carry. Without it, anyone can submit events and countries are ignored. |
ATLAS_TLS_CLIENT_AUTH | false | Require client certificates (mTLS). |
ATLAS_PROBE_INTERVAL / _TIMEOUT | 1s / 500ms | Failure-detector timing. |
ATLAS_SUSPICION_TIMEOUT | 5s | Time a suspect has to refute. |
ATLAS_GOSSIP_INTERVAL / _FANOUT | 200ms / 3 | Dissemination speed. |
Rotating the gossip key without downtime:
- Add the new key to
ATLAS_GOSSIP_KEYS_SECONDARYon all nodes and signal each node withSIGHUP(or roll them). - Swap: set the new key as
ATLAS_GOSSIP_KEYand the old one as secondary, then signal all nodes again. - Remove the old key and signal all nodes a final time.
Improve this pageSource: README.md