Files
homelab-frontend/tasks/0.2-route-configuration.md
T

30 lines
1.5 KiB
Markdown
Raw Normal View History

2026-08-19 20:52:13 -07:00
# 0.2 — Declarative route configuration (RED)
Phase: 0 — Foundations
Stage: RED
- [x] Routes and upstreams are declared in YAML loaded from a file path at startup
- [x] Each upstream declares: address, path rewrite, connect timeout, read timeout, write timeout, maximum request body size, and an auth-required flag
- [x] Every one of those fields is explicit — no silent defaults for timeouts, body caps or auth
- [x] A config missing any required field fails startup with a non-zero exit and a message naming the offending route and field
- [x] A config with a malformed duration, an unparseable address, or a duplicate route key fails startup the same way
- [x] A valid config round-trips: every declared route is present in the loaded route table
- [x] Loading is startup-only — no API-server watch, no CRD, no Kubernetes client
Configuration lives in git and is mounted as a ConfigMap synced by Argo. It is
deliberately not a CRD: a CRD would require the gateway to watch the API server,
which needs RBAC and contradicts the invariant that the gateway holds no cluster
credentials. It is also the exact indirection being retired with Kong, whose routing
table was split across six `KongPlugin` CRs, seven Ingresses and a Helm values file.
A gateway that starts with a silently dropped route is worse than one that refuses to
start.
## Verify
```bash
go test ./internal/config/... -v
# expected: passes — valid fixtures load with all routes present; each invalid fixture
# returns an error naming the offending route and field, and none of them load partially
```