Die Labs / Cloud
CloudAdvanced~6h
Blue-Green Deployment with Health-Gated Cutover
A deployment script that stands up a green instance of a running service alongside the live blue instance, runs a health-check gate against green before it ever receives production traffic, and flips a load balancer or reverse proxy only when green passes. If the health gate fails, the script leaves blue serving 100% of traffic and tears down the bad green deploy automatically.
Was er beweist
Der Satz, den du im Vorstellungsgespräch verteidigen kannst.
Lebenslauf-Zeile
Built a zero-downtime blue-green deployment pipeline with automated health-gated traffic cutover and sub-5-second rollback, verified with a chaos test that killed a bad deploy before it received a single request.
- can ship zero-downtime deploys
- understands health checks vs liveness theater
- can build automated rollback, not just manual rollback
Die Aufgabenstellung
Was du Schritt für Schritt baust.
- 01Two identical service containers (blue, green) behind a single reverse-proxy upstream config that routes 100% of traffic to whichever is currently 'live'
- 02Deploy script that starts the new version as green while blue keeps serving all live traffic unchanged
- 03Health gate that polls green's /healthz (must check a real dependency, e.g. DB connection, not just 'process is up') for N consecutive passes within a timeout before cutover is allowed
- 04Cutover step that atomically rewrites the proxy upstream to point at green with zero dropped connections (verified via a load-generating script running concurrently during the flip)
- 05Automatic rollback: if the health gate fails or times out, green is torn down and blue is untouched — the script must exit non-zero and blue must never lose traffic
- 06A deliberately broken build (green fails its DB health check) used as the negative test case
Der Beweis
Fertig, wenn diese Tests bestehen.
Concurrent load test shows zero failed requests during a successful blue-green cutover
automated test
Deploying a build with a broken health endpoint results in green being torn down and blue still serving 100% of traffic
automated test
Reverse proxy config and deploy script are captured with before/after diffs of the upstream target
artifact
Rollback completes in under 5 seconds from health-gate failure detection
checked output
Stack
Dockernginx or Caddy (reverse proxy)Bash or Node.js CLIa simple HTTP service (Express/Fastify) as the deploy targetdocker compose
Sage Method
frame → route → decide → prove
Du behältst
A deploy.sh (or deploy.ts) script + proxy config + a recorded terminal session showing a successful cutover and a rejected bad-deploy cutover, both under live load