Os 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.
O que isso prova
A frase que você pode defender em uma entrevista.
Linha do currículo
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
O briefing
O que você constrói, passo a passo.
- 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
A prova
Está pronto quando estes passarem.
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
Método Sage
frame → route → decide → prove
Você mantém
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