How Rolling Updates Work

Rolling update process on Kubernetes.

  • Kubernetes handles rolling updates through ReplicaSets. These manage groups of identical pods, which are units running containerized application instances.
  • Let’s look at a simple example:Say a website has 6 pod replicas behind a load balancer. This ReplicaSet runs containers from version 1.0 of the website software.
  • Kubernetes then starts the update by creating a parallel ReplicaSet definition for version 2.0, while keeping the old 1.0 one.
  • The update begins by spinning up 1 new pod on version 2.0. Traffic still goes mainly to the 6 pods on 1.0. Kubernetes checks that main metrics for the new pod look normal before continuing. The rolling update then creates another 2.0 pod, ramping up to 2 out of 7 pods now on the new version. At the same time, Kubernetes scales down the 1.0 ReplicaSet by destroying one of its pods in parallel.
  • This gradual ramp-up of new pods while winding down old ones proceeds slowly. Kubernetes adds health checks on response times, error rates, and resource usage of all pods during this. If metrics degrade, it pauses the update process automatically.
  • Eventually version 2.0 pods take over, while removing the last few 1.0 ones. The whole transition gets done with no downtime for users in the best case.

Kubernetes allows controlling the pace and safety checks for this through parameters:

  • Max Unavailable – The maximum number of pods OK to take offline during the update, e.g. 1.
  • Max Surge – How many extra pods to create temporarily above the original number during the transition.
  • Health checks – Custom metrics thresholds to track and metrics services to query if metrics degrade.

With all this power and flexibility, updates can roll out steadily at an organization’s preferred pace. And if things go sideways…just rollback!

Rolling Updates and Rollbacks in Kubernetes: Managing Application Updates

Many websites and apps now run on clusters of computers called containers. Containers let apps run smoothly as groups work on updating and improving the software behind the apps. A system called Kubernetes helps manage and update all those containerized apps. Sometimes app updates go wrong or cause problems for users. Kubernetes has clever ways to update apps that avoid issues.

The main method is called a rolling update. This slowly switches the software behind the scenes from an old version to a new one. A few containers at a time are updated to the new software. Kubernetes checks that each small batch works fine before updating more. This means no downtime for users! Another useful capability is rollbacks. If a new software version causes glitches, Kubernetes can automatically revert to the previous stable version. There is no need for websites to crash or stay broken!

Similar Reads

Rolling updates and rollbacks in Kubernetes

Rolling Updates: When we update our application in Kubernetes, we want to avoid downtime where users experience errors or outages. So instead of updating everything instantly, Kubernetes does “rolling updates”. It’s like changing clothes by putting on a new pair of pants one leg at a time instead of standing naked to swap your whole outfit all at once!...

Why do we use rolling updates and rollbacks in Kubernetes?

Rolling updates are the best way to upgrade apps managed by Kubernetes. They avoid headaches for both users and website owners. The biggest benefit is zero downtime during the upgrade. The site or app remains available throughout the process. Containers with the old software version keep running until replaced gradually by new containers. So users enjoy continuous access....

How Rolling Updates Work

Rolling update process on Kubernetes....

Performing Rollbacks

Sometimes new versions of apps don’t work as expected. Bugs could slip through testing. Unpredicted spike in traffic volumes slow things down. Changes may unintentionally break important flows. When issues pop up, Kubernetes allows rapidly rolling back deployments to a previous stable release. No need to leave users frustrated or losing business while debugging!...

Deploying Nodejs sample application on Kubernetes

1. Sample application:...

Kubernetes Manifests

The Kubernetes deployment and service YAML definitions are key to actually running our containerized application on the cluster:...

Deploying the application

$ kubectl apply -f deployment.yaml -f service.yaml...

Best Practices for Rolling Updates:

Kubernetes makes it easier than ever to smoothly upgrade apps. But some planning and care still makes the process less risky. Here are some best practices:...

Debugging & Partial Rollbacks

If a bad update makes it halfway through rollout before catching issues:...

Conclusion

Summary of rolling update and rollback capabilities of Kubernetes:...

Rolling Updates and Rollbacks in Kubernetes – FAQ’s

What are rolling updates and rollbacks? How are they done on Kubernetes?...