0
0
Azurecloud~30 mins

AKS with Azure Load Balancer - Mini Project: Build & Apply

Choose your learning style9 modes available
AKS with Azure Load Balancer
📖 Scenario: You are setting up a simple Azure Kubernetes Service (AKS) cluster to run a web application. You want to expose the application to the internet using an Azure Load Balancer to distribute traffic evenly across your pods.
🎯 Goal: Build an AKS cluster configuration that deploys a basic web app and exposes it using an Azure Load Balancer service type.
📋 What You'll Learn
Create a Kubernetes deployment manifest with a single container running nginx
Add a service manifest of type LoadBalancer to expose the deployment
Configure the service to listen on port 80 and forward traffic to the pods
Ensure the service uses the Azure Load Balancer to distribute incoming traffic
💡 Why This Matters
🌍 Real World
This project simulates deploying a web application on AKS and exposing it to the internet using Azure Load Balancer, a common real-world cloud infrastructure task.
💼 Career
Understanding how to deploy applications on AKS and expose them with Azure Load Balancer is essential for cloud engineers and DevOps professionals working with Azure.
Progress0 / 4 steps
1
Create the Deployment Manifest
Create a Kubernetes deployment manifest named deployment.yaml with a deployment called nginx-deployment. It should run 3 replicas of the nginx container using the image nginx:latest. Use the container port 80.
Azure
Need a hint?

Use kind: Deployment and specify replicas: 3. The container image should be nginx:latest and expose port 80.

2
Add the Service Manifest
Create a Kubernetes service manifest named service.yaml with a service called nginx-service. Set the service type to LoadBalancer and select pods with label app: nginx. The service should listen on port 80 and forward traffic to target port 80.
Azure
Need a hint?

Use kind: Service with type: LoadBalancer. The selector must match app: nginx. Set port and targetPort to 80.

3
Apply the Manifests to AKS
Write the Azure CLI commands to apply both deployment.yaml and service.yaml manifests to your AKS cluster using kubectl. Use the exact commands kubectl apply -f deployment.yaml and kubectl apply -f service.yaml.
Azure
Need a hint?

Use kubectl apply -f deployment.yaml and kubectl apply -f service.yaml to deploy your manifests.

4
Verify the Load Balancer External IP
Write the kubectl command to check the external IP address assigned by the Azure Load Balancer to the nginx-service. Use the exact command kubectl get service nginx-service.
Azure
Need a hint?

Use kubectl get service nginx-service to see the external IP assigned by the Azure Load Balancer.