← All insightsDelivery

Blue-green and canary deployments, with real config

Nir Geier, CodeWizard · 9 July 2025 · 3 min read · Intermediate

Rolling updates are fine until a bad release reaches every user before you notice. Blue-green and canary deployments give you a safety valve: expose the new version to a slice of traffic (or a parallel environment) and promote only when it looks healthy.

Blue-green

Run two identical environments, 'blue' (current) and 'green' (new). Cut traffic over by flipping a Service selector; roll back instantly by flipping it back.

yaml
apiVersion: v1
kind: Service
metadata: { name: web }
spec:
  selector: { app: web, slot: green }   # flip to blue to roll back
  ports: [{ port: 80, targetPort: 3000 }]

Canary with weighted traffic

A canary shifts a small percentage of traffic to the new version and increases it as metrics stay green. With a mesh like Istio this is a weight change.

yaml
http:
  - route:
      - destination: { host: web, subset: v1 }
        weight: 90
      - destination: { host: web, subset: v2 }
        weight: 10
  • Blue-green: instant switch/rollback, but double the resources briefly
  • Canary: gradual, metric-driven, cheaper, but slower to fully roll out
  • Automate promotion on SLOs (error rate, latency) with Argo Rollouts or Flagger
The goal is not zero incidents - it is small blast radius and instant rollback.

Pick blue-green for simple, fast cutovers and canary when you want evidence from real traffic before committing.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult