Repository navigation
Description
Problem
v0.8.0 ships guest egress for the microVM tier (P4.1, #277), but deploy/sbx/install-host.sh — the
installer for the SBX0 service's KVM host — has no egress wiring at all. deploy/microvm/setup-microvm.sh
does it for the P6 microVM deployment; deploy/sbx was never taught the same.
What deploy/microvm has and deploy/sbx lacks:
| Piece | deploy/microvm |
deploy/sbx |
|---|---|---|
moca-egress binary |
install_egress_binary (setup-microvm.sh:305) |
— |
| allowlist env file, written only when absent | install_egress_env (setup-microvm.sh:321) |
— |
moca-egress.service |
install_units |
— |
| worker ordered after the proxy | After=/Wants=moca-egress.service (microvm-worker.service:55-56) |
— ([email protected]) |
MOCA_EGRESS_CONTROL_SOCK for the worker |
microvm-worker.service:166 |
— (neither the unit nor the per-worker env file install-host.sh:107-112 writes) |
| wait for the control socket, named failure | setup-microvm.sh:529-537 |
— |
Consequence: a host installed by deploy/sbx/install-host.sh runs workers with no egress, and the
v0.8.0 release note ("the per-Exec Firecracker microVMs behind mocactl sbx can now reach the outside
world") is true only on a host where egress was added by hand. The one live SBX0 host has it through
a manual drop-in (/etc/systemd/system/sbx-worker@<id>.service.d/egress.conf) plus a hand-installed
moca-egress.service and moca-egress.env — state that a re-install or a new host does not reproduce.
Proposed fix
install-host.shinstallsmoca-egress(binary from the bundle, or built),moca-egress.service,
and a seededmoca-egress.env(written only when absent, assetup-microvm.shdoes), reusing the
deploy/microvmfunctions rather than copying them.[email protected]gainsAfter=/Wants=moca-egress.serviceand
MOCA_EGRESS_CONTROL_SOCK=/run/moca-egress/control.sock. Onemoca-egressper host serves every
template worker (P4.1 T3).- The installer waits for the control socket before (re)starting workers and fails naming
journalctl -u moca-egress. install-host.sh --uninstall(therecordmanifest) removes what it installed.- An opt-out (
--no-egress) for a host that must stay offline; the worker then runs without
MOCA_EGRESS_CONTROL_SOCK, as today. - The installer refuses a snapshot built before P4.1 when egress is on, or at least warns: a pre-P4.1
snapshot has no guest egress listener (deploy/microvm/P4-ON-P6.md, "Guest egress"). deploy/sbx/tests/install-host.test.shcovers the new units and the env file;RUNBOOK.mdand the
sbx:install/sbx:upgradeprocedures describe egress and the allowlist.
Acceptance
- A fresh host from
install-host.shservescurl https://api.github.com/zenfrom inside a sandbox
(allowlisted), and a non-allowlisted host is refused with403 destination_denied. - The live host's manual drop-in can be deleted and a re-run of
install-host.shreproduces the
same behaviour.
Related
Prerequisite for per-user credential injection on SBX egress (spec to follow), whose moca-egress
credential client token and interception CA are installed by this same script.
Activity
fix(sbx): install-host.sh installs and wires moca-egress (#623)
fix(sbx): install-host.sh installs and wires moca-egress (#623)
Merge pull request #627 from rossoctl/feat/623-sbx-host-egress