Deploy from an alternative host
By default, a single admin workstation deploys the entire fleet (see
Deployment). A single deployer is a
single point of failure: if it goes down, no just apply is possible anymore.
You can promote an alternative host, typically a powerful and always-available
server, into a standalone backup deployer capable of managing the fleet
in place of the admin workstation.
The principle
Section titled “The principle”A deployer relies on only four elements. Two already exist on each host, two are prepared once.
| Element | Detail | To do |
|---|---|---|
| Tooling | colmena, just, sops (via an admin profile) | Enable a flag |
| Binary cache | harmonia specific to the deployer | Enable a service |
| Workspace | clone of the repository (config + framework) | Clone + sync |
SSH identity nix | already authorized on all hosts | Copy the private key |
The target topology : two deployers fed by a common source, each capable of deploying the fleet.
Enable the tooling
Section titled “Enable the tooling”Deployment tools ship with an admin home profile (e.g.
nix-admin), but remain hidden until the host declares itself an
admin host. Enable this flag on the alternative host:
# usr/machines/<hôte>/features.nixdarkone.admin.nix.enable = true;- The user who will deploy must have an admin home profile.
- On a headless server, the graphical packages of the profile are automatically excluded: the installed tooling stays lightweight.
Attach a binary cache
Section titled “Attach a binary cache”Recommended: give the deployer its own binary cache. It builds the fleet, then re-serves its derivations to other hosts.
services: harmonia: global: trueglobal: truemakes the cache reachable cross-zone via VPN, useful when the deployer and its targets are not in the same zone.- The signing key is already managed by sops, common to the whole network: nothing new to provision.
Set up
Section titled “Set up”-
Declare and deploy. From the admin workstation, apply the two options above, regenerate, then deploy the alternative host:
Fenêtre de terminal just generatejust apply <hôte> -
Clone the workspace on the alternative host, at the same path as on the admin workstation, with the framework sub-repository in the same location.
-
Share the source. A common git remote, or regular
pullfrom the admin workstation, keeps both deployers in sync. Only committed state is deployed. -
Copy the private key of the deployment user (
nix) to the alternative host, with600permissions and owned bynix:Fenêtre de terminal # on the alternative host/home/nix/.ssh/id_ed25519Its public key is already authorized across the entire fleet, so no redeployment of access rights is needed.
-
Validate from the alternative host:
Fenêtre de terminal colmena --versionjust apply <cible-témoin> test
Two deployers, one golden rule
Section titled “Two deployers, one golden rule”How far does this deployer go
Section titled “How far does this deployer go”| Usage | Admin sops key |
|---|---|
Deploy and inspect (apply, exec, enter, reboot) | Not required |
| Edit or manage secrets | Required |
Deployment alone does not need the admin key: secrets are decrypted on each target using its infra key. Only copy the admin key to the alternative host if you also want to manage secrets there.