πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Deployments beginner ⏱ 15 minutes K8s 1.28+

Kubernetes Rolling Update Strategy Guide

Configure rolling update strategies for zero-downtime deployments in Kubernetes. Covers maxSurge, maxUnavailable, rollback, and deployment health checks.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: Configure rolling update strategies for zero-downtime deployments in Kubernetes. Covers maxSurge, maxUnavailable, rollback, and deployment health checks.

The Problem

This is one of the most searched Kubernetes topics. Having a comprehensive, well-structured guide helps both beginners and experienced users quickly find what they need.

The Solution

Rolling Update Configuration

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
spec:
  replicas: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%          # Max extra pods during update (2-3 extra)
      maxUnavailable: 25%    # Max pods unavailable during update
  template:
    spec:
      containers:
        - name: app
          image: web-app:v2
          readinessProbe:     # Critical for safe rollouts!
            httpGet:
              path: /ready
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 15
  minReadySeconds: 10         # Wait 10s after ready before continuing
  revisionHistoryLimit: 10    # Keep 10 ReplicaSets for rollback

Perform a Rolling Update

# Update image
kubectl set image deployment/web-app app=web-app:v2

# Watch rollout
kubectl rollout status deployment/web-app

# Rollout history
kubectl rollout history deployment/web-app

# Rollback
kubectl rollout undo deployment/web-app
kubectl rollout undo deployment/web-app --to-revision=3

# Pause/resume (canary-like)
kubectl rollout pause deployment/web-app
# Check new pods manually
kubectl rollout resume deployment/web-app

Strategy Comparison

StrategyZero DowntimeExtra ResourcesRollback Speed
RollingUpdateβœ… Yes25% extraSeconds (undo)
Recreate❌ NoNoneSlow (redeploy)
graph LR
    A[v1: 10 pods] --> B[Start: create 2 v2 pods]
    B --> C[v2 pods ready β†’ terminate 2 v1]
    C --> D[Create 2 more v2 pods]
    D --> E[Continue until all v2]
    E --> F[v2: 10 pods - done]

Frequently Asked Questions

What happens if a rolling update fails?

If new pods fail readiness probes, the rollout stalls (doesn’t proceed). Existing v1 pods keep serving traffic. Run kubectl rollout undo to roll back.

How do I do blue-green deployments?

Switch the Service selector between v1 and v2 Deployments. Or use Argo Rollouts for automated blue-green with analysis.

Best Practices

  • Start simple β€” use the basic form first, add complexity as needed
  • Be consistent β€” follow naming conventions across your cluster
  • Document your choices β€” add annotations explaining why, not just what
  • Monitor and iterate β€” review configurations regularly

Key Takeaways

  • This is fundamental Kubernetes knowledge every engineer needs
  • Start with the simplest approach that solves your problem
  • Use kubectl explain and kubectl describe when unsure
  • Practice in a test cluster before applying to production
#rolling-update #deployment-strategy #zero-downtime #rollback #kubernetes
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens