0
0
Kubernetesdevops~30 mins

Upgrading and rolling back releases in Kubernetes - Mini Project: Build & Apply

Choose your learning style9 modes available
Upgrading and Rolling Back Releases in Kubernetes
📖 Scenario: You are managing a simple web application deployed on Kubernetes. You need to upgrade the application to a new version and then learn how to roll back to the previous version if something goes wrong.
🎯 Goal: Learn how to upgrade a Kubernetes deployment to a new version and roll back to the previous version using kubectl commands.
📋 What You'll Learn
A Kubernetes cluster with kubectl configured
A deployment named webapp running version v1
Basic knowledge of kubectl commands
💡 Why This Matters
🌍 Real World
In real projects, upgrading applications without downtime and rolling back quickly if issues occur is critical for smooth user experience.
💼 Career
DevOps engineers and site reliability engineers often manage application deployments and need to perform upgrades and rollbacks safely.
Progress0 / 4 steps
1
Create the initial deployment
Create a deployment named webapp with image nginx:1.19 using the command kubectl create deployment webapp --image=nginx:1.19.
Kubernetes
Need a hint?

Use kubectl create deployment with the exact name webapp and image nginx:1.19.

2
Upgrade the deployment to a new version
Use the command kubectl set image deployment/webapp webapp=nginx:1.21 to upgrade the webapp deployment's container image to nginx:1.21.
Kubernetes
Need a hint?

Use kubectl set image with deployment name webapp and container name webapp to set the image to nginx:1.21.

3
Roll back the deployment to the previous version
Use the command kubectl rollout undo deployment/webapp to roll back the webapp deployment to the previous version.
Kubernetes
Need a hint?

Use kubectl rollout undo with the deployment name webapp to roll back.

4
Check the rollout status
Use the command kubectl rollout status deployment/webapp to check the status of the deployment rollout.
Kubernetes
Need a hint?

Use kubectl rollout status deployment/webapp to see if the deployment is successful.