B. Blue Green a software delivery tutorial
Vol. I § Zero-downtime series § A series for junior developers
Zero-downtime delivery · 7 / 10 ·

The health check is the gate

The health check is the reason this whole architecture is safe. The idle slot must answer GET /health before Caddy moves. If the check fails, the playbook stops — the live slot is untouched, and readers never find out a deploy was attempted and failed.

Slot playground · health-gate
readerCaddy :8080blue :18080 · upgreen :18081 · booting
The health check runs on the idle slot.
  1. The health check runs on the idle slot.
  2. The check fails. The switch stays closed. Blue stays live.
  3. The check passes. Only now may the switch move.
explainer · health
Explanation

The check passed. The Caddy route may move to green.

Change the explainer to health: fail. Watch blue keep receiving requests. That is why this gate exists.

Quick recap

  • A failed gate means the deploy stops; traffic stays safe on the old version.
  • A health endpoint must prove the app is ready to work, not merely alive.
  • The wait budget (retries × delay) is a deliberate choice — not an unexamined default.

Reader notes

Chapter discussion appears once Giscus is connected to the site repository.