Kubernetes Deployment Strategies

Six deployment strategies for zero-downtime releases: Canary (gradual %), Blue-Green (instant switch), A/B Testing (user segment), Rolling Update (pod-by-pod), Recreate (delete all then create), Shadow (mirror traffic). Each has distinct downtime and rollback characteristics.

Overview

Choosing a deployment strategy

The deployment strategy decides how much risk you accept per release and how quickly you can recover from a bad one. Six strategies cover almost every case. The rolling update is the default. Recreate accepts a downtime window. Canary sends 5 to 20 percent of traffic to the new version first. Blue-green makes an instant switch. A/B testing routes by user attribute. Shadow sends the new version mirrored traffic. This chapter takes them in that order, starting with the one you get without asking.

Key concepts

  • maxSurge
  • maxUnavailable
  • Canary weight
  • Blue-Green switch
  • Traffic mirroring (Shadow)
  • Flagger

Interview questions

  • Compare rolling update vs blue-green vs canary deployment.
  • How do you implement a canary deployment in Kubernetes without a service mesh?

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio