c1 VLAN-20 rebuild: re-IP, dual-stack, BGP control plane (mc#27) #40

Merged
ginjiruu merged 7 commits from c1-vlan20-rebuild into main 2026-11-18 00:06:59 +00:00
Owner

Implements the 2026-11-17 c1 rebuild window (mc#27): every c1 host onto VLAN 20, cluster dual-stack, no legacy addresses kept. Companions: lab/iac #140 (router ports/reservations/peers), lab/clusters #1716 (Bao re-point + BGP/LB CRs). Inventory + decisions: lab repo c1-rebuild-address-inventory.md; allocation canonical in docs/adr/0012.

Hosts (VLAN 20, ADR-0012: last octet shared across families)

  • thinks .21-.23 (VIP .20), pis .11-.14 on 10.30.20.0/24, gateway 10.30.20.1
  • ULA opt-in: new animeteamspeak.lan.ulaPrefix (default null — harness VMs and the dormant mini-01/game-01 records stay v4-only, untouched); cluster-think sets fdd5:c8ef:2fa0:20::. animeteamspeak.host.ip6 published for consumers (k3s node-ip). The ip6 is derived once in network.nix's let — reading host.ip6 back inside the providing module is an eval cycle (caught by cluster-invariants; comment in the file documents it).
  • accept_ra=2 on the NIC whenever a ULA exists: these hosts forward (ip_forward=1), so the kernel ignores RAs otherwise — the v6 default route needs it.

Cluster (fixed now, immutable after boot)

  • pods 10.30.128.0/18 + fdd5:c8ef:2fa0:400::/56, services 10.30.192.0/20 + fdd5:c8ef:2fa0:500::/112
  • new k3s options podCidr6/serviceCidr/serviceCidr6 (single-family clusters land on the old k3s defaults — zero change for test); chassis renders --cluster-cidr/--service-cidr v4-first + --node-cidr-mask-size-ipv6=64, dual --node-ip
  • cilium.nix renders the mirror-image values (ipv6.enabled, ipv6NativeRoutingCIDR, clusterPoolIPv6{PodCIDRList,MaskSize=64}) from the same source — keys verified against the actual cilium-1.20.4 chart, and one serialization feeds both the bootstrap manifest and the cilium-values-nix ConfigMap the HelmRelease reads
  • bgpControlPlane.enabled = true on c1: operator installs the BGP CRDs at boot (verified against mini: same operator v1.20.4, old-style cilium.io/v2 CRs live against these routers since 2026-03). Peers/pool/advertisements are CRs (lab/clusters#1716), not values.

Bao

openbao-agent default https://10.30.20.21:8200; bao-enroll/pki-ceremony scripts re-point. Note for the window (documented in the inventory): the listener certs' SANs carry 10.10.1.x — reissue happens inside the window from the restored pki-infra mount (keys survive on the thinks at /var/lib/openbao-tls/api.key).

Verification

task gate green: fmt, flake check, cluster-invariants, secrets-hygiene, toplevel eval of all 21 configs. Targeted evals: think-01 → fdd5:c8ef:2fa0:20::21 + accept_ra=2 + dual node-ip, pi-04 → ::14, test-01/mini-01 → no ULA, bgp flag present only on c1's ciliumValues. Harness rehearsal (task vm:reset-check on the dev pin) follows on this branch before the window opens.

Merge order (deliberate — do NOT merge casually)

This PR merges FIRST, while hosts are still cabled to VLAN 1000: comin rolls the new generation, hosts self-isolate on the wrong VLAN for ~2 minutes until lab/iac #140's merge flips the port PVIDs. That gap is the window's phase-1, sequenced by the runbook.

Implements the 2026-11-17 c1 rebuild window (mc#27): every c1 host onto VLAN 20, cluster dual-stack, no legacy addresses kept. Companions: lab/iac #140 (router ports/reservations/peers), lab/clusters #1716 (Bao re-point + BGP/LB CRs). Inventory + decisions: lab repo `c1-rebuild-address-inventory.md`; allocation canonical in docs/adr/0012. ## Hosts (VLAN 20, ADR-0012: last octet shared across families) - thinks .21-.23 (VIP .20), pis .11-.14 on 10.30.20.0/24, gateway 10.30.20.1 - ULA opt-in: new `animeteamspeak.lan.ulaPrefix` (default **null** — harness VMs and the dormant mini-01/game-01 records stay v4-only, untouched); cluster-think sets `fdd5:c8ef:2fa0:20::`. `animeteamspeak.host.ip6` published for consumers (k3s node-ip). The ip6 is derived once in network.nix's `let` — reading `host.ip6` back inside the providing module is an eval cycle (caught by cluster-invariants; comment in the file documents it). - `accept_ra=2` on the NIC whenever a ULA exists: these hosts forward (ip_forward=1), so the kernel ignores RAs otherwise — the v6 default route needs it. ## Cluster (fixed now, immutable after boot) - pods 10.30.128.0/18 + fdd5:c8ef:2fa0:400::/56, services 10.30.192.0/20 + fdd5:c8ef:2fa0:500::/112 - new k3s options podCidr6/serviceCidr/serviceCidr6 (single-family clusters land on the old k3s defaults — zero change for test); chassis renders `--cluster-cidr/--service-cidr` v4-first + `--node-cidr-mask-size-ipv6=64`, dual `--node-ip` - cilium.nix renders the mirror-image values (ipv6.enabled, ipv6NativeRoutingCIDR, clusterPoolIPv6{PodCIDRList,MaskSize=64}) from the same source — keys verified against the actual cilium-1.20.4 chart, and one serialization feeds both the bootstrap manifest and the cilium-values-nix ConfigMap the HelmRelease reads - `bgpControlPlane.enabled = true` on c1: operator installs the BGP CRDs at boot (verified against mini: same operator v1.20.4, old-style cilium.io/v2 CRs live against these routers since 2026-03). Peers/pool/advertisements are CRs (lab/clusters#1716), not values. ## Bao openbao-agent default https://10.30.20.21:8200; bao-enroll/pki-ceremony scripts re-point. Note for the window (documented in the inventory): the listener certs' SANs carry 10.10.1.x — reissue happens inside the window from the restored pki-infra mount (keys survive on the thinks at /var/lib/openbao-tls/api.key). ## Verification `task gate` green: fmt, flake check, cluster-invariants, secrets-hygiene, toplevel eval of all 21 configs. Targeted evals: think-01 → fdd5:c8ef:2fa0:20::21 + accept_ra=2 + dual node-ip, pi-04 → ::14, test-01/mini-01 → no ULA, bgp flag present only on c1's ciliumValues. Harness rehearsal (`task vm:reset-check` on the dev pin) follows on this branch before the window opens. ## Merge order (deliberate — do NOT merge casually) This PR merges FIRST, while hosts are still cabled to VLAN 1000: comin rolls the new generation, hosts self-isolate on the wrong VLAN for ~2 minutes until lab/iac #140's merge flips the port PVIDs. That gap is the window's phase-1, sequenced by the runbook.
c1 VLAN-20 rebuild: re-IP, dual-stack, BGP control plane (mc#27)
Some checks failed
Validate Nix Flake / validate-nix (push) Has been cancelled
fa39d3cb4d
Window 2026-11-17. Nodes: thinks .21-.23, pis .11-.14 on 10.30.20.0/24 +
ULA (ADR-0012: lan.ulaPrefix opt-in, last octet shared; accept_ra=2 for
the forwarding hosts RA). Cluster ranges fixed now (immutable): pods
10.30.128.0/18 + P:400::/56 (/64 per node), services 10.30.192.0/20 +
P:500::/112; k3s gets explicit --cluster-cidr/--service-cidr, cilium
mirrors into IPAM pools + native-routing CIDRs from the same source.
bgpControlPlane enabled (peers/pool are flux CRs, lab/clusters#1716).
Bao agent + scripts re-point to 10.30.20.21. mini-01/game-01 records and
the harness stay v4-only, unchanged.
Human-run prep step for mc#27: CSRs from the api.key that lives on each
think, signed by the live cluster's pki-infra mount, new 2-cert chains
committed to pki/openbao/. Without this the rebuilt Bao answers on
10.30.20.x with SANs that only carry 10.10.1.x and every IP-verifying
client (mini ESO, haproxy, agents, snapshot job) fails verification.
Author
Owner

Rehearsal evidence (harness) — PASS on origin/dev = fa39d3c + fe0e257 (this PR's exact commits; vm:push pinned dev to them before the run).

Chain that passed, in order:

  1. lab:install — three fresh installs from ISOs built from this commit
  2. lab:boot + vm:check — comin + chassis + gitops convergence onto dev
  3. lab:cluster-check — 3-server etcd, VIP 10.30.20.20, nodes Ready
  4. vm:openbao-cluster-check — harness Raft (the shape of the window's Bao rebuild)
  5. vm:reset-check — the mc#27 checkbox, every assertion:
    • installer gate marker on all three servers
    • --node dry run changes nothing (k3s active, 3 Ready)
    • --node --apply test-01 (bootstrap leader, the hard case): rejoined,
      datastore kept (canary survived), rejoin drop-in auto-removed,
      k3s-rejoin-dropin-check proven to fire on a planted leftover,
      node-health healthy after rebuild
    • gate closed on every server: running k3s untouched, node-health reports held
    • --cluster refuses a partial server set
    • --cluster dry run changes nothing (no markers, canary intact)
    • --cluster --apply all three: wiped, leader-first reboots, OpenBao
      answers 429 unsealed on each, 3 Ready on a fresh datastore (canary
      gone), Flux deployments Available, node-health healthy ×3

Stage subset, deliberately: the boot-path stages not run (initrd/watchdog/
bootcount/deadman/revert/retry/rotate) exercise code paths this diff does not
touch; the touched paths — install, convergence, cluster formation, Raft,
both reset modes — are exactly the ones run. task gate (all 21 hosts eval,
cluster-invariants, secrets-hygiene, fmt) is green on the branch.

Environmental note (not a config bug, recorded for the runbook): the first
vm:reset-check attempt aborted mid --cluster --apply when an unrelated
containerlab deploy on the workstation rewrote /etc/ssh/ssh_config.d/clab-*.conf
mode 600, which fails every ssh client ("Can't open user config file …
Permission denied") — known containerlab behavior, hit before on the crs309
lab. Fix: sudo chmod 644 /etc/ssh/ssh_config.d/clab-*.conf. The interrupted
--cluster --apply was then resumed cleanly (per-host markers: test-01
marker-skipped, test-02/03 wiped, leader-first reboots), and the full scripted
check passed from its start on the recovered cluster. The resume itself is
extra evidence that the reset script is safe to interrupt — exactly the
property phase 4 of the window relies on.

Window prep carried in this PR: scripts/bao-api-cert-reissue.sh (phase 0.3
of the runbook) — CSRs from the on-think api.key, signed by the live
pki-infra, new chains committed here so Bao boots valid on the new IPs.

**Rehearsal evidence (harness) — PASS on `origin/dev` = `fa39d3c` + `fe0e257`** (this PR's exact commits; `vm:push` pinned dev to them before the run). Chain that passed, in order: 1. `lab:install` — three fresh installs from ISOs built from this commit 2. `lab:boot` + `vm:check` — comin + chassis + gitops convergence onto dev 3. `lab:cluster-check` — 3-server etcd, VIP 10.30.20.20, nodes Ready 4. `vm:openbao-cluster-check` — harness Raft (the shape of the window's Bao rebuild) 5. `vm:reset-check` — the mc#27 checkbox, every assertion: - installer gate marker on all three servers - `--node` dry run changes nothing (k3s active, 3 Ready) - `--node --apply test-01` (bootstrap leader, the hard case): rejoined, **datastore kept** (canary survived), rejoin drop-in auto-removed, `k3s-rejoin-dropin-check` proven to fire on a planted leftover, node-health healthy after rebuild - gate closed on every server: running k3s untouched, node-health reports `held` - `--cluster` refuses a partial server set - `--cluster` dry run changes nothing (no markers, canary intact) - `--cluster --apply` all three: wiped, leader-first reboots, OpenBao answers 429 unsealed on each, **3 Ready on a fresh datastore** (canary gone), Flux deployments Available, node-health healthy ×3 Stage subset, deliberately: the boot-path stages not run (initrd/watchdog/ bootcount/deadman/revert/retry/rotate) exercise code paths this diff does not touch; the touched paths — install, convergence, cluster formation, Raft, both reset modes — are exactly the ones run. `task gate` (all 21 hosts eval, cluster-invariants, secrets-hygiene, fmt) is green on the branch. Environmental note (not a config bug, recorded for the runbook): the first `vm:reset-check` attempt aborted mid `--cluster --apply` when an unrelated containerlab deploy on the workstation rewrote `/etc/ssh/ssh_config.d/clab-*.conf` mode 600, which fails every ssh client ("Can't open user config file … Permission denied") — known containerlab behavior, hit before on the crs309 lab. Fix: `sudo chmod 644 /etc/ssh/ssh_config.d/clab-*.conf`. The interrupted `--cluster --apply` was then **resumed cleanly** (per-host markers: test-01 marker-skipped, test-02/03 wiped, leader-first reboots), and the full scripted check passed from its start on the recovered cluster. The resume itself is extra evidence that the reset script is safe to interrupt — exactly the property phase 4 of the window relies on. Window prep carried in this PR: `scripts/bao-api-cert-reissue.sh` (phase 0.3 of the runbook) — CSRs from the on-think `api.key`, signed by the live `pki-infra`, new chains committed here so Bao boots valid on the new IPs.
- bao-api-cert-reissue.sh: pki-infra/sign with the host CSR (issue/ minted a
  new key in Bao the host cannot serve), key_type=any, fixed 'nix shell -c jq',
  intermediate appended from pki/pki-infra.crt, refuses unless the cert's
  public key equals the CSR's.
- k3s-reset.sh --cluster: delete /var/lib/rook (stale mon stores of the old
  fsid block a fresh CephCluster). --node unchanged.
- lan.gateway has no default; cluster-think sets 10.30.20.1, dormant
  mini-01/game-01 keep 10.10.1.1 explicitly.
Preflight against the live thinks: root's login shell is nushell (the ||
was a parse error) and openssl is not installed there. CSR pubkeys from the
fixed command match the on-host api.key fingerprints (EC P-256, hence
key_type=any on the role).
Author
Owner

Gate re-run on review fixes (2026-11-17): harness VMs run exactly the 6d03bd6 build (toplevel store paths equal per VM, so comin had nothing to deploy). Stages lab:cluster-check, vm:openbao-cluster-check, vm:reset-check: all PASS (node rebuild kept the datastore, cluster reset wiped it, k3s + Flux back on all three) with the new k3s-reset.sh. Not coverable on the harness: agents inside --cluster (no agents) and the /var/lib/rook wipe (no Rook). a4d9aaf after it touches only scripts/bao-api-cert-reissue.sh (not in the system closure).

Gate re-run on review fixes (2026-11-17): harness VMs run exactly the 6d03bd6 build (toplevel store paths equal per VM, so comin had nothing to deploy). Stages lab:cluster-check, vm:openbao-cluster-check, vm:reset-check: all PASS (node rebuild kept the datastore, cluster reset wiped it, k3s + Flux back on all three) with the new k3s-reset.sh. Not coverable on the harness: agents inside --cluster (no agents) and the /var/lib/rook wipe (no Rook). a4d9aaf after it touches only scripts/bao-api-cert-reissue.sh (not in the system closure).
vault_superadmins hold vault-policy-admin (path *), enough for the role write
and pki-infra/sign. Checks the token before touching anything.
First live run signed certs with only DNS:<host>: pki/sign defaults to
use_csr_sans=true, so the CSR (no SANs) replaced alt_names/ip_sans. Those
certs were discarded, never committed. Dropped allowed_ips (not an OpenBao
role parameter). The script now refuses to write unless the SAN set equals
the plan exactly.
Signed 2026-11-17 by pki-infra (role api-reissue) from CSRs made on each
think from its own /var/lib/openbao-tls/api.key. Verified: 2-cert chains,
chain to pki/root.crt OK, pubkeys equal the on-host key fingerprints
(think-01 fc32fbe2, think-02 2360c4fa, think-03 c88d26d0), SANs = host,
host.int, openbao.int, localhost, 10.30.20.2N, 127.0.0.1; valid to 2027-11-17.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/machine-configs!40
No description provided.