Deployment strategies

Published: (January 5, 2026 at 05:38 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Rolling Update

What it is
Kubernetes gradually replaces old Pods with new Pods, providing zero 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

Pros

  • Zero downtime (default behavior).
  • Simple and production‑ready.

Cons

  • Old and new versions run together, which can complicate database/schema changes.

When to use

  • Most web apps, APIs, and microservices.

Recreate

What it is
All old Pods are stopped, then new Pods are created.

Config

strategy:
  type: Recreate

Pros

  • Very simple.
  • No version mixing.

Cons

  • ❌ Downtime – users see a service interruption.

When to use

  • Single‑instance apps.
  • Development / test environments.
  • Applications that cannot run multiple versions simultaneously.

Blue‑Green

What it is
Two environments are maintained:

  • Blue – the current version.
  • Green – the new version.

Traffic switches instantly from blue to green.

How to implement

  1. Deploy the new version to a separate set of Pods (green).
  2. Update the Service selector (or Ingress) to point to the green Pods.

Pros

  • Instant rollback.
  • No downtime.
  • Very safe deployment.

Cons

  • Requires double the resources while both environments exist.
  • Typically manual or tool‑driven.

When to use

  • High‑risk releases.
  • Critical production systems.

Canary

What it is
The new version is released to a small percentage of users, then traffic is gradually increased.

How to implement

  • Deploy fewer replicas for the canary version, or
  • Use traffic splitting via Ingress or a Service Mesh.

Pros

  • Very low risk; bugs are detected early.

Cons

  • More complex setup.
  • Requires monitoring and metrics.

When to use

  • Large user bases.
  • Performance‑sensitive applications.

A/B Testing

What it is
Different users receive different versions based on headers, cookies, or regions.

Pros

  • Enables business experimentation and feature comparison.

Cons

  • Complex setup.
  • Not a pure “deployment” strategy.

When to use

  • Feature testing.
  • Product experiments.

Strategy Comparison

StrategyDowntimeRiskComplexityProduction Use
Rolling UpdateNoMediumLow✅ Yes
RecreateYesHighVery Low❌ Rare
Blue‑GreenNoLowMedium✅ Yes
CanaryNoVery LowHigh✅ Yes
A/B TestingNoVery LowVery High⚠️ Special
Back to Blog

Related posts

Read more »

kubernetes project #1

Overview Run a single containerized web app in Kubernetes and access it from your browser: Flow: Browser → Service → Pod → Container This exercise demonstrates...