feat: harden Gate 1 manifests and runbook

- add read-only make gate1-check: permissions, guardrails, dry-run, Secret keys
- set numeric runAsUser/runAsGroup (SKE non-numeric user caveat), pin cloudflared and use HTTP/2
- align ML env with PULSECAST_* and wire CONTROL_TOKEN for API/ML training proxy
- fix service worktree paths and smoke.sh executable bit
- pin k6 v2.0.0 for xk6-sse, fix closed-connection metric and initial scenario latency
- rewrite docs/deploy.md as an exact copy-paste Gate 1 checklist
This commit is contained in:
Noel Sabia committed 2026-11-14 05:10:41 +01:00
1 parent 55dfe8b616
commit 5b199f8fe3
13 files changed
+1231 -235

No files matched your search

+25 -1
View File
@@ -10,6 +10,7 @@ commands in `docs/deploy.md`.
deploy/k8s/ web, api, ml + cloudflared Deployments and Services, ConfigMaps
deploy/examples/ example Secret shapes (placeholders only, never applied)
scripts/smoke.sh public + in-cluster smoke checks
scripts/gate1-check.sh read-only permissions/manifest/secret readiness check
k6/sse.js 120 concurrent SSE clients for 5 minutes
docs/deploy.md Gate 1 runbook and exact human checklist
docs/load-test.md load-test procedure and how to record results
@@ -21,16 +22,34 @@ Makefile validate, build, push, deploy, smoke, load helpers
```bash
export KUBECONFIG=/path/to/fch26-onemanarmy-sa-kubeconfig.yaml # chmod 600
make gate1-check # read-only: permissions, guardrails, dry-run, Secrets
make validate # client-side dry run only, never applies
make build # all three images
make push # after docker login to Gitea
make deploy CONFIRM=yes # human only; requires the three Secrets first
make smoke # public HTTPS + API + ML health checks
make load # k6 SSE load test (needs the k6 SSE extension)
make k6-build # once: pinned k6 + SSE extension
make load # 120 SSE clients for 5 minutes
```
`make gate1-check` exits 0 when ready, 1 on a hard permission/manifest failure,
and 2 when only human prerequisites (Secrets, Deployments) are pending. It
never mutates the cluster. DNS and public HTTPS are checked separately in the
runbook and by `make smoke`.
Read `docs/deploy.md` before the first deploy. It contains the Gitea token,
`docker login`, hello-world push, `gitea-regcred`, Cloudflare Tunnel, public
hostname, and verification steps.
## Gate 1 status
- Manifests validate read-only; `make gate1-check` is green except for pending
human prerequisites.
- All three images build and pass local manifest-equivalent runtime checks
(read-only root, `/tmp` tmpfs, numeric UID). There is no Dockerfile blocker.
- Still human-only: Gitea read-only token + hello image pull, `gitea-regcred`,
Cloudflare Tunnel + DNS hostnames, and the three Secrets.
## Git workflow
`main` is integration. New work happens on a `feat/<topic>` branch in its own
@@ -46,3 +65,8 @@ committed directly to `main`.
- No secrets, tokens, kubeconfig, or raw CSV in git.
- The human applies cluster mutations. `make deploy` refuses to run without
`CONFIRM=yes`.
- Every pod sets an explicit numeric `runAsUser`/`runAsGroup`: web/ml
`10001:10001`, api/cloudflared `65532:65532`. SKE rejects a non-numeric image
user under `runAsNonRoot`.
- The tunnel uses HTTP/2 (`--protocol http2`) because TCP/443 to Cloudflare is
verified and UDP/7844 is not.