Lab 1: Install Minikube and kubectl on Windows 🔧
Objective: Install Kubernetes tools on Windows
Time: 20 minutes
Exercise 1.1: Install kubectl
1
Download kubectl
mkdir C:\kubernetes
cd C:\kubernetes
curl.exe -LO "https://dl.k8s.io/release/v1.28.0/bin/windows/amd64/kubectl.exe"
2
Add to PATH
- Press Windows + R, type
sysdm.cpl
- Advanced → Environment Variables
- Edit PATH → Add
C:\kubernetes
- Click OK
- Close and reopen PowerShell
3
Verify kubectl Installation
kubectl version --client
Client Version: v1.28.0
Kustomize Version: v5.0.4
Exercise 1.2: Install Minikube
1
Download Minikube
cd C:\kubernetes
curl.exe -LO https://storage.googleapis.com/minikube/releases/latest/minikube-windows-amd64.exe
Rename-Item minikube-windows-amd64.exe minikube.exe
💡 Alternative: Use Chocolatey package manager:
choco install minikube
2
Verify Minikube Installation
minikube version
minikube version: v1.32.0
commit: 8220a6eb95f0a4d75f7f2d7b14cef975f050512d
✅ Checkpoint: kubectl and Minikube installed successfully
Lab 2: Start Minikube Cluster ☸️
Objective: Create local Kubernetes cluster with Minikube
Time: 25 minutes
Exercise 2.1: Start Minikube
1
Ensure Docker Desktop is Running
- Start Docker Desktop
- Wait for it to fully start (green icon in system tray)
2
Start Minikube Cluster
minikube start --driver=docker
😄 minikube v1.32.0 on Microsoft Windows 11
✨ Using the docker driver based on user configuration
👍 Starting control plane node minikube in cluster minikube
🚜 Pulling base image ...
🔥 Creating docker container (CPUs=2, Memory=4000MB) ...
🐳 Preparing Kubernetes v1.28.3 on Docker 24.0.7 ...
🔎 Verifying Kubernetes components...
🌟 Enabled addons: storage-provisioner, default-storageclass
🏄 Done! kubectl is now configured to use "minikube" cluster
⏱️ Wait Time: First start takes 2-5 minutes (downloading images)
3
Verify Cluster is Running
minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
kubectl cluster-info
Kubernetes control plane is running at https://127.0.0.1:xxxxx
CoreDNS is running at https://127.0.0.1:xxxxx/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane 2m v1.28.3
4
Explore Minikube Dashboard (Optional)
minikube dashboard
🔌 Enabling dashboard ...
🤔 Verifying dashboard health ...
🚀 Launching proxy ...
🤔 Verifying proxy health ...
🎉 Opening http://127.0.0.1:xxxxx/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...
💡 Dashboard: Provides web UI to view pods, deployments, services visually
✅ Checkpoint: Minikube cluster running, kubectl connected
Lab 3: Create Kubernetes Deployment Manifests 📄
Objective: Create YAML files for Deployment and Service
Time: 30 minutes
Exercise 3.1: Create Deployment YAML
1
Create k8s Directory
cd $env:USERPROFILE\Desktop
mkdir k8s-demo
cd k8s-demo
2
Create Deployment Manifest
notepad deployment.yaml
Add complete deployment configuration:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
Save and close
💡 Using nginx image: Public image from Docker Hub, no need for ACR for this demo
3
Create Service Manifest
notepad service.yaml
Add service configuration:
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: NodePort
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
nodePort: 30080
Save and close
✅ Checkpoint: Kubernetes manifests created
Lab 4: Deploy Application to Minikube 🚀
Objective: Deploy nginx application to Kubernetes
Time: 35 minutes
Exercise 4.1: Deploy with kubectl
1
Apply Deployment
kubectl apply -f deployment.yaml
deployment.apps/nginx-deployment created
2
Watch Pods Being Created
kubectl get pods --watch
NAME READY STATUS AGE
nginx-deployment-abc123-xyz45 0/1 ContainerCreating 2s
nginx-deployment-abc123-xyz46 0/1 ContainerCreating 2s
nginx-deployment-abc123-xyz47 0/1 ContainerCreating 2s
nginx-deployment-abc123-xyz45 1/1 Running 15s
nginx-deployment-abc123-xyz46 1/1 Running 15s
nginx-deployment-abc123-xyz47 1/1 Running 15s
3
Check Deployment Status
kubectl get deployment nginx-deployment
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-deployment 3/3 3 3 1m
kubectl describe deployment nginx-deployment
Name: nginx-deployment
Namespace: default
CreationTimestamp: Mon, 17 Feb 2026 10:30:00 +0530
Labels: app=nginx
Replicas: 3 desired | 3 updated | 3 total | 3 available
StrategyType: RollingUpdate
...
4
Apply Service
kubectl apply -f service.yaml
service/nginx-service created
kubectl get service nginx-service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-service NodePort 10.96.123.45 80:30080/TCP 30s
5
Access Application
minikube ip
192.168.49.2
minikube service nginx-service --url
http://192.168.49.2:30080
minikube service nginx-service
🎉 Opening service default/nginx-service in default browser...
|-----------|---------------|-------------|---------------------------|
| NAMESPACE | NAME | TARGET PORT | URL |
|-----------|---------------|-------------|---------------------------|
| default | nginx-service | 80 | http://192.168.49.2:30080 |
|-----------|---------------|-------------|---------------------------|
✅ You should see nginx welcome page!
✅ Checkpoint: Application running in Kubernetes and accessible
Lab 5: Practice kubectl Commands 🎯
Objective: Master essential kubectl commands
Time: 40 minutes
Exercise 5.1: Viewing Resources
1
List All Resources
kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-deployment-abc123-xyz45 1/1 Running 0 5m
nginx-deployment-abc123-xyz46 1/1 Running 0 5m
nginx-deployment-abc123-xyz47 1/1 Running 0 5m
kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-deployment 3/3 3 3 5m
kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 443/TCP 10m
nginx-service NodePort 10.96.123.45 80:30080/TCP 3m
kubectl get all
NAME READY STATUS AGE
pod/nginx-deployment-abc123-xyz45 1/1 Running 5m
pod/nginx-deployment-abc123-xyz46 1/1 Running 5m
pod/nginx-deployment-abc123-xyz47 1/1 Running 5m
NAME TYPE CLUSTER-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 443/TCP 10m
service/nginx-service NodePort 10.96.123.45 80:30080/TCP 3m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/nginx-deployment 3/3 3 3 5m
2
Detailed Information
kubectl describe pod nginx-deployment-abc123-xyz45
Name: nginx-deployment-abc123-xyz45
Namespace: default
Node: minikube/192.168.49.2
Status: Running
IP: 10.244.0.5
Containers:
nginx:
Image: nginx:latest
Port: 80/TCP
State: Running
Ready: True
Events:
Normal Scheduled 5m Successfully assigned default/nginx-deployment-abc123-xyz45
Normal Pulling 5m Pulling image "nginx:latest"
Normal Pulled 4m Successfully pulled image
Normal Created 4m Created container nginx
Normal Started 4m Started container nginx
kubectl describe deployment nginx-deployment
kubectl describe service nginx-service
3
View Pod Logs
kubectl logs nginx-deployment-abc123-xyz45
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
2026/02/17 05:00:01 [notice] 1#1: start worker processes
kubectl logs -f nginx-deployment-abc123-xyz45
kubectl logs -l app=nginx --all-containers=true
4
Execute Commands in Pod
kubectl exec nginx-deployment-abc123-xyz45 -- ls /usr/share/nginx/html
50x.html
index.html
kubectl exec -it nginx-deployment-abc123-xyz45 -- /bin/bash
root@nginx-deployment-abc123-xyz45:/# hostname
nginx-deployment-abc123-xyz45
exit
Exercise 5.2: Scaling Application
1
Scale Up to 5 Replicas
kubectl scale deployment nginx-deployment --replicas=5
deployment.apps/nginx-deployment scaled
kubectl get pods
NAME READY STATUS AGE
nginx-deployment-abc123-xyz45 1/1 Running 10m
nginx-deployment-abc123-xyz46 1/1 Running 10m
nginx-deployment-abc123-xyz47 1/1 Running 10m
nginx-deployment-abc123-xyz48 0/1 ContainerCreating 5s
nginx-deployment-abc123-xyz49 0/1 ContainerCreating 5s
kubectl get pods
NAME READY STATUS AGE
nginx-deployment-abc123-xyz45 1/1 Running 10m
nginx-deployment-abc123-xyz46 1/1 Running 10m
nginx-deployment-abc123-xyz47 1/1 Running 10m
nginx-deployment-abc123-xyz48 1/1 Running 20s
nginx-deployment-abc123-xyz49 1/1 Running 20s
2
Scale Down to 2 Replicas
kubectl scale deployment nginx-deployment --replicas=2
deployment.apps/nginx-deployment scaled
kubectl get pods
NAME READY STATUS AGE
nginx-deployment-abc123-xyz45 1/1 Running 11m
nginx-deployment-abc123-xyz46 1/1 Running 11m
nginx-deployment-abc123-xyz47 1/1 Terminating 11m
nginx-deployment-abc123-xyz48 1/1 Terminating 1m
nginx-deployment-abc123-xyz49 1/1 Terminating 1m
kubectl get pods
NAME READY STATUS AGE
nginx-deployment-abc123-xyz45 1/1 Running 12m
nginx-deployment-abc123-xyz46 1/1 Running 12m
Exercise 5.3: Update Deployment (Rolling Update)
1
Update Image Version
kubectl set image deployment/nginx-deployment nginx=nginx:1.25-alpine
deployment.apps/nginx-deployment image updated
kubectl rollout status deployment/nginx-deployment
Waiting for deployment "nginx-deployment" rollout to finish: 1 out of 2 new replicas have been updated...
Waiting for deployment "nginx-deployment" rollout to finish: 1 old replicas are pending termination...
deployment "nginx-deployment" successfully rolled out
2
View Rollout History
kubectl rollout history deployment/nginx-deployment
deployment.apps/nginx-deployment
REVISION CHANGE-CAUSE
1
2
3
Rollback to Previous Version
kubectl rollout undo deployment/nginx-deployment
deployment.apps/nginx-deployment rolled back
kubectl describe deployment nginx-deployment | Select-String "Image"
Image: nginx:latest
Exercise 5.4: Test Self-Healing
1
Delete a Pod
kubectl get pods
NAME READY STATUS AGE
nginx-deployment-abc123-xyz45 1/1 Running 15m
nginx-deployment-abc123-xyz46 1/1 Running 15m
kubectl delete pod nginx-deployment-abc123-xyz45
pod "nginx-deployment-abc123-xyz45" deleted
2
Watch Kubernetes Auto-Heal
kubectl get pods
NAME READY STATUS AGE
nginx-deployment-abc123-xyz46 1/1 Running 16m
nginx-deployment-abc123-xyz50 0/1 ContainerCreating 2s
kubectl get pods
NAME READY STATUS AGE
nginx-deployment-abc123-xyz46 1/1 Running 16m
nginx-deployment-abc123-xyz50 1/1 Running 15s
🎉 Self-Healing in Action! Kubernetes maintains desired state (2 replicas) automatically
Exercise 5.5: Additional kubectl Commands
1
Port Forwarding
kubectl port-forward deployment/nginx-deployment 8080:80
Forwarding from 127.0.0.1:8080 -> 80
Forwarding from [::1]:8080 -> 80
2
Get YAML of Running Resources
kubectl get deployment nginx-deployment -o yaml
kubectl get pod nginx-deployment-abc123-xyz46 -o yaml
kubectl get deployment nginx-deployment -o json
3
Resource Usage
kubectl top pods
NAME CPU(cores) MEMORY(bytes)
nginx-deployment-abc123-xyz46 1m 3Mi
nginx-deployment-abc123-xyz50 1m 3Mi
kubectl top nodes
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
minikube 250m 12% 1024Mi 25%
4
Namespaces
kubectl get namespaces
NAME STATUS AGE
default Active 20m
kube-node-lease Active 20m
kube-public Active 20m
kube-system Active 20m
kubectl create namespace dev
namespace/dev created
kubectl apply -f deployment.yaml -n dev
kubectl get pods -n dev
5
Delete Resources
kubectl delete -f deployment.yaml
deployment.apps "nginx-deployment" deleted
kubectl delete -f service.yaml
service "nginx-service" deleted
kubectl delete deployment nginx-deployment
kubectl delete service nginx-service
kubectl delete all -l app=nginx
✅ Checkpoint: Mastered essential kubectl commands
Lab 6: Deploy Your Calculator Image 🧮
Objective: Deploy calculator app from Day 18 to Minikube
Time: 30 minutes
Exercise 6.1: Load Local Image to Minikube
1
Point Docker to Minikube
minikube docker-env
SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://127.0.0.1:xxxxx
SET DOCKER_CERT_PATH=C:\Users\YourName\.minikube\certs
SET MINIKUBE_ACTIVE_DOCKERD=minikube
REM Run this command to configure your shell:
REM @FOR /f "tokens=*" %i IN ('minikube -p minikube docker-env --shell cmd') DO @%i
& minikube -p minikube docker-env --shell powershell | Invoke-Expression
2
Build Calculator Image in Minikube
cd $env:USERPROFILE\Desktop\testing-demo\calculator
mvn clean package -DskipTests
docker build -t calculator:1.0 .
Successfully built abc123
Successfully tagged calculator:1.0
docker images calculator
REPOSITORY TAG IMAGE ID CREATED SIZE
calculator 1.0 abc123def456 30 seconds ago 220MB
3
Create Calculator Deployment
cd $env:USERPROFILE\Desktop\k8s-demo
notepad calculator-deployment.yaml
Add deployment for calculator:
apiVersion: apps/v1
kind: Deployment
metadata:
name: calculator-deployment
spec:
replicas: 3
selector:
matchLabels:
app: calculator
template:
metadata:
labels:
app: calculator
spec:
containers:
- name: calculator
image: calculator:1.0
imagePullPolicy: Never
ports:
- containerPort: 8080
Save and close
4
Deploy Calculator
kubectl apply -f calculator-deployment.yaml
deployment.apps/calculator-deployment created
kubectl get pods
NAME READY STATUS AGE
calculator-deployment-xyz123-abc45 1/1 Running 10s
calculator-deployment-xyz123-abc46 1/1 Running 10s
calculator-deployment-xyz123-abc47 1/1 Running 10s
kubectl logs calculator-deployment-xyz123-abc45
✅ Checkpoint: Your calculator image deployed in Kubernetes!
📝 Minikube Quick Reference
minikube start
minikube stop
minikube delete
minikube status
minikube ip
minikube service [service-name]
minikube service [service-name] --url
minikube service list
minikube dashboard
minikube docker-env
& minikube docker-env | Invoke-Expression
minikube addons list
minikube addons enable metrics-server
minikube logs