Guide HA installation on supported apt-based hosts - #888
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: MEDIUM The HA installer has three material reliability and credential-lifecycle risks. Findings[MEDIUM] Secret identities are no longer cryptographically validated
[MEDIUM] Automatic authentication bootstrap cannot recover from partial commits
[MEDIUM] Leaf certificates now remain valid for ten years without rotation
NotesNo changed protobuf wire definitions or mining-pool/wallet configuration were found. Generated by Codex Security Review | |
a5a9558 to
19afb50
Compare
19afb50 to
10499c6
Compare
10499c6 to
1db9142
Compare
1db9142 to
32a6e7a
Compare
32a6e7a to
a27e256
Compare
Select the HA NIC from a peer route, preserve exported bundle modes, and pin HA updates off in Compose. Reject conflicting input firewalls, re-arm local etcd startup monitoring, and bound fatal systemd restart loops.
Issue private HA service certificates for the same ten-year lifetime as the cluster CA, avoiding near-term certificate rotation work.
Export only role-scoped host bundles and the public service CA. Certificate rotation, host replacement, and disaster-recovery credentials remain out of scope.
- validate apt and firewall state before installing Fleet\n- reject orphaned container runtime state\n- limit the HA API container to NET_RAW
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c2d93b7ee
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
🤖 The two current Codex Security Review findings describe accepted reliability tradeoffs for the first guided-installer release:
These are not being treated as false positives. We are accepting the narrower failure behavior to keep this PR focused on the golden installation path and avoid roughly a few hundred lines of recovery and cryptographic prevalidation code. If qualification shows either failure mode occurring in normal operation, that evidence would justify expanding the installer. |
|
🤖 > HA firewall service cannot restart while its table exists Fixed in c5740ec. The service now ensures the profile-owned table exists, then validates and applies one nftables transaction that deletes and recreates it. On restart, the existing filtering rules remain active until nft atomically commits the replacement. The Go preflight path uses the same transaction shape. I kept validation focused rather than adding a privileged CI harness: the deployment profile and targeted Go tests pass, and the replacement transaction was applied twice successfully against nftables v1.1.3 inside an isolated network namespace on the qualification hardware. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5740ec42c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3591848c13
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reviewable diff: +2415/-255 across 22 files (excludes generated, test, and story files).
Summary
Adds a guided
fleet-ha installflow for dedicated Debian-based HA hosts. Operators no longer createnode.env, arrange secrets, or set file permissions by hand:ha-aprepares protected, role-specific host bundles, and each host installs with one local command. Supported targets are Debian 12/13, Ubuntu 22.04/24.04, 64-bit Raspberry Pi OS based on Debian 12/13, and compatible apt/systemd derivatives on amd64 or arm64 with 4096-byte pages.Stack: #888 -> #914 -> #890 -> #891. This PR targets
mainand provides the installed paths, services, and local operator workflow used by the HA promotion and application-update PRs above it. Merged #887 supplies local HA status and readiness checks. Host replacement, unattended installation, resume, rollback, SSH orchestration, and exact-artifact qualification remain outside this PR.How it works
The operator transfers the release archive and official checksum to
ha-a, verifies the archive before extraction, and runsfleet-ha installthroughssh -t. The wizard prompts for theha-b,ha-c, and VIP addresses, derivesha-a's LAN address and interface, validates the packaged runtime and dedicated host, shows the complete topology and planned changes, and requires the operator to typeINSTALLbefore mutation.The wizard creates three architecture-independent JSON host bundles and the public service CA certificate. Each bundle contains only the topology, release identity, and credentials required by its role; only
ha-areceives the one-time etcd root password. Before mutation, peer installation validates the protected bundle's size, exact fields, role, local host address, release identity, and certificates. The temporary CA private key is discarded because certificate rotation and host replacement are not supported by this initial installer.Each host follows stable phases for validation, package setup, configuration, image preparation, service startup, peer waiting, and final readiness. Docker is installed from its official Debian or Ubuntu apt repository when absent. An unused compatible Docker Engine and Compose v2 installation can be reused, as can inactive and unconfigured keepalived. Existing containers, orphaned container-runtime data without a working Docker installation, custom Docker configuration, configured or active keepalived, previous Proto Fleet state, occupied HA ports, and a claimed VIP fail before the release is copied or runtime services are installed.
Release packaging builds architecture-specific Fleet API and client images once, stores them in the checksum-covered
images/fleet.tar.gz, and pins Compose to the release version. The installer loads and verifies those exact tags; application startup uses--no-build --pull never, so target hosts do not rebuild Fleet from mutable registry inputs.The installer places the release under
/opt/proto-fleet, root-owned configuration under/etc/proto-fleet/ha, and data under/var/lib/proto-fleet/ha. Systemd persists firewall and startup ordering: networking and firewall precede Docker and etcd, Patroni starts on database hosts, Fleet starts after its dependencies, and keepalived advertises the VIP only when the local active endpoint is healthy.ha-aenables etcd authentication only after quorum. On restart, existing authentication must accept the generated root, Patroni, and Fleet credentials and expose the expected roles and DCS permissions; mismatches fail closed. Once the local etcd peer listener opens within one minute, the service remains enabled and waits without a fixed deadline while missing peers converge. Final startup still requires the local member to join a responding etcd quorum. Fatal local setup or service-start failures stop the incomplete local service.Areas of the code involved
server/cmd/fleet-ha/main.goinstall [HOST_BUNDLE]commandserver/internal/ha/deployment/guided_install.go.github/workflows/proto-fleet-artifact-build.ymlserver/internal/ha/deployment/install.goandpreflight.goserver/internal/ha/deployment/start.goandbootstrap.godeployment-files/ha/*_test.goanddeployment-files/ha/tests/Key technical decisions & trade-offs
NET_ADMINand retains onlyNET_RAWfor nmap discovery.Testing & validation
go test ./cmd/fleet-ha ./internal/ha/deployment -count=1./deployment-files/ha/tests/test-profile.shjust _lint-servergit diff --check