Lab 06: Update Your Application

Welcome back! If you've been with us since Lab 01, you're already familiar with running two pods as part of our application deployment. But what happens when we need to update our application to a new version without causing downtime or service disruption? This scenario is common in projects where maintaining low latency, fault tolerance, and high availability is crucial. It's also a great opportunity to familiarize yourself with deployment strategies like blue/green and canary releases.

In this lab, we'll be taking a practical approach to updating our application. Let's imagine we've tasked one of our developers with upgrading our Node.js application from version 1 to version 2.

Fortunately, we've prepared the new version of the app in advance to streamline the update process. To roll out the updated version of our Node.js app, execute the following commands:

kubectl get deployment
kubectl set image deployment/nodejs-app nodejs-app=ghcr.io/cncf-lahore/nodejs-app:v2

To monitor the progress of the rollout and ensure it's proceeding as expected, you can check the status using:

kubectl rollout status deployment/nodejs-app

Oops! There's been a hiccup. It seems the development team accidentally configured the application to use port 90 instead of the standard port 80, causing the application to become inaccessible. To quickly revert this change and restore the application to its previous state, you can use the following command:

kubectl rollout undo deployment/nodejs-app

Just like that, our application is back online, running smoothly as if nothing happened—all within a matter of seconds.

ALTIMAGE

This lab demonstrates the power of Kubernetes' rolling updates and rollbacks, allowing us to update and maintain our applications with minimal impact on availability. Stay tuned for more labs where we'll dive deeper into Kubernetes' features and best practices.

  • Congratulations, you have now completed all the labs. Please complete the quiz and let us know how we can improve the Bootcamp. Your feedback is highly appreciated..