003 — R6/R8: first-boot sops identity + build-time key pre-generation #3
Labels
No labels
needs-triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/machine-configs#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
003 — R6/R8: first-boot sops identity + build-time key pre-generation
Status: OPEN (unticketed — awaiting this repo's first commit + Forgejo remote)
Part of the hub architecture plan (flux-clusters / clusters#1532). Implements
R6(first-boot sops identity) andR8(pre-generate shared CA + host keys at build time) indocs/architecture-requirements.md.What to do
R6 — First-boot sops identity
sops needs a host identity at switch time to decrypt secrets. Plan:
sops.age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]installer-<host>configurations already embed the system closure; extend to embed host keys) so decryption works on first boot, offline.R8 — Build-time key pre-generation
The shared apiserver CA (R7, iac#40) and host identity material must be generated before the installer ISO is built, not on the target node. Extend the build-time pre-generation set:
secrets/<cluster>.sops.yaml, keysapiserver-ca/apiserver-ca-crt) — feeds R7's/var/lib/rancher/rke2/server/tls/seeding beforerke2-serverstarts.This is a one-time human/Vault-IaC step at CA-rotation boundaries, not per-host.
Acceptance criteria
/var/lib/rancher/rke2/server/tls/beforerke2-serverstarts (R7)Linked
docs/architecture-requirements.mdR6/R7/R8LOE estimate: 3–5 days (split into two independent halves)
R6 half — ~1 day, independent, start now
sops.age.sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]inmodules/base.nixis a one-liner.installer-<host>configs already embed the closure (flake.nixmkInstaller); extendingmodules/installer.nixto also drop the pre-generated/etc/ssh/ssh_host_ed25519_keyinto the ISO is the delta. Accept the documented trade-off: whoever holds the ISO holds the host key.task vm-run→ boot installed disk): first boot should decrypt sops offline with zero manual key injection — that's the R6 acceptance box, and the VM harness we already have makes it testable.R7/R8 half — ~2–4 days, depends on iac#40 (Vault CA)
secrets/<cluster>.sops.yamlasapiserver-ca/apiserver-ca-crt— a human/Vault-IaC step, not per-host code.modules/rke2.nixmust lay the CA material into/var/lib/rancher/rke2/server/tls/(server-ca.key,server-ca.crt+ support files) beforerke2-serverstarts. This means either apreStart/ordering unit in therke2-${role}service (rke2.nix:154) or extendingrke2-install.service(rke2.nix:175) — needs a careful look at rke2's actual TLS layout so the first server bootstraps with the shared CA rather than generating its own (the exact thing R7 warns about). Realistically this needs one boot-test iteration to confirm.R9 note (deploy key) — small, but flagging a mismatch
pull.nix).modules/base.nixsetsdeploy.flakeUrl = git+ssh://git@git.animeteamspeak.moe/ginjiruu/machine-configs(base.nix:82), but the actual repo/remote islab/machine-configs. The flake URL must be updated ornixos-pullwill fail on the timer. Worth fixing in the same change.Recommendation: start the R6 half now; hold R7/R8 until iac#40.