Files
homelab-frontend/tasks/0.3-health-endpoints.md
T
Story Crater BotandClaude Opus 5 058f11cf2b
CI / Test (push) Canceled after 0s
CI / Vet (push) Canceled after 0s
CI / Build (push) Canceled after 0s
CI / Security (govulncheck) (push) Canceled after 0s
chore: initial commit of Go API gateway
Baseline for the Kong replacement on api.riotpiao.com. Brings the working
tree under version control for the first time: gateway source, the task
board that drives the agent runs, test fixtures, and K8s manifests.

Anchor the gateway ignore rule to the repo root. Unanchored, "gateway"
also matched the cmd/gateway/ source directory, so the program entrypoint
was excluded from every commit.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-19 20:54:34 -07:00

1.2 KiB

0.3 — Health endpoints (GREEN)

Phase: 0 — Foundations Stage: GREEN Depends on: 0.2

  • GET /healthz returns 200 whenever the process is alive
  • GET /healthz contacts no upstream and performs no network I/O
  • GET /readyz returns 200 only when configuration is valid and, if auth is enabled, JWKS has been fetched at least once
  • GET /readyz returns a non-2xx status while configuration is invalid or JWKS has never been fetched
  • Neither endpoint requires authentication, even when the auth flag is on
  • Neither path is proxied to any upstream, and neither can be shadowed by a configured route

/healthz backs the liveness probe, so it must stay cheap and must not fail because an upstream is down — restarting the gateway does not fix a sick vLLM pod. /readyz backs the readiness probe and is allowed to fail, taking the pod out of the nginx endpoint pool until it can actually serve.

Verify

go test ./internal/server/... -run TestHealthEndpoints -v
# expected: passes — /healthz is 200 with upstreams unreachable; /readyz is non-2xx
# before first JWKS fetch and 200 after; both answer with no Authorization header