Repository navigation
Releases
Legion 0.3.0
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.
Legion 0.2.0
A web console that runs the cluster, image builds on the cluster, jailer merged in, the connections the nodes see, and legion top level with the console.
- Web console (CONSOLE.md, phases 2 to 7). Edit and deploy from YAML with the change shown first, forms for a service, Compose import and templates; alerts, usage history with charts, quotas, and log search; a Topology page that draws each namespace's services, tasks, routes and volumes, grouped by node; console settings and a banner; single sign-on with OIDC (users and groups in RoleBindings); several clusters in one console; plugins (pages from a Config, sandboxed); translations; accessibility checked with axe and the accessibility tree.
- Builds. Nodes labelled
legion.builder=truebuild images from a Git repository (Build,legion build-logs, the console's Build form), push them, and remove them afterwards. - jailer merged in. Building, running, testing and pushing OCI images of FreeBSD jails is now
legion buildandlegion local, on any FreeBSD host with or without a cluster, with signing, an SPDX SBOM and provenance. State moves from jailer's directory on first use. jailer's repository is archived. - Day-to-day operations.
legion restart,legion cronjob run, stop and start (stopped), pause and resume (paused), events per object (legion events), the load balancer's holder (legion lb), image details, scans (pkg audit) and what uses them, disk usage and pruning,legion diagnoseand support bundles (no Secrets), files andlegion cp, and stacks. - Connections seen.
legion connectionslists the connections the nodes' pf states hold between a namespace's services and from outside, each counted once across nodes; the console's Topology draws them as arcs, andlegion toplists them for a service. legion topdoes what the console does::runs anylegioncommand below the table,Eedits an object in$EDITORand applies it over the version read, and keys open diagnose, reach, connections, topology, audit, usage, images, snapshots, backup, files and build logs.legion topologyprints a namespace as the console's Topology draws it.- Upgrading: agents speak protocol 3 (pause); upgrade managers first, one at a time, then workers. The upgrade from 0.1.19 is tested.
Qualified
On FreeBSD 15.1-RELEASE-p6 amd64, three KVM VMs (lab base 5): the full manifest at profile cluster on 31f0743, 91 of 91 steps passed, nothing left behind. The port sysutils/legion passed poudriere testport on 15.1-RELEASE-p7 amd64. What legion local signs and attests was checked with cosign 3.1.3 (signature, SLSA provenance and SPDX SBOM verified with the key and refused with another) and the SBOM with the SPDX validator, on v0.2.0. arm64: the aarch64 tarball is built from the tag on FreeBSD 15.1-RELEASE-p6 arm64 (a VM), and its unit tests pass there (926, none failed); 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 (or aarch64, with that tarball), as root:
tar -xf legion-0.2.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).
Check the download with sha256 -c $(cat legion-0.2.0-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.2.0-freebsd15-amd64.tar.xz.
Legion 0.1.19
Measured performance, a CA that rotates in place, nodes that change roles, load-balancer addresses, VM pods, and a web console.
- Measured. Reconciliation, watches, endpoint propagation, pf as services grow, image pulls and loads, and the mesh as nodes join are each measured by a test that prints its table (docs/MEASURE.md). Two got faster for what they showed: the planner handles 5,000 tasks in 78 ms (from 383), and adding a service at 1,000 services takes 0.9 s (from 4.2).
- CA rotation.
legion ca rotatemakes a new cluster CA, cross-signed by the old one; every manager and node moves to it by itself, and the rotation finishes once all have.legion ca statusshows each holder. - Roles in place.
legion node promote|demoteturns a worker into a manager or back without it leaving the cluster. - Placement. Affinity and anti-affinity between services, and priorities with preemption.
- Networking. Mesh relays for nodes behind NAT (
--mesh-nat,--mesh-relay). A service's load-balancer address (endpoint.loadBalancer), held with CARP by one ready node and moved when it fails. - Storage. Local volumes lost with their node are marked lost, and
legion volume restore --replacerefills them from a backup on another node. - VM pods. A container with
vmboots with bhyve on the pod's network. - Multi-arch images. Each node runs its own platform's image from a multi-arch index, as jailer builds them.
- Web console.
--console-listenserves a console from the daemon;legion console loginprints a one-time sign-in link. It works as the signed-in user, with the API's role checks and audit, and shows the cluster live. Teams apply YAML with a diff first, scale, change images, roll back, delete, edit labels, read a task's logs and open a terminal in it. Admins drain, pause, promote and remove nodes and edit their taints; move, back up and restore Volumes, including lost ones; rotate the CA, show and rotate join tokens, set autolock, back up the store, create users; and read the audit log. The Network page shows which services in a namespace may reach which, and on which ports (CONSOLE.md, phases 1 to 3). legion reach. What may reach what among a namespace's services, evaluated with the same rules the nodes' guards apply.- Fixed:
Cluster.Mecould answer from a replica that had not yet seen a role just given; an agent kept using a connection made with its old certificate after a CA rotation; a bare--advertisehad no port; a lost Volume could not be deleted while an unplaced task named it; a VM's disk-only image needed a command it doesn't have.
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.19-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); the upgrade path from the release before is tested on every release.
Check the download with sha256 -c $(cat legion-0.1.19-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.19-freebsd15-amd64.tar.xz.
Legion 0.1.18
Revocation, an audit trail, and jailer's images from build to recovery.
- Revocation. Deleting a user's RoleBinding ends their sessions (exec, logs, port-forward) and watches within 5 s. A manager removed with
legion delete nodeleaves the Raft membership, and its certificate is refused. - Audit. Changes, sessions and refusals are recorded in the replicated store where they first arrive, names only, never values:
legion auditlists them. Kept 30 days and at most 100 000 events by default. - jailer to Legion, end to end. One test takes an image built and signed by jailer through a cluster: pushed, run on three nodes, its data moved and restored after losing a node.
- Compose and Linux images, documented as tested: docs/COMPOSE.md lists what of a Compose file is taken, and docs/LINUX.md which Linux images run through FreeBSD's Linux ABI and which don't, and why.
- Examples: examples/, a static site on nginx and a counter on Redis, run as their READMEs say on every release.
- Fixed: static Linux programs (Go's,
gosu) ran nowhere:--linuxnow setskern.elf64.fallback_brandwhen the host left it unset. A Volume moving to a node that was only briefly unresponsive started its copy again elsewhere; it waits now.
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.18-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); the upgrade path from the release before is tested on every release.
Check the download with sha256 -c $(cat legion-0.1.18-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.18-freebsd15-amd64.tar.xz.
Legion 0.1.17
Image signatures.
- Image policies. An
ImagePolicylets a namespace run the images it covers only when they carry a good cosign key-pair signature by one of its keys. It is enforced, or only warns. An update under a policy waits, with its old tasks running, while the registry can't be read. The signature is checked on the digest the deployment runs, so a tag moved afterwards changes nothing. - Shared with jailer. Signatures are made and checked by one module,
legion_image::cosign, which jailer signs with, so what jailer signs is what Legion checks. - Fixed: an image covered by a policy and named by digest, or loaded onto the node, could start before its check. It waits for it now.
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.17-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); the upgrade path from the release before is tested on every release.
Check the download with sha256 -c $(cat legion-0.1.17-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.17-freebsd15-amd64.tar.xz.
Legion 0.1.16
Recovery: data that moves between nodes survives interruption, and a whole cluster can be rebuilt from backups. The first GitHub release since 0.1.12: what 0.1.13 to 0.1.15 added is summed up at the end.
New in 0.1.16
- Volume moves that are cut short lose nothing. A Volume moving to another node (a drain,
legion volume move) can be interrupted at any stage, by a daemon killed on either side or a full disk on the receiving node. The move resumes or is held, saying why, and nothing is lost or left behind. Tested with Postgres on real ZFS. - A cluster rebuilt from its backups. The restore drill loses every host of a cluster running Postgres and rebuilds it on new disks from three backups kept apart: the control state (
legion backup), the manager's keys, and the database's Volume (legion volume backup). The primary comes back with every row up to its backup, the replica copies it anew. 511 s on 2-CPU VMs, every stage timed. The order of a restore is in the design, under What to back up.
Since 0.1.12
legion doctorchecks whether a host can run Legion and says how to fix what it can't (0.1.13).- Image identity: a deployment runs the digests its tags named when it was made, on every node, and a rollback runs the old ones (0.1.14).
- Partitions:
onPartition: stopfor pods that must never run twice, a leader cut off from the majority stops answering heartbeats, and Volumes stay with tasks cut off until their node says they stopped (docs/PARTITIONS.md).legion node drain --waitfollows a drain to the end (0.1.15). - Versions: builds that can't work together refuse each other, saying which to upgrade first (0.1.15).
legion volume backupandlegion volume restore: crash-consistent snapshots of a Volume's data (0.1.15).
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.16-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); the upgrade path from the release before is tested on every release.
Check the download with sha256 -c $(cat legion-0.1.16-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.16-freebsd15-amd64.tar.xz.
Legion 0.1.12
A security fix and an ingress fix since 0.1.11. Upgrading is recommended.
Security:
- Secrets in errors: an environment value that couldn't be passed on, such as a Secret containing a NUL byte, was printed in the start error. That error reaches Task status, which namespace viewers can read. Errors now name the variable, never its value. A command not found no longer prints the
PATH, which can come from a Secret too. - Certificates after a namespace move: if a host moved to another namespace and the new namespace's Secret was missing or invalid, its backend went on serving HTTPS with the old namespace's certificate. Certificates are now held for the namespace they came from, so that host has none until its own Secret is readable.
For tools built on Legion's crates:
Client::check_loginchecks a registry login asdocker logindoes, andClient::check_realmis the https rule for where logins may go.inroot::resolveandinroot::walkinlegion-jailresolve a path inside a root as a jailed process would.login::decodeinlegion-apireads a Docker config entry.lb::missing_hooks_ofchecks any anchor's pf hooks, andProto::as_stris public.layer::compress_withcompresses a layer with any encoder, andlayer::set_flagsis public.
The project's direction is now in ROADMAP.MD.
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.12-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.
Check the download with sha256 -c $(cat legion-0.1.12-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.12-freebsd15-amd64.tar.xz.
Legion 0.1.11
Fixes from several rounds of code review since 0.1.7, many of them for security. Upgrading is recommended. (0.1.8, 0.1.9 and 0.1.10 were tagged but not released; their fixes are here.)
Before you upgrade
- Permissions: the data directory is now
0700and container records0600, however the daemon was started. Anything outside Legion that reads them as another user will lose access. - Network policy: pods now wait until
net.link.bridge.pfil_memberandnet.link.bridge.pfil_local_physare set, instead of starting with a warning. If those can't be set, pods don't start, and their tasks report why. - Tightened namespaces: a Namespace's current
securitynow applies to anything new made from specs admitted earlier. Tasks refused this way waitpendingwith the reason, tasks not yet started are stopped, and CronJob runs are skipped. Tasks already running keep what they started with. - Shared storage: a second Volume naming storage that one node at a time may use (the same iSCSI LUN, or the same plugin volume) is refused.
- Exec output: an exec, and so an exec probe, keeps the first 1 MiB of each of stdout and stderr. The rest is read and dropped.
New since 0.1.9
Security:
- Secrets on disk: container records hold environments, Secrets among them, and a daemon started by hand under a umask of
022left them readable by other users on the host. - Revoked permissions: tightening a Namespace didn't reach tasks made from specs admitted earlier, so CronJob runs could keep permissions it no longer allowed.
- Network policy that didn't hold: if bridge filtering couldn't be enabled, the failure was only logged, and pods started with traffic bypassing their rules.
- Exec probes: a noisy probe could use up the agent's memory, outside its jail's limits.
- One storage, two Volumes: two Volumes naming one iSCSI LUN could be mounted on two nodes at once, across namespaces. Storage is now held by what it is, not by the Volume naming it.
- Watches and sessions: a follower authorized these on its own copy of the cluster, which may lag. It now catches up with the leader first.
- Removed nodes: registrations and renewals recheck removal against what they read, and a joined name is reserved by revoking its earlier certificate.
- Deleting: a Volume in use, or held by a live node, is not deleted, and deleting a running task stops it first.
Fixes:
- Loosened containers: pods whose containers used
rawSockets,chflagsorenforceStatfs: 1could not start, as FreeBSD refuses a child jail more than its parent has. The infra jail now allows what its containers ask for, and each container keeps its own profile. - Volume sizes: changing a ZFS Volume's size didn't reach a running task's dataset until the pod restarted. It now follows within the agent's resync period (30 seconds by default), growing or shrinking.
- Agent restarts: a stale status could have a healthy, running pod removed when the agent adopted it. Per-container restart state now survives a restart too.
- Limits: rctl limits are installed before any process starts.
- Failed containers: containers stopped as unhealthy or for memory count as failed, and failed stops are retried.
- Rollouts and updates: fixes to rollbacks, overtaken updates, stateful rollouts past an unready ordinal, and services or jobs recreated under one name.
- Volume moves and draining: fixes to migrations that were called off, drains of local and held volumes, and stateful data moving only to nodes its task may run on.
- CronJobs and global jobs: fixes to runs due as the last one finishes, runs after a lost status write, and global jobs on closed or draining nodes.
- ACME: a certificate is written only over the Secret version that was checked, and only while the routes still ask for it.
- CARP: addresses move between virtual hosts, and other addresses on a virtual host are removed. Checked against real CARP on epairs.
- Exec: a dropped exec takes what it started with it, also on the caller's terminal, and job control is unchanged.
legion joinwaits out a cluster between leaders, for up to 15 seconds.- Images and jails: fixes to pruning, whiteouts, layers under flagged directories, and starts that fail or are dropped.
- Compose and CLI: fixes to
x-legion, bare ports beside published ones, andlegion top.
From 0.1.8 and 0.1.9
Security:
-
Users' rights through a follower: a follower manager checked a user's rights on its own copy of the cluster, which may lag, then forwarded the request to the leader with a manager's rights. Now only the manager that serves a request checks the user's rights, so a RoleBinding just made on the leader is honoured at once.
-
Removing a worker: deleting a Node didn't keep the worker out; its agent registered again. Now its certificates issued before the removal are refused, renewals included, until it joins again with a token. Its open streams (assignments, endpoints, peers, policies, routes, sessions) end within 5 seconds. A Node delete refused for a stale version no longer records the node as removed.
-
Storage quotas: growing a stateful service's volume claim wasn't counted against its namespace's storage quota.
-
Links and special files: a build step could have the cleanup of its
resolv.conffollow a link onto the host. Reading an image's/etc/passwdcould block on a FIFO or read/dev/zerowithout end.legion image loadfollowed links inside an OCI layout. All three now refuse links and special files. -
Descriptor leak: every container inherited an open
/dev/nulldescriptor from the shim. -
ACME and registry clients: the ACME client no longer follows an authority to plain HTTP, and caps its answers at 1 MiB. The registry client sends logins only to HTTPS token servers, caps manifests at 4 MiB, cuts off a blob past its declared size, and times out stalled reads.
-
Key files:
node.keyandnode.crtwere written through one temporary file, so a key could be left world-readable. -
Certificate lifetimes: a huge
daysvalue crashed the request handler; lifetimes are now at most the CA's 10 years. -
Limits: objects are capped at 1 MiB, ingress TLS handshakes at 10 seconds, and usage reports at 4096 tasks per heartbeat. A node can't overwrite another node's task usage.
-
Autolock reseal: a reseal cut short could leave keys sealed under two unlock keys, or a key in the clear. Each key's new form is now written aside first, then committed with a marker that a restart or the next check carries through.
Fixes:
-
Mixed amd64/arm64 clusters: an image for another platform (including a single-platform image of another architecture, not checked before) is reported as such. The agent rejects the task, and the scheduler keeps the service's tasks off nodes of that platform as it was when they were rejected (a node given
--linuxsince may try again). -
Jobs and network policy: a Job's tasks could not reach their namespace's services under network policy. They now count as their namespace's, without DNS names or load balancing.
-
Volume moves: when the last part of a Volume's migration was sent again (after a failed mount or commit), the new node could never apply it. It now rolls back to the full copy and applies.
-
Image layers: a directory-mode layer cut short (by a crash or a full disk) was taken as complete. Layers are now made aside and renamed when whole.
-
Build steps: a working directory through a link (such as FreeBSD's
/home) was refused; it now resolves inside the image's root, as the jail does. -
Request metrics leaked memory for each answered call.
-
Updates across a leader change: a new leader took the failures already recorded for a running update as new ones, and could pause or roll back an update that was going well.
-
applyon the leader reads the latest state before it compares specs and checks quotas. -
Secrets and Configs on a lagging follower: a worker asking a follower for a task's data that the follower hadn't applied yet got an error; the follower now asks the leader.
-
logs -fno longer loses lines across a log rotation, nor a line written just as it starts. -
Volume plugins get a volume's options on unmount, as on mount.
-
IPv6: an IPv6 address advertised by a worker is kept whole: a bare one lost its last group, as if it were a port.
-
Long service names: task names cut to 63 bytes could clash, and in global mode could be invalid; long names now end in a hash.
-
The rc.d script quotes its directories.
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.11-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.
Check the download with sha256 -c $(cat legion-0.1.11-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.11-freebsd15-amd64.tar.xz.
Legion 0.1.7
HTTPS certificates from Let's Encrypt for ingress routes, HTTP/2 from clients, API metrics, the WireGuard key under autolock, and a fix to the image store.
New:
- Certificates from ACME: a route with
tls: { secret: shop-cert, acme: { email: ops@example.org } }has the leader manager order a certificate from Let's Encrypt (or another ACME directory,acme.directory) and keep it in the Secret, renewing it after two thirds of its life. Routes naming one Secret share a certificate for all their hosts. Validation is HTTP-01 on port 80, answered by every node's ingress proxy. The route's status shows when the certificate expires, or why the last order failed and when the next is.*.hosts are refused (they need a DNS challenge), and so is a Secret already holding something other than a certificate. Applying such a route accepts the authority's terms of service. - Ingress HTTP/2: clients may speak HTTP/2 (by ALPN over TLS, or its preface in the clear); connections to backends are kept open for the next request.
- API metrics: managers count the API's calls by method and code and time them (
legion_api_requests_total,legion_api_request_duration_seconds). - Autolock now seals a manager's WireGuard key along with its other private keys.
Fixes:
- Image store: two builds of one Containerfile with other layer compression (gzip, then zstd) were taken for one image, the second's layers replacing the first's under both tags. An image is now its manifest.
- From 0.1.6: a node that joined another cluster kept its old IPv6 bridge address, routing another node's subnet into its own bridge.
For tools built on Legion's crates (jailer): legion-sys's Sys trait has a new method, addr_policy_add; legion-api's route types have new fields (RouteTls::acme, NamespacedRoute::challenges).
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.7-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. A manager moves its WireGuard key from <data-dir>/wireguard.key into <data-dir>/pki/ on its first start, sealed if autolock is on.
Check the download with sha256 -c $(cat legion-0.1.7-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.7-freebsd15-amd64.tar.xz.
Legion 0.1.5
Fixes since 0.1.0, and the jail runtime and image store shared with jailer, the image builder made for Legion.
Fixes:
- Node roles: managers were recorded and listed as workers (
legion list nodes), sonode.role == managerplacement constraints matched no node. A node's role now comes from its certificate, and nodes already registered get it back when they next register. - Removing containers: removing a container right after it served a TCP connection could fail with "dataset is busy", its jail still dying while the connection timed out. Its root is now unmounted by force first.
- Failed starts: a container start that failed partway left mounts behind; a Linux container's
/dev/shmcould then be missing on the next start. A failed start now unmounts all it mounted. - IPv6 in pods: a pod's first connection to a site with an IPv6 address waited about 30 seconds: a new VNET has no address selection policies, so it tried IPv6 first, which pods cannot reach outside the cluster. Pods now get the host's IPv4-preferring table.
- Mount targets with
..are refused before anything is made for them. - Image store: copying a root without ZFS no longer goes through a temporary file in
/tmp; pushes and exports hold the image's files against a removal or prune meanwhile, and write the blobs they pack again by renaming them into place.
For tools built on Legion's crates (jailer):
legion-runtimeholds the runtime trait;legion-jailruns standalone containers on the host's addresses, attached runs and build steps (cleaned up when cancelled), and confines a container to CPUs with theorg.freebsd.jail.cpusetannotation;legion-imagekeeps layers as directories without ZFS, keeps blobs, registers built images (with manifest annotations), pins, exports and pushes;legion-net's pod network can use another bridge, interface prefix, IPv6 range (or none) and MTU.
Docs: IMAGES.md builds images with jailer; COMPARISON.md compares Legion with CBSD and BastilleBSD too.
Install
On FreeBSD 15 for amd64, as root:
tar -xf legion-0.1.5-freebsd15-amd64.tar.xz --strip-components 1 -C /usr/localthen follow Install in the README. To upgrade from 0.1.0: service legion stop, unpack as above, service legion start; running containers are adopted.
Check the download with sha256 -c $(cat legion-0.1.5-freebsd15-amd64.tar.xz.sha256 | cut -d ' ' -f 1) legion-0.1.5-freebsd15-amd64.tar.xz.