Public: anyone can read this; nobody can change it.

workbenchthis machine

aks ground: rewrite the seed's k3s CIDR hardcodes (A4 fix + latent netpols) + surface germinate WARNs #162

Merged opened this view on origin

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

fix/aks-ground-trust-cidrs → main 1 commit

  • Merged. fix/aks-ground-trust-cidrs was merged into main.

Review

Sign in to review this change.
4 files changed +44 −4
bin/lib.sh +26
@@ -633,6 +633,32 @@ else:
633633 PYEOF
634634 fi
635635
636 # 4h) k3s CIDR hardcodes: the seed bakes k3s's pod/service CIDRs into four
637 # places — traefik's web-entrypoint forwardedHeaders.trustedIPs and
638 # Forgejo's REVERSE_PROXY_TRUSTED_PROXIES (10.42.0.0/16 pods +
639 # 10.43.0.0/16 services), the backup netpol's apiserver egress
640 # (10.43.0.0/16), and the network-governance policy's apiserver
641 # ClusterIP pinhole (10.43.0.1/32). AKS overlay networking uses
642 # 10.244.0.0/16 pods / 10.0.0.0/16 services / apiserver 10.0.0.1
643 # (pinned in deploy/azure/main.bicep networkProfile). Without the
644 # proxy rewrite every in-cluster source is UNTRUSTED — traefik strips
645 # client X-Forwarded-Proto and 301s in-cluster edge terminators that
646 # must pass (the HYB-1 contract; caught by A4-redirect-matrix on the
647 # first full aks assert, gate run 08192156p5062) and Forgejo logs the
648 # wrong client IPs; without the netpol rewrites backup + CNPG bootstrap
649 # egress to the apiserver silently stops matching.
650 local tpf
651 for tpf in "$P/traefik/helmrelease.yaml" "$P/forgejo/helmrelease.yaml" \
652 "$P/backup/netpol.yaml" "$P/kyverno-policies/plat-ns-network-governance.yaml"; do
653 [ -f "$tpf" ] || continue
654 sed -E -i.bak \
655 -e 's#10\.42\.0\.0/16#10.244.0.0/16#g' \
656 -e 's#10\.43\.0\.0/16#10.0.0.0/16#g' \
657 -e 's#10\.43\.0\.1([^0-9]|$)#10.0.0.1\1#g' \
658 "$tpf" && rm -f "$tpf.bak"
659 echo " trim(aks): k3s CIDRs (10.42/10.43) -> aks (10.244/10.0) in ${tpf#"$g"/}"
660 done
661
636662 # 5) runner image → ACR (domain-agnostic pattern: runs BEFORE identity rewrite,
637663 # so the tree still carries the parent's domain).
638664 local rf
deploy/azure/GATE-NOTES.md +9 −2
@@ -73,8 +73,15 @@ down clean. The `*.open-platform.sh` proxied tunnel CNAME does NOT shadow it
7373 piped over stdin (never interpolated into the remote command) — an
7474 adversarial review caught a command-injection → root-RCE here; fixed.
7575 - `claudeCodeOauthToken` is `@secure()` in bicep (not in ARM history). The
76 gate VM logs are streamed to the (public) CI log filtered to `==>|FATAL`, so
77 no card/secret content is printed. `--keep` does NOT print the card.
76 gate VM logs are streamed to the (public) CI log filtered to
77 `==>|FATAL|WARN` (aks local tail: `==>|FATAL|ERROR|WARN`), so no
78 card/secret content is printed: `==>` step markers and hand-written
79 WARN/FATAL messages only (the one raw-content WARN, the OAuth-registration
80 response excerpt, is failure-path only and capped at 200 chars — no
81 credentials). WARN is IN the filter deliberately: germinate treats a dead
82 front door as a non-fatal WARN, and the pre-WARN filter swallowed it — the
83 first full aks assert failed A12 with no visible cause. `--keep` does NOT
84 print the card.
7885
7986 ## Gotchas found while proving it (2026-08-19)
8087
deploy/azure/gate.sh +2 −2
@@ -301,7 +301,7 @@ if [ "$MODE" = vms ]; then
301301 fi
302302
303303 say "germinate: streaming the node journal (==> markers) — budget 60m"
304 vm "sudo journalctl -u mitosis-node -f -n 200 2>/dev/null | grep --line-buffered -E '==>|FATAL'" &
304 vm "sudo journalctl -u mitosis-node -f -n 200 2>/dev/null | grep --line-buffered -E '==>|FATAL|WARN'" &
305305 TAIL_PID=$!
306306 GERM_OK=""
307307 for _ in $(seq 1 240); do
@@ -377,7 +377,7 @@ else
377377 nix shell nixpkgs#azure-cli --command nix develop --command bash -c 'bin/germinate'
378378 ) > "$WORK/germinate.log" 2>&1 &
379379 GERM_PID=$!
380 tail -f "$WORK/germinate.log" 2>/dev/null | grep --line-buffered -E '==>|FATAL|ERROR' &
380 tail -f "$WORK/germinate.log" 2>/dev/null | grep --line-buffered -E '==>|FATAL|ERROR|WARN' &
381381 TAIL_PID=$!
382382
383383 # write the edge records as soon as traefik's LB has an external IP
deploy/azure/main.bicep +7
@@ -339,6 +339,13 @@ resource aks 'Microsoft.ContainerService/managedClusters@2024-05-01' = if (mode
339339 // Kyverno GENERATES per-tenant NetworkPolicies (plat-ns-network-governance);
340340 // cilium is the overlay-compatible enforcer that actually honors them.
341341 networkPolicy: 'cilium'
342 // Pinned, not defaulted: trim_gitops_aks 4h rewrites the recipe's
343 // proxy-trust CIDRs (traefik forwardedHeaders, Forgejo reverse-proxy)
344 // to exactly these ranges — an Azure default drift would silently
345 // untrust every in-cluster forwarder again (A4-redirect-matrix).
346 podCidr: '10.244.0.0/16'
347 serviceCidr: '10.0.0.0/16'
348 dnsServiceIP: '10.0.0.10'
342349 }
343350 // Container Insights (logs) — the Azure-pure replacement for the k3s
344351 // recipe's Grafana, together with managed Prometheus below.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs