fix: use certificate-safe api-pulse hostname

Cloudflare Universal SSL covers *.noelsabia.dev only one level deep.
api.pulse.noelsabia.dev is two levels and fails the certificate check.
- switch the API base/SSE URLs to api-pulse.noelsabia.dev
- update smoke, k6, runbook, and failure drills
- record the verified DNS/certificate diagnosis and local cache flush
This commit is contained in:
Noel Sabia committed 2026-11-14 06:40:35 +01:00
1 parent 2eacb62696
commit e8e0f2035b
10 files changed
+68 -55

No files matched your search

+10 -10
View File
@@ -12,15 +12,15 @@ and `/api/readyz` stays 200. FastAPI being down must not fail API readiness.
```bash
# Baseline
curl -sS https://api.pulse.noelsabia.dev/api/readyz
curl -sS 'https://api.pulse.noelsabia.dev/api/forecast?sensor=hn-stadtgalerie-01&horizon=7d&scenario=base' | jq '.cached'
curl -sS https://api-pulse.noelsabia.dev/api/readyz
curl -sS 'https://api-pulse.noelsabia.dev/api/forecast?sensor=hn-stadtgalerie-01&horizon=7d&scenario=base' | jq '.cached'
# Stop ML
kubectl --context fch26-onemanarmy-sa-context -n fch26-onemanarmy scale deployment/ml --replicas=0
# Verify fallback (allow up to 2 s for the ML timeout)
curl -sS https://api.pulse.noelsabia.dev/api/readyz
curl -sS 'https://api.pulse.noelsabia.dev/api/forecast?sensor=hn-stadtgalerie-01&horizon=7d&scenario=base' | jq '{cached, points: (.points|length)}'
curl -sS https://api-pulse.noelsabia.dev/api/readyz
curl -sS 'https://api-pulse.noelsabia.dev/api/forecast?sensor=hn-stadtgalerie-01&horizon=7d&scenario=base' | jq '{cached, points: (.points|length)}'
# Expected: readyz 200; cached true; points still present
# Recover
@@ -44,7 +44,7 @@ kubectl --context fch26-onemanarmy-sa-context -n fch26-onemanarmy scale deployme
# Verify the outage from outside
curl -sS -o /dev/null -w '%{http_code}\n' https://pulse.noelsabia.dev
curl -sS -o /dev/null -w '%{http_code}\n' https://api.pulse.noelsabia.dev/api/healthz
curl -sS -o /dev/null -w '%{http_code}\n' https://api-pulse.noelsabia.dev/api/healthz
# Expected: 502/503/530-style edge error, not a valid 200
# Recover
@@ -57,7 +57,7 @@ make smoke
```
If the tunnel pod is Running but the URL is still 502, check the dashboard
routes (`pulse` -> `http://web:3000`, `api.pulse` -> `http://api:8080`) and the
routes (`pulse` -> `http://web:3000`, `api-pulse` -> `http://api:8080`) and the
Secret token. A bad token keeps the pod restarting with an auth error. Rotating
the tunnel token means updating the Secret and restarting the Deployment.
@@ -69,14 +69,14 @@ the default, which is documented.
```bash
# Watch from two terminals:
# curl -sS -N https://api.pulse.noelsabia.dev/api/stream
# while true; do date +%T; curl -sS -o /dev/null -w '%{http_code}\n' https://api.pulse.noelsabia.dev/api/healthz; sleep 1; done
# curl -sS -N https://api-pulse.noelsabia.dev/api/stream
# while true; do date +%T; curl -sS -o /dev/null -w '%{http_code}\n' https://api-pulse.noelsabia.dev/api/healthz; sleep 1; done
kubectl --context fch26-onemanarmy-sa-context -n fch26-onemanarmy delete pod -l app.kubernetes.io/name=api
kubectl --context fch26-onemanarmy-sa-context -n fch26-onemanarmy rollout status deployment/api --timeout=180s
curl -sS https://api.pulse.noelsabia.dev/api/healthz
curl -sS https://api.pulse.noelsabia.dev/api/readyz
curl -sS https://api-pulse.noelsabia.dev/api/healthz
curl -sS https://api-pulse.noelsabia.dev/api/readyz
```
Pass: the health loop shows at most a few seconds of errors, the deployment