Deploy and Update NGINX Microservice

KubernetesBeginner
Practice Now

Introduction

In this challenge, you will demonstrate your Kubernetes skills as a junior DevOps engineer in a tech startup. You will update a web application using NGINX as the microservice, ensuring minimal service disruption. The tasks involve updating a Kubernetes Deployment to use a newer image version and verifying the successful rolling update.

Update NGINX Deployment

As a junior DevOps engineer, your task is to update the existing deployment to ensure minimal service disruption.

Prerequisites

Before you begin, ensure you have the following:

minikube start
kubectl apply -f ~/project/k8s-manifests/nginx-deployment.yaml

Check the deployment status:

kubectl get deployments

Tasks

  1. Update the web-app deployment to use the image nginx:1.24.0-alpine.
  2. Verify that the update was successfully performed using rolling updates, ensuring zero downtime.

Requirements

  • Use kubectl commands to perform the update.
  • Confirm that the deployment continues to function without downtime during the update.
  • Use kubectl rollout status to monitor the update progress.
  • Check pod images to verify the updated version.

Hints

  • Use kubectl edit deployment web-app or kubectl set image to update the image.
  • Monitor the rollout status using kubectl rollout status.
  • Validate the running pods and their container images using kubectl get pods -o jsonpath.
✨ Check Solution and Practice

Summary

In this challenge, you demonstrated your Kubernetes skills by updating an NGINX web application deployment to a newer image version. You ensured zero downtime during the process and verified the success of the rolling update. This exercise highlights the importance of maintaining high availability while performing updates in a Kubernetes environment.