Skip to content

feat(tts-audio): add the Gateway the route points at - #284

Merged
ngeorger merged 1 commit into
mainfrom
feat/tts-audio-gateway
Nov 27, 2026
Merged

ngeorger merged 1 commit into
mainfrom
feat/tts-audio-gateway

Conversation

@sredevopsorgagents

Copy link
Copy Markdown
Collaborator

Closes the last gap between what the repo ships and what the cluster needs.

The finding

Every object the repo declared was present and healthy in tts-audio — namespace, SAs, Role/RoleBinding, both ConfigMaps, Deployment (2/2), Service, PDB, HPA, 4 NetworkPolicies, Secret, HTTPRoute. The one thing missing was the Gateway the route points at:

parentRef → Gateway tts-audio-gateway in kube-system   → NotFound
httproute tts-webhook .status                          → empty
https://tts-audio.sredevops.org/healthz                 → HTTP 530 (Cloudflare 1016)
receiver logs (9h)                                      → no deliveries

So the deployment looked complete while no webhook could ever arrive, and no worker Job has ever been created from one.

The manifest

overlay/gateway.yaml, with each field measured against the live cluster rather than assumed:

Field Value Why
namespace kube-system (GATEWAY_NAMESPACE) the tunnel routes to traefik.kube-system.svc.cluster.local:443; every working Gateway sits beside Traefik
listener port 8443 Traefik's websecure entrypoint listens on 8443 in the container; the Service maps it to 443. The working sredevops-gateway declares 8443.
allowedRoutes All every other Gateway here uses Same because its routes sit beside it. Ours does not (route in tts-audio, Gateway in kube-system), so Same would silently leave the route unattached — the exact bug being fixed.
hostname TTS_HOST pins the listener to one host so All isn't "any namespace may claim any hostname"
TLS security-feed/security-feed-sredevops-tls Cloudflare Origin wildcard for *.sredevops.org, valid to Sep 2027

It is rendered outside the kustomization: namespace: tts-audio there rewrites it and kustomize has no per-resource namespace override.

Also added

  • make tls-secret — a Gateway can only reference a cert in its own namespace, so this copies the wildcard into GATEWAY_NAMESPACE as TLS_SECRET (default tts-audio-tls). It is a snapshot; re-run on renewal.
  • WITH_GATEWAY=0 to skip creating one when the cluster already publishes the receiver through an existing Gateway.
  • make test assertions for the Gateway's namespace, name, 8443 port, All routes and hostname. I verified each fails when reverted (Same → fail, 443 → fail).

Verification

All 18 rendered objects pass kubectl apply --dry-run=client against the cluster's own schemas:

networkpolicy/allow-kubernetes-api-egress created (dry run)
gateway/tts-audio-gateway                 created (dry run)
... 16 unchanged

Server-side dry-run is not possible for me (read-only service account, forbidden on create) — the client-side validation is against the same schemas.

To finish going live

make tls-secret GATEWAY_NAMESPACE=kube-system
make deploy TAG=<sha on main after this merge> TTS_HOST=tts-audio.sredevops.org \
  GATEWAY_NAME=tts-audio-gateway GATEWAY_NAMESPACE=kube-system GATEWAY_SECTION=web
curl https://tts-audio.sredevops.org/healthz     # expect {"ok":true}
make backfill

CORS on tts-sredevopsorg is still needed (make gcp-bootstrap) for ranged seeking in the browser.

`tts-audio.sredevops.org` returned Cloudflare 1016 because the HTTPRoute named
`tts-audio-gateway` and no such Gateway existed: every other manifest was
present and healthy, so the deployment looked complete while nothing could
reach the receiver. The receiver has never received a webhook.

Investigated against the live cluster rather than assumed:

- the tunnel routes to `traefik.kube-system.svc.cluster.local:443`, and the
  Traefik `websecure` entrypoint listens on **8443 in the container**; the
  Service maps it to 443. The working `sredevops-gateway` declares 8443, so
  the listener uses 8443.
- every working Gateway uses `allowedRoutes: Same` because its routes sit in
  the same namespace. Ours does not — route in `tts-audio`, Gateway in
  `kube-system` — so `Same` would leave it unattached. It uses `All`, pinned
  by the listener hostname.
- TLS reuses `security-feed/security-feed-sredevops-tls`, a Cloudflare Origin
  wildcard for `*.sredevops.org` valid to Sep 2027, copied into the Gateway's
  namespace by the new `make tls-secret`.

The Gateway is rendered outside the kustomization: `namespace: tts-audio` there
would rewrite it, and kustomize has no per-resource namespace override.

`make test` now asserts the Gateway's namespace, name, 8443 port, `All` routes
and hostname — each verified to fail when reverted.

All 18 rendered objects pass `kubectl apply --dry-run=client` against the live
cluster's own schemas, including the Gateway and the corrected NetworkPolicy.
@ngeorger
ngeorger merged commit 86400d0 into main Nov 27, 2026
6 checks passed
@ngeorger
ngeorger deleted the feat/tts-audio-gateway branch November 27, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants