0Pricing
Docker & Kubernetes for Developers · Lesson

Rolling Updates and Rollbacks

Ship new versions safely with Kubernetes rolling updates, control the rollout strategy, and roll back instantly when something breaks.

Rolling Updates and Rollbacks is a free Docker & Kubernetes for Developers lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Docker & Kubernetes for Developers learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Why Rolling Updates

Updating every Pod at once causes downtime. A rolling update replaces Pods gradually so the app stays available throughout the change.

Deployments Drive Updates

A Deployment owns a ReplicaSet. Changing the Pod template makes the Deployment create a new ReplicaSet and shift Pods from old to new at a controlled pace.

Triggering an Update

Change the image and the Deployment starts a rollout automatically.

kubectl set image deployment/web web=myapp:2.0

maxSurge and maxUnavailable

The strategy is tuned by two values: maxSurge (extra Pods allowed above desired) and maxUnavailable (Pods allowed to be down) during the rollout.

spec:
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0

Watching a Rollout

Track progress and confirm it finished cleanly.

kubectl rollout status deployment/web

Readiness Gates the Rollout

A new Pod only receives traffic once its readiness probe passes. Without good probes, broken Pods can still get traffic during a rollout.

Pausing and Resuming

Pause a rollout to verify a canary subset, then resume.

kubectl rollout pause deployment/web
kubectl rollout resume deployment/web

Viewing Rollout History

Kubernetes keeps a revision history you can inspect.

kubectl rollout history deployment/web

Rolling Back

If the new version misbehaves, roll back to the previous revision instantly.

kubectl rollout undo deployment/web

Rolling Back to a Specific Revision

Target an exact revision from the history list.

kubectl rollout undo deployment/web --to-revision=3

revisionHistoryLimit

Control how many old ReplicaSets are retained for rollback with revisionHistoryLimit in the Deployment spec.

spec:
  revisionHistoryLimit: 5

Quick Check

Test what you have learned.

Recap

You learned how Deployments perform rolling updates via ReplicaSets, how maxSurge/maxUnavailable and readiness probes control safety, and how to pause, watch, and rollout undo to recover fast.

Frequently asked questions

Is the “Rolling Updates and Rollbacks” lesson free?

Yes — the full text of “Rolling Updates and Rollbacks” is free to read here on the web, and the Docker & Kubernetes for Developers course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Docker & Kubernetes for Developers course, upgrade to CoddyKit PRO.

What will I learn in “Rolling Updates and Rollbacks”?

Ship new versions safely with Kubernetes rolling updates, control the rollout strategy, and roll back instantly when something breaks. You practise Docker & Kubernetes for Developers with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Docker & Kubernetes for Developers?

No prior experience is required. Docker & Kubernetes for Developers on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Rolling Updates and Rollbacks” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Docker & Kubernetes for Developers lesson?

Yes. Every Docker & Kubernetes for Developers lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Understanding Kubernetes Deployments
  2. Exposing Applications with Services
  3. Scaling & Self-Healing Applications
  4. Rolling Updates and Rollbacks
← Back to Docker & Kubernetes for Developers