DEVOPS / A CONCEPT NOTE

Blue-Green Deployments

shipping without downtime

~75 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

A zero-downtime release pattern where two identical production environments (Blue/active, Green/staging) exist. You deploy changes to Green, test it, then switch the router to direct traffic to Green.

02 / FOLLOW THE MECHANISM

How a swap routing flows

  1. Staging Deploy

    code is deployed to the idle Green environment.

  2. Verification

    QA tests Green while real traffic continues hitting the active Blue environment.

  3. Switch

    router or DNS points to Green, turning it active instantly.

  4. Fallback

    Blue is held idle for rollbacks. If tests pass, Blue is updated to match Green.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · INCOMPLETE SKETCH

route ALB traffic to the green target group

aws elbv2 modify-listener --listener-arn ... --default-actions Type=forward,TargetGroupArn=green-tg

The ellipsis omits required code or values. This sketch is not runnable as written.

EXAMPLE 02 · REFERENCE

point service selector to green pods

kubectl patch service my-app -p '{\"spec\":{\"selector\":{\"version\":\"green\"}}}'

Explore command anatomy in the CLI lab