Deploy and manage a simple Apache-based web server and:
Submit it on GitHub Repo under Theory or Class folder and share its URL
You will run an Apache server instead of nginx.
kubectl run apache-pod --image=httpd

Check:
kubectl get pods

kubectl describe pod apache-pod
Focus:
httpdkubectl port-forward pod/apache-pod 8081:80

Open:
http://localhost:8081

You should see: → Apache default page (“It works!”)
kubectl delete pod apache-pod

Same as before:
kubectl create deployment apache --image=httpd
Check:
kubectl get deployments
kubectl get pods

kubectl expose deployment apache --port=80 --type=NodePort
Access again:
kubectl port-forward service/apache 8082:80

Open:
http://localhost:8082

kubectl scale deployment apache --replicas=2
Check:
kubectl get pods

Run port-forward again and refresh browser multiple times.
(Advanced later: logs + different content per pod)
kubectl set image deployment/apache httpd=wrongimage
Check:
kubectl get pods

kubectl describe pod <pod-name>

Look for:
ImagePullBackOffkubectl set image deployment/apache httpd=httpd

kubectl exec -it <pod-name> -- /bin/bash
Now inside container:
ls /usr/local/apache2/htdocs

This is where web files are stored.
Exit:
exit
kubectl delete pod <one-pod-name>
Watch:
kubectl get pods -w

kubectl delete deployment apache
kubectl delete service apache

This task is better than nginx because: