c1 (Add): internal gateway + app tree, name-first (no pinned address) #1756

Merged
ginjiruu merged 5 commits from c1-internal-gateway into main 2026-11-20 20:02:00 +00:00
Owner

Serves the site app tree <app>.apps.caosh.int.animeteamspeak.moe (machine-configs ADR-0005 amendment, clusters/mini/internal-apps pattern) from c1, with no pinned address anywhere: c1's external-dns follows the Gateway's dynamic pool address through Gateway status, the routers deliver every pool address alike (eBGP + ECMP), and TTL 30s ages stale answers out. The Gateway's number is never written into any config, router rule, or probe.

What lands

  • clusters/c1/gateway/resources/internal-gateway.yaml — Gateway cilium-internal (HTTP+HTTPS, allowedListeners: All), no spec.addresses. Corrects the shared-mode note in gateway.yaml (shared = ListenerSets share their parent Gateway's address; each Gateway has its own Service + address).
  • clusters/c1/internal-apps/:
    • internal-apps-issuer: ClusterIssuer openbao-apps → OpenBao pki-apps-caosh (iac#167 CA/role/policy), login via auth/kubernetes-c1 role cert-manager, SA openbao-apps-issuer (added to the openbao-tokenreview binding). Trust anchor via caBundleSecretRef → the lab-root-ca Secret trust-manager already delivers; this PR adds cert-manager to the bundle's targetNamespaces and the namespace label, so the root keeps exactly one copy in git (the bundle file).
    • httpbin: generic-templates/httpbin on c1.
    • httpbin-routes: Certificate + ListenerSet + HTTPRoute; hostnames only in the apps zone. wait: true chains gate the rollout: issuer Ready → certificate issued.
  • clusters/c1/dns/external-dns (existing instance, owner c1): adds gateway-tlsroute source, enableGatewayListenerSets: true, ttl: 30. The apps zone already rides the int.animeteamspeak.moe filter; the pdns API allowlist already admits it (it runs in dns).
  • httpbin moves mini→c1 with its name: clusters/mini/httpbin/resources/routes-internal.yaml retires here, so mini's external-dns (TXT owner mini) releases httpbin.apps.caosh.int and c1's (owner c1) claims it. Minutes of NODATA during handover; never hand-edit the record.
  • generic-templates/httpbin: remediation retries (gate rule hr-retries; failure-path only).

Merge order

  1. iac PR first (lab/iac#170): the OpenBao cert-manager role on kubernetes-c1. internal-apps-issuer has wait: true and will visibly fail until it exists — that is the gate, not a bug.
  2. This PR. No router change: trusted clients already reach the pool, mgmt/iot/guest reach only the recursor (iac#164).

Verification done

  • kustomize build on every touched dir; pre-push gate green (48 root objects, 32 KS, all dependsOn resolve, 0 FAIL).
  • Server dry-run against live c1: Gateway, ClusterIssuer (caBundleSecretRef accepted; field unconditional since cert-manager 1.10), openbao RBAC, KS tree.
  • Server dry-run against live mini for the routes payload (identical files; c1 dry-run hits the expected not-yet-created-namespace artifact).
  • c1 CRDs confirmed: listenersets, tlsroutes, certificates.

After merge

kubectl --context c1 get gateway cilium-internal shows the address; dig httpbin.apps.caosh.int.animeteamspeak.moe @10.30.100.53 matches it; curl -v https://httpbin.apps.caosh.int.animeteamspeak.moe/get verifies against the lab root from arch-ws.

Serves the site app tree `<app>.apps.caosh.int.animeteamspeak.moe` (machine-configs ADR-0005 amendment, `clusters/mini/internal-apps` pattern) from **c1**, with **no pinned address anywhere**: c1's external-dns follows the Gateway's dynamic pool address through Gateway status, the routers deliver every pool address alike (eBGP + ECMP), and TTL 30s ages stale answers out. The Gateway's number is never written into any config, router rule, or probe. ## What lands - `clusters/c1/gateway/resources/internal-gateway.yaml` — Gateway `cilium-internal` (HTTP+HTTPS, `allowedListeners: All`), no `spec.addresses`. Corrects the shared-mode note in `gateway.yaml` (shared = ListenerSets share their parent Gateway's address; each Gateway has its own Service + address). - `clusters/c1/internal-apps/`: - `internal-apps-issuer`: ClusterIssuer `openbao-apps` → OpenBao `pki-apps-caosh` (iac#167 CA/role/policy), login via `auth/kubernetes-c1` role `cert-manager`, SA `openbao-apps-issuer` (added to the `openbao-tokenreview` binding). Trust anchor via `caBundleSecretRef` → the `lab-root-ca` Secret trust-manager already delivers; this PR adds `cert-manager` to the bundle's targetNamespaces and the namespace label, so the root keeps exactly one copy in git (the bundle file). - `httpbin`: `generic-templates/httpbin` on c1. - `httpbin-routes`: Certificate + ListenerSet + HTTPRoute; hostnames only in the apps zone. `wait: true` chains gate the rollout: issuer Ready → certificate issued. - `clusters/c1/dns/external-dns` (existing instance, owner `c1`): adds `gateway-tlsroute` source, `enableGatewayListenerSets: true`, `ttl: 30`. The apps zone already rides the `int.animeteamspeak.moe` filter; the pdns API allowlist already admits it (it runs in `dns`). - **httpbin moves mini→c1 with its name**: `clusters/mini/httpbin/resources/routes-internal.yaml` retires here, so mini's external-dns (TXT owner `mini`) releases `httpbin.apps.caosh.int` and c1's (owner `c1`) claims it. Minutes of NODATA during handover; never hand-edit the record. - `generic-templates/httpbin`: remediation retries (gate rule `hr-retries`; failure-path only). ## Merge order 1. **iac PR first** (lab/iac#170): the OpenBao `cert-manager` role on `kubernetes-c1`. `internal-apps-issuer` has `wait: true` and will visibly fail until it exists — that is the gate, not a bug. 2. This PR. No router change: trusted clients already reach the pool, mgmt/iot/guest reach only the recursor (iac#164). ## Verification done - `kustomize build` on every touched dir; pre-push gate green (48 root objects, 32 KS, all dependsOn resolve, 0 FAIL). - Server dry-run against live c1: Gateway, ClusterIssuer (`caBundleSecretRef` accepted; field unconditional since cert-manager 1.10), openbao RBAC, KS tree. - Server dry-run against live mini for the routes payload (identical files; c1 dry-run hits the expected not-yet-created-namespace artifact). - c1 CRDs confirmed: `listenersets`, `tlsroutes`, `certificates`. ## After merge `kubectl --context c1 get gateway cilium-internal` shows the address; `dig httpbin.apps.caosh.int.animeteamspeak.moe @10.30.100.53` matches it; `curl -v https://httpbin.apps.caosh.int.animeteamspeak.moe/get` verifies against the lab root from arch-ws.
Name-first on purpose: no spec.addresses, the LB IP comes from the dynamic
pool and is written into nothing. c1's external-dns follows it through
Gateway status (see dns commit); the routers deliver every pool address
alike (eBGP + ECMP), and access control keys on zones + the pool CIDR, not
on this Gateway's number. mini pins 10.10.6.40 only because iac#167's
firewall rule names it.

Also fix the shared-mode comment in gateway.yaml: shared means ListenerSets
share their parent Gateway's Service/IP, not all Gateways share one address
(mini: cilium-default .14, cilium-internal .40, shared mode).
gateway-tlsroute + enableGatewayListenerSets so app routes that attach
through their own ListenerSets become records, and a 30s default TTL:
gateway-backed A/AAAA records point at whatever address the dynamic pool
gave the Gateway, so a recreated Gateway Service moves the records within
one interval and stale client answers age out. The apps zone rides the
existing int.animeteamspeak.moe filter; no domain or secret changes.
The app tree <app>.apps.caosh.int.animeteamspeak.moe (ADR-0005 amendment)
moves to c1. Three Kustomizations (clusters/c1/internal-apps/):
- internal-apps-issuer: ClusterIssuer openbao-apps on the kubernetes-c1
  mount, SA openbao-apps-issuer (TokenReview right added in openbao rbac,
  OpenBao role comes from the paired iac PR; merge iac first, wait:true
  gates on the issuer Ready). caBundle inline: c1's cert-manager CRDs
  predate spec.vault.caProvider (strict-decoding check, 2026-11-20).
- httpbin: generic-templates/httpbin, first tenant of the Gateway.
- httpbin-routes: Certificate + ListenerSet + HTTPRoute, hostnames in the
  apps zone only.

httpbin moves WITH its name: mini's routes-internal goes in the same PR,
so mini's external-dns (owner mini) releases the record and c1's (owner c1)
claims it. A few minutes of NODATA mid-handover, no manual record edits.

Nothing here references the Gateway IP; the root kustomization gains
internal-apps/. Verified: kustomize build all touched dirs, server
dry-runs against live c1 (issuer, gateway, rbac) and live mini (routes).
Now that the chart is a tenant of c1 too, it must satisfy hr-retries.
Failure-path only; mini's running release is untouched until next sync.
caBundleSecretRef (unconditional since cert-manager 1.10) reads the
lab-root-ca Secret the bundle already delivers; the cert-manager namespace
joins the bundle's targets and label. The root CA keeps exactly one copy
in git, and the issuer stops mentioning CAs. Comments across the branch
trimmed to what the objects cannot say themselves.
Sign in to join this conversation.
No description provided.