![[Pasted image 20250108215527.png]]
Kubernetes Architecture
Video tutorial followed : https://www.youtube.com/watch?v=a-nWPre5QYI&t=1020s
![[Pasted image 20250108220716.png]]
1. Deploy a K8s cluster on local Machine.
Deployed ngnix image inside kubernetes and applied load balancer over it
Tools
- MiniKube
- install kubectl with this command :
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
![[Pasted image 20250109111819.png]]
- make it executable and move to path
sudo chmod +x kubectl
sudo mv kubectl /usr/local/bin
![[Pasted image 20250109112156.png]]
- Install minikube:
curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64
![[Pasted image 20250109112451.png]]
- Start MiniKube:
![[Pasted image 20250109121353.png]]
- run kubectl webserver
kubectl create deployment webserver --image=nginx:alpine
![[Pasted image 20250109121740.png]]
![[Pasted image 20250109122338.png]]
command to delete pod
kubectl delete pod webserver
expose deployment server
kubectl expose deployment webserver --type=LoadBalancer --port=80
service/webserver exposed
kubectl get services
![[Pasted image 20250109122606.png]]
minikube service webserver --url
![[Pasted image 20250109122722.png]]
![[Pasted image 20250109122736.png]]
View minikube dashboard
minikube dashboard
![[Pasted image 20250109123604.png]]
yash@boi:~$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 26m
webserver LoadBalancer 10.100.82.247 <pending> 80:30934/TCP 15m
yash@boi:~$ kubectl get service webserver
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
webserver LoadBalancer 10.100.82.247 <pending> 80:30934/TCP 15m
yash@boi:~$ kubectl delete service webserver
service "webserver" deleted
![[Pasted image 20250109155152.png]]