Machines

Add computers; resources spread across them, move and restart elsewhere.

Overview

Join another computer and EnclaveStack places new resources wherever there is room. Networks span the machines, apps restart elsewhere when one goes offline, and you can move anything — data included — or drain a machine before you unplug it.

When to use it

  • More memory or disk than one computer has.
  • Keep apps running when one computer goes down.
  • Put disk-heavy work on the machine with the fast disk.

How it works

The agent
The same enclave program, run as an agent on the other computer, serving its Docker Engine and QEMU over HTTPS on port 7071.
Mutual TLS
An EnclaveStack certificate authority (ECDSA P-256) and one-time join codes valid for an hour.
WireGuard mesh
Networks span machines through an encrypted tunnel.

Each machine is checked every 10 seconds and is offline after 30 seconds of silence. Placement picks the online, schedulable machine with the most free memory, or the one you name, or one with the labels you ask for. A move copies the data first, then switches, keeping the address.

Architecture

Machines architectureOne control plane, an agent on each other computer, networks across them.mTLSWireGuardYouconsole · CLI · OpenTofuControl planeAPI · reconciler · SQLitemainDocker · QEMUrack-1 (agent)mutual TLS, port 7071
One control plane, an agent on each other computer, networks across them.
  • You to Control plane
  • Control plane to main
  • Control plane to rack-1 (agent): mTLS
  • main to rack-1 (agent): WireGuard

Flows

Joining a computer

  1. Add a machine; EnclaveStack prints a one-time join command.
  2. Run it on the other computer with Docker running.
  3. It shows online and takes new resources.

When a machine goes offline

  1. After 30 seconds without an answer it is offline.
  2. Apps without data restart on another machine after a minute.
  3. Data waits for its machine and carries on when it returns.

Set it up

In the console

  1. Open Machines and choose Add machine.
  2. Copy the join command.
  3. Run it on the other computer.

With the CLI

enclave machine add rack-1 --label disk=ssd

With OpenTofu

OpenTofu configuration
resource "enclave_machine" "rack_1" {
  name   = "rack-1"
  labels = { disk = "ssd" }
}

Settings reference

Every setting and output of the OpenTofu resource; the console and the CLI use the same names in their own words. Generated from platform 4d30582.

enclave_machine
NameTypeUseWhat it does
nametextrequiredMachine name. Changing it replaces the machine.
labelsmap of textoptionalLabels resources can ask for with machine_labels (up to 10). Change in place.
schedulabletrue or falseoptionalWhether new resources may be placed here (false keeps what runs there).
addresstextoutputWhere its agent is reached, once joined.
idtextoutputResource ID.
join_commandtextoutputThe command that joins the machine's agent, valid for an hour and once; empty once joined.
statetextoutputwaiting (for its agent), online or offline (refreshed on read).

Limits and security

Good to know

  • Machines must run the same minor version.
  • The main machine can’t be drained or removed.

Security

  • Agents accept only the control plane’s certificate; join codes work once.