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
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
fix/aks-ground-trust-cidrs → main 1 commit
4 files
changed +44
−4
bin/lib.sh +26
| @@ -633,6 +633,32 @@ else: | ||
| 633 | 633 | |
| 634 | 634 | fi |
| 635 | 635 | |
| 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 "/traefik/helmrelease.yaml" "/forgejo/helmrelease.yaml" \ | |
| 652 | "/backup/netpol.yaml" "/kyverno-policies/plat-ns-network-governance.yaml"; do | |
| 653 | [ -f "" ] || 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 | "" && rm -f ".bak" | |
| 659 | echo " trim(aks): k3s CIDRs (10.42/10.43) -> aks (10.244/10.0) in "/}" | |
| 660 | done | |
| 661 | ||
| 636 | 662 | # 5) runner image → ACR (domain-agnostic pattern: runs BEFORE identity rewrite, |
| 637 | 663 | # so the tree still carries the parent's domain). |
| 638 | 664 | 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 | ||
| 73 | 73 | piped over stdin (never interpolated into the remote command) — an |
| 74 | 74 | adversarial review caught a command-injection → root-RCE here; fixed. |
| 75 | 75 | - `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. | |
| 78 | 85 | |
| 79 | 86 | ## Gotchas found while proving it (2026-08-19) |
| 80 | 87 |
deploy/azure/gate.sh +2 −2
| @@ -301,7 +301,7 @@ if [ "$MODE" = vms ]; then | ||
| 301 | 301 | fi |
| 302 | 302 | |
| 303 | 303 | 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'" & | |
| 305 | 305 | TAIL_PID=$! |
| 306 | 306 | GERM_OK="" |
| 307 | 307 | for _ in ; do |
| @@ -377,7 +377,7 @@ else | ||
| 377 | 377 | nix shell nixpkgs#azure-cli --command nix develop --command bash -c 'bin/germinate' |
| 378 | 378 | ) > "/germinate.log" 2>&1 & |
| 379 | 379 | GERM_PID=$! |
| 380 | tail -f "/germinate.log" 2>/dev/null | grep --line-buffered -E '==>|FATAL|ERROR' & | |
| 380 | tail -f "/germinate.log" 2>/dev/null | grep --line-buffered -E '==>|FATAL|ERROR|WARN' & | |
| 381 | 381 | TAIL_PID=$! |
| 382 | 382 | |
| 383 | 383 | # 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 | ||
| 339 | 339 | // Kyverno GENERATES per-tenant NetworkPolicies (plat-ns-network-governance); |
| 340 | 340 | // cilium is the overlay-compatible enforcer that actually honors them. |
| 341 | 341 | 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' | |
| 342 | 349 | } |
| 343 | 350 | // Container Insights (logs) — the Azure-pure replacement for the k3s |
| 344 | 351 | // recipe's Grafana, together with managed Prometheus below. |
new above
offline