Skip to content

Getting started

Quick start

One container, labelled containers, or a three-node cluster.

One container, no setup

docker run --rm -p 8080:8080 -p 5353:5353/udp ghcr.io/manziosee/atlas:edge

With nothing configured, the node starts in dev mode. It generates a gossip key and an API token, then prints the token and a curl example. It also turns on DNS on port 5353 and allows browser calls from any origin, so the Atlas Console can connect. Set ATLAS_CONSOLE_URL and the banner prints a one-click console link with the node and token filled in. Mount a volume on /data to keep the same token across restarts.

Dev mode switches itself off as soon as anything real is configured: ATLAS_ENV=production, a gossip key, API tokens or credentials, or seeds. A real deployment that forgets one secret therefore still fails at startup rather than running with generated ones. ATLAS_DEV=false turns dev mode off explicitly.

:edge is built from every push to main. Release tags publish :latest and versioned images.

Register containers without code changes

atlas-agent, which ships in the same image, watches the Docker socket and registers every container labeled atlas.name=<service>. It handles health, draining on stop and removal on exit. See docs/DOCKER_AGENT.md and the runnable example in deploy/docker-agent/.

docker run -d --label atlas.name=payments --label atlas.health=/healthz payments:1.4.2

Three-node cluster

Prerequisites: Docker (with Compose v2), Go 1.26+ (for local builds), OpenSSL and Bash (Git Bash works on Windows).

git clone https://github.com/manziosee/atlas && cd atlas

# 1. Create .env with freshly generated secrets (gossip key, API token, Grafana password)
./scripts/gen-secrets.sh

# 2. Start a 3-node cluster with Prometheus and Grafana
docker compose up --build -d

# 3. Ask any node about the cluster
export $(grep -E '^ATLAS_TOKEN=' .env)
docker compose exec atlas-1 atlas-cli members --addr http://127.0.0.1:8080 --token "$ATLAS_TOKEN"
ID       ADDRESS       REGION  STATE  INCARNATION    SINCE
atlas-1  atlas-1:7946  local   alive  1792277220551  42s
atlas-2  atlas-2:7946  local   alive  1792277220551  41s
atlas-3  atlas-3:7946  local   alive  1792277220550  41s
# 4. Break something and watch the cluster heal (includes packet loss,
#    latency, link flapping and node failure)
./scripts/chaos.sh 3

# 5. Run the authenticated API load profile (30 seconds by default)
docker compose --profile loadtest run --rm k6

# 6. Register a demo instance and query it through DNS (requires `dig`)
curl -fsS -H "Authorization: Bearer $ATLAS_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"name":"demo","address":"10.0.0.25:8080"}' \
  http://127.0.0.1:8081/v1/services
dig @127.0.0.1 -p 5353 demo.atlas A
dig @127.0.0.1 -p 5353 _demo._tcp.atlas SRV
ServiceURL
Node HTTP APIshttp://127.0.0.1:8081 · :8082 · :8083
Node gRPC APIs127.0.0.1:8084 · :8085 · :8086
Prometheushttp://127.0.0.1:9091
Grafanahttp://127.0.0.1:3000 (user admin, password in .env)

The chaos script starts a separate chaos Compose profile that applies Linux tc netem rules in the network namespaces of atlas-1 and atlas-2. Only those short-lived sidecars receive NET_ADMIN; the Atlas containers retain their normal dropped capabilities. The 200 ms delay stays below the default 250 ms direct-probe deadline (ATLAS_PROBE_TIMEOUT=500ms, with the direct probe using half that timeout), so the test exercises routing under measurable latency rather than intentionally forcing a timeout. The loss and flap checks allow suspicion but fail on a false dead declaration. Before each impairment the script waits until every node has reported three alive members and nothing suspect or dead for ten seconds, so leftover gossip from the earlier kill and partition rounds is not mistaken for a false declaration; the netem sidecars are recreated after nodes restart because a restart gives a node a new network namespace.

Turn on TLS locally:

./scripts/gen-certs.sh                       # local CA + server/client certs
# in .env: ATLAS_TLS_ENABLED=true, ATLAS_HEALTHCHECK_ADDR=https://127.0.0.1:8080
docker compose up -d
atlas-cli members --addr https://127.0.0.1:8081 --ca deploy/certs/ca.crt
Improve this pageSource: README.md, README.md, README.md