0
0
Kubernetesdevops~3 mins

Why Rolling update strategy in Kubernetes? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if you could update your app without your users ever noticing a thing?

The Scenario

Imagine you have a website running on several servers. You want to update the website without making it go offline. So, you stop one server, update it, then start it again. Then you do the same for the next server, and so on.

The Problem

This manual way is slow and risky. If you stop too many servers at once, your website breaks. If you forget to start a server, users get errors. It's hard to keep track and fix mistakes quickly.

The Solution

The rolling update strategy in Kubernetes updates your app step-by-step automatically. It replaces old versions with new ones little by little, keeping the app running all the time. If something goes wrong, it stops and fixes it before continuing.

Before vs After
Before
kubectl delete pod pod-1
kubectl apply -f new-version.yaml
kubectl delete pod pod-2
kubectl apply -f new-version.yaml
After
kubectl set image deployment/myapp myapp=myapp:v2
kubectl rollout status deployment/myapp
What It Enables

You can update your app smoothly without downtime, keeping users happy and your service reliable.

Real Life Example

A popular online store updates its product page code. Using rolling updates, customers keep shopping without noticing any interruption during the update.

Key Takeaways

Manual updates risk downtime and errors.

Rolling updates replace app versions gradually and safely.

This keeps services running smoothly during changes.