Repository navigation
Replicated databases, failover for Volumes, backups to S3, high availability you can see and fix, and a web console that runs all of it, with its documentation built in.
- Replicated databases (docs/REPLICATION.md). A stateful Service's
replicationhas its members replicate a database among themselves: Legion names the primary through Raft, and a plugin does the database's part. PostgreSQL is built in (libexec/legion/replication/postgres): replicas copied withpg_basebackup, an old primary brought back withpg_rewind, synchronous replicas, automatic or manual failover with the old primary fenced first, routing to the healthy primary (and<service>-readto the replicas), WAL archived to S3, point-in-time restore, andlegion replication status|switchover|failover. A drain, rolling update or scale-down hands the primary over rather than stopping it. The plugin interface (SPI v1) is open to other databases. - Volumes. A replica on another node takes over when its node is lost (
legion volume promote, orfailover: automatic); copies cut short resume where they stopped; sends are compressed; snapshots on a schedule; backups to a ZFS host, a directory or S3-compatible storage (AWS S3, MinIO, Garage, Ceph RGW, R2, B2), restored withlegion volume restore --from. - High availability.
legion halists the cluster's single points of failure, each with its fix (the console's Availability page has a Fix button for each). Witness managers (legion join --witness), a preferred leader (legion.lead=true) and a preferred primary, leadership handed on withlegion node lead, self-fencing pods (onPartition: stop) even when the daemon is dead, and tolerance of stalling networks (a node is down after 40 s, no elections from a manager cut off). - Operations. Alerts sent by webhook, ntfy or SMTP (
AlertReceiver); long operations followed (legion activity); drains, moves and deletions checked before they start; usage kept 30 days on every manager; nodes' hosts and ZFS pools with scrubs and pool alerts; a Namespace deleted only when empty, or--with-contents; ready-to-deploy apps (legion app). - Native images.
examples/base, FreeBSD's runtime image withpkg(35 MiB), and recipes on it for PostgreSQL 17, Redis, nginx, Node.js 24 and Python 3, each a console template. A Service running a Linux image says which native recipe runs the same. - Web console (CONSOLE.md, phases 7 to 12). Replication, nodes' pools, alert receivers, long operations and usage charts over 30 days; Topology with right-click and drag to move, duplicate or protect a Service and its data; one live stream per tab; built-in documentation (the Codex, F1 for the page you are on); a new look. A tab left open across an upgrade reloads itself.
- Metrics from every manager, not only the leader;
legion_task_info, ZFS space per node and Volume, replication lag.legion topgets ISPF-style panels and graphs. - Upgrading: agents and managers speak protocol 4; upgrade managers first, one at a time, then workers. The upgrade from 0.2.0 is tested. VM pods now need their Namespace to allow them (
spec.security.allow: [vm]). Queries summing a cluster metric across managers now count it once per manager: takemax without (instance)first. See CHANGELOG.md for everything (431 commits since 0.2.0).
Qualified
On FreeBSD 15.1-RELEASE amd64, three KVM VMs (lab base 4): every step of the manifest at profile cluster passed on the code released (the record at f0a4e69, then the steps whose code changed since at 883a2c7), with the console's browser tests driving headless Chrome on a desktop, as users do (at 711a2b6), and the upgrade drill from 0.2.0 (at 0103173). The commits after those are the lab scripts, docs and the version. The port sysutils/legion passed poudriere testport on 15.1-RELEASE-p7 amd64. What legion local signs and attests was checked on v0.3.0 with cosign (signature, SLSA provenance and SPDX SBOM verified with the key and refused with another) and the SBOM with the SPDX validator. arm64: no tarball for this release yet; the port builds on aarch64 from source as before, but arm64 has not been through the lab's privileged and cluster tests, so it is not yet called supported.
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.3.0-freebsd15-amd64.tar.xz --strip-components 1 -C /usr/localthen follow Install in the README. To upgrade: service legion stop, unpack as above, service legion start; running containers are adopted. Upgrade managers one at a time, then workers (see Versions in the design). With the port: pkg upgrade legion once the port is updated in the ports tree.
Check the download with sha256 -c $(cat legion-0.3.0-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.3.0-freebsd15-amd64.tar.xz.