internal-apps (Add): internal gateway, OpenBao issuer, internal external-dns #1750

Merged
ginjiruu merged 1 commit from internal-apps-dns into main 2026-11-20 02:49:32 +00:00
Owner

Infrastructure for internal app names on mini: <app>.apps.caosh.int.animeteamspeak.moe (machine-configs ADR-0005 amendment), served only on a gateway the internet cannot reach, with certs from OpenBao. No app moves in this PR. Pairs with lab/iac#167.

Why a second gateway

gateway/cilium-default (10.10.6.14) is the WAN port-forward target for 80/443 (iac modules/site port_forwards.web). Every route on it is reachable from the internet with a Host: header, whatever public DNS says. Internal apps move to gateway/cilium-internal (10.10.6.40), which is never forwarded. The routers let trusted clients reach it, plus the servers zone (c1) on 80/443 (lab/iac#167); mgmt, iot and guest get nothing.

mini

  • gateway/internal-gateway.yaml: Gateway cilium-internal, spec.addresses: 10.10.6.40, HTTP/HTTPS listeners, ListenerSets from all namespaces (same shape as cilium-default).
  • gateway/gateway.yaml: cilium-default pinned to 10.10.6.14. Today that address is dynamic and only stable by luck, while the WAN forward depends on it.
  • internal-apps/issuer: ClusterIssuer openbao-apps (cert-manager Vault issuer) on pki-apps-caosh/sign/cert-manager. It logs in at auth/kubernetes-mini with a token for cert-manager/openbao-apps-issuer, with audience = the API server issuer, matching the iac role. Role/RoleBinding let the cert-manager controller request that token. caBundle is the lab root, fingerprint-checked against mini's flux-system/lab-root-ca.
  • internal-apps/external-dns: external-dns 0.23, pdns provider against http://10.30.100.12:8081.
    • sources crd, gateway-httproute, gateway-tlsroute
    • labelFilter: dns.animeteamspeak.moe/internal=true
    • --gateway-name=cilium-internal: only routes on the internal gateway, so records are A 10.10.6.40
    • owner mini, domain filter apps.caosh.int.animeteamspeak.moe
    • egress: kube-dns, kube-apiserver, 10.30.100.12:8081 only
  • eso/openbao-infra.yaml: ClusterSecretStore on the infra mount for the PowerDNS API key (lab/iac#167 grants exactly that path).

c1

  • dns/auth/primary.yaml: Service pdns-api, LoadBalancer pinned 10.30.100.12, port 8081 to the primary. externalTrafficPolicy: Local keeps mini's pod address as the source.
  • The primary's NetworkPolicy also admits 10.44.0.0/16 (mini's pod pool) on 8081. mini routes pods without masquerade inside 10/8.

How an app opts in (the per-app batches)

  1. Its ListenerSet's parentRef changes to gateway/cilium-internal, with hostname <app>.apps.caosh.int.animeteamspeak.moe.
  2. A Certificate from ClusterIssuer openbao-apps for that name.
  3. The route gets dns.animeteamspeak.moe/internal: "true", and its public entry leaves the central list.
  4. App config follows: base URL, Kanidm redirect URIs, and its consumers (ESO's vault-backend, containerd's harbor mirror, vm agents, velero and the nix cache on s3.mini).

Checks

  • kustomize build on every new and changed directory; the pre-push gate passed (c1 165 objects).
  • helm template renders the intended flags, including --gateway-name=cilium-internal and --label-filter=dns.animeteamspeak.moe/internal=true.
  • pki-apps-caosh was proven on the harness OpenBao (lab/iac#167): a leaf for grafana.apps.caosh.int… verifies to the lab root, and a name outside the zone is refused.
  • Not run: the live issuer login and the first record. After merge (with #167 applied): ClusterIssuer openbao-apps Ready; a throwaway Certificate issues; a test route publishes an A record visible through the recursor.

Also in this PR's orbit

#1749 now restricts the public external-dns to --gateway-name=cilium-default, so a route on the internal gateway can never publish a private address publicly.

Merge order

lab/iac#167 first (the CA, the login role, the secret grant). Otherwise ClusterIssuer openbao-apps stays not-Ready and the internal external-dns cannot read its key; both retry, nothing breaks.

Infrastructure for internal app names on mini: `<app>.apps.caosh.int.animeteamspeak.moe` (machine-configs ADR-0005 amendment), served only on a gateway the internet cannot reach, with certs from OpenBao. No app moves in this PR. Pairs with lab/iac#167. ## Why a second gateway `gateway/cilium-default` (`10.10.6.14`) is the WAN port-forward target for 80/443 (iac `modules/site` `port_forwards.web`). Every route on it is reachable from the internet with a `Host:` header, whatever public DNS says. Internal apps move to `gateway/cilium-internal` (`10.10.6.40`), which is never forwarded. The routers let trusted clients reach it, plus the servers zone (c1) on 80/443 (lab/iac#167); mgmt, iot and guest get nothing. ## mini - `gateway/internal-gateway.yaml`: Gateway `cilium-internal`, `spec.addresses: 10.10.6.40`, HTTP/HTTPS listeners, ListenerSets from all namespaces (same shape as `cilium-default`). - `gateway/gateway.yaml`: `cilium-default` pinned to `10.10.6.14`. Today that address is dynamic and only stable by luck, while the WAN forward depends on it. - `internal-apps/issuer`: ClusterIssuer `openbao-apps` (cert-manager Vault issuer) on `pki-apps-caosh/sign/cert-manager`. It logs in at `auth/kubernetes-mini` with a token for `cert-manager/openbao-apps-issuer`, with audience = the API server issuer, matching the iac role. Role/RoleBinding let the cert-manager controller request that token. `caBundle` is the lab root, fingerprint-checked against mini's `flux-system/lab-root-ca`. - `internal-apps/external-dns`: external-dns 0.23, pdns provider against `http://10.30.100.12:8081`. - sources `crd`, `gateway-httproute`, `gateway-tlsroute` - `labelFilter: dns.animeteamspeak.moe/internal=true` - `--gateway-name=cilium-internal`: only routes on the internal gateway, so records are A `10.10.6.40` - owner `mini`, domain filter `apps.caosh.int.animeteamspeak.moe` - egress: kube-dns, kube-apiserver, `10.30.100.12:8081` only - `eso/openbao-infra.yaml`: ClusterSecretStore on the `infra` mount for the PowerDNS API key (lab/iac#167 grants exactly that path). ## c1 - `dns/auth/primary.yaml`: Service `pdns-api`, LoadBalancer pinned `10.30.100.12`, port 8081 to the primary. `externalTrafficPolicy: Local` keeps mini's pod address as the source. - The primary's NetworkPolicy also admits `10.44.0.0/16` (mini's pod pool) on 8081. mini routes pods without masquerade inside 10/8. ## How an app opts in (the per-app batches) 1. Its ListenerSet's `parentRef` changes to `gateway/cilium-internal`, with hostname `<app>.apps.caosh.int.animeteamspeak.moe`. 2. A Certificate from ClusterIssuer `openbao-apps` for that name. 3. The route gets `dns.animeteamspeak.moe/internal: "true"`, and its public entry leaves the central list. 4. App config follows: base URL, Kanidm redirect URIs, and its consumers (ESO's `vault-backend`, containerd's harbor mirror, vm agents, velero and the nix cache on `s3.mini`). ## Checks - `kustomize build` on every new and changed directory; the pre-push gate passed (c1 165 objects). - `helm template` renders the intended flags, including `--gateway-name=cilium-internal` and `--label-filter=dns.animeteamspeak.moe/internal=true`. - `pki-apps-caosh` was proven on the harness OpenBao (lab/iac#167): a leaf for `grafana.apps.caosh.int…` verifies to the lab root, and a name outside the zone is refused. - Not run: the live issuer login and the first record. After merge (with #167 applied): ClusterIssuer `openbao-apps` Ready; a throwaway Certificate issues; a test route publishes an A record visible through the recursor. ## Also in this PR's orbit #1749 now restricts the public external-dns to `--gateway-name=cilium-default`, so a route on the internal gateway can never publish a private address publicly. ## Merge order lab/iac#167 first (the CA, the login role, the secret grant). Otherwise ClusterIssuer `openbao-apps` stays not-Ready and the internal external-dns cannot read its key; both retry, nothing breaks.
Gateway cilium-internal pinned to 10.10.6.40 (never port-forwarded) and
cilium-default pinned to its current 10.10.6.14. ClusterIssuer openbao-apps
signs <app>.apps.caosh.int certs on pki-apps-caosh. external-dns writes
routes labelled dns.animeteamspeak.moe/internal on cilium-internal into c1
PowerDNS through the new pinned pdns-api LB (10.30.100.12, mini pods only).
Sign in to join this conversation.
No description provided.