DEV Community

Aisalkyn Aidarova
Aisalkyn Aidarova

Posted on

Deployment strategies

In Kubernetes Deployments, these are the main deployment (release) strategies you need to know as a DevOps engineer.


1️⃣ Rolling Update (Default & Most Common)

Image

What it is

  • Kubernetes gradually replaces old Pods with new Pods
  • No downtime when configured correctly

How it works

  • Some old Pods are terminated
  • New Pods are created step by step
  • Traffic is shared during the transition

Key settings

strategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1
    maxSurge: 1
Enter fullscreen mode Exit fullscreen mode

Pros

  • Zero downtime
  • Default behavior
  • Simple and production-ready

Cons

  • Old and new versions run together
  • Harder DB/schema changes

Use when

  • Most web apps, APIs, microservices

2️⃣ Recreate Strategy

Image

What it is

  • All old Pods are stopped
  • Then new Pods are created

Config

strategy:
  type: Recreate
Enter fullscreen mode Exit fullscreen mode

Pros

  • Very simple
  • No version mixing

Cons

  • ❌ Downtime
  • Users see service interruption

Use when

  • Single-instance apps
  • Dev / test environments
  • Apps that cannot run multiple versions

3️⃣ Blue-Green Deployment

Image

Image

What it is

  • Two environments:

    • Blue = current version
    • Green = new version
  • Traffic switches instantly

How

  • Deploy new version separately
  • Update Service selector to point to new Pods

Pros

  • Instant rollback
  • No downtime
  • Very safe

Cons

  • Double resources
  • Manual or tool-driven

Use when

  • High-risk releases
  • Critical production systems

4️⃣ Canary Deployment

Image

Image

What it is

  • New version is released to a small % of users
  • Gradually increase traffic

How

  • Fewer replicas for canary
  • Or traffic splitting via Ingress / Service Mesh

Pros

  • Very low risk
  • Detect bugs early

Cons

  • More complex
  • Needs monitoring & metrics

Use when

  • Large user base
  • Performance-sensitive apps

5️⃣ A/B Testing (Advanced)

Image

Image

What it is

  • Different users get different versions
  • Based on headers, cookies, regions

Pros

  • Business experimentation
  • Feature comparison

Cons

  • Complex setup
  • Not pure “deployment” strategy

Use when

  • Feature testing
  • Product experiments

📊 Quick Comparison

Strategy Downtime Risk Complexity Prod Use
Rolling Update No Medium Low ✅ Yes
Recreate Yes High Very Low ❌ Rare
Blue-Green No Low Medium ✅ Yes
Canary No Very Low High ✅ Yes
A/B Testing No Very Low Very High ⚠️ Special

Top comments (0)