Skip to content

autoops

A multi-region data and service mesh, run by a Makefile over SSH.

autoops sets up plain Debian hosts as one cluster: an encrypted WireGuard overlay network, S3-compatible object storage replicated across zones, and HTTPS ingress that routes to containers by their labels. It is a set of pyinfra modules run from your machine. There is no orchestrator and no shared state, and every binary and package is pinned and checksummed.

It is designed for 150–200 nodes.

Highly available data and service mesh

Components

Component Role Runs on
wesher WireGuard mesh overlay network every node
Garage S3-compatible object storage, replicated across zones every node
Docker runs the services, built from your own Dockerfiles every node
Traefik HTTPS ingress, Let's Encrypt certificates bastions
Redis Traefik's routing table bastions
traefik-kop publishes a worker's containers to the bastions' Redis workers
CrowdSec blocks abusive clients at the firewall bastions

A bastion is a node that takes public traffic; a worker runs services. Both are just groups in the inventory.

How routing works

On each worker, traefik-kop reads the traefik.* labels of the local containers and writes routers and services into the bastion's Redis, with the worker's overlay IP as the backend. Traefik on the bastion uses that Redis as its configuration provider. A new container with labels is therefore routed within seconds, and a service that runs on several workers is load balanced across them.

Redis listens on the overlay only. With several bastions, every worker publishes to each bastion's Redis, so any bastion can take the traffic and the bastions need no synchronized state.

Quickstart

You need two or more Debian hosts with root SSH access, and python3, make and curl on your machine.

git clone https://github.com/neospe/autoops && cd autoops
python3 -m venv .venv && . .venv/bin/activate && pip install -r requirements.txt
make assets                                  # wesher, garage, traefik-kop for x86_64 + aarch64, checksummed
cp examples/inventory.py inventory.py        # your hosts: IPs, SSH settings, hostname, zone
make FIRST_IP="203.0.113.10" nodes           # base system + firewall, docker, overlay network, S3 cluster
export REDIS_PWD="$(openssl rand -hex 16)"   # shared by redis on the bastion and traefik-kop on the workers
export DOMAIN="203-0-113-10.sslip.io"        # any name pointing at the bastion
make DOCKERFILES_PATH="examples/dockerfiles" services
make services-up
curl https://$DOMAIN/

The last request reaches the example whoami service on the worker, routed by Traefik on the bastion over the overlay, with a Let's Encrypt certificate. sslip.io gives a name for any IP, so this works without a domain of your own.

  • FIRST_IP is the node the cluster is bootstrapped from, here the bastion. See Nodes.
  • make nodes prints the S3 access key for the autoops bucket once. Save it.
  • Keep REDIS_PWD for later services runs.

Make targets

Target Does
assets downloads the pinned binaries and checks them (Supply chain)
nodes sets up the base system, Docker, the overlay and the S3 cluster (Nodes)
services copies the Dockerfiles and compose files and sets up Traefik and traefik-kop (Services)
services-up builds and starts the containers, then traefik-kop
deploy rebuilds one service and swaps its containers host by host (Operations)
care upgrades the APT packages
rotate rotates the Garage RPC secret or the S3 key (Operations)
rebuild-overlay builds a new overlay with a new key
check compiles the modules without touching any host

GROUP limits every target except rebuild-overlay to matching hosts or groups, e.g. make GROUP="worker*" care.

Performance

On two 1-vCPU cloud VMs, one bastion served about 1,200–1,600 HTTPS requests per second to a minimal backend. The overlay added well under 1 ms of latency. Losing a worker or restarting Traefik caused a few seconds of errors at most. Real services will usually be the bottleneck before the mesh is.