Kubernetes Day 2
Who is a highly motivated and results-oriented Software Engineer with a passion for crafting robust and user-friendly web applications. Possesses strong expertise in both backend development and full-stack development, leveraging a diverse skillset to design, develop, and deploy scalable software solutions.
๐ Kubernetes Day 2 โ kubectl + Pod Practical
๐ฅ 1. kubectl kya hota hai?
kubectl = Kubernetes ka remote control
Iske through tum cluster ko command dete ho:
Pod create
Pod delete
Logs dekhna
Cluster status check
Deployment create
Service banana
๐ฅ 2. Important kubectl commands (Beginner Level)
โ Cluster check
kubectl get nodes
โ Sab pods dekhna
kubectl get pods
โ Pod ki detail
kubectl describe pod podname
โ Pod delete
kubectl delete pod podname
๐ฅ 3. Pehla Pod kaise banate hain (Manifest file se)
YAML file banti hai:
pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: nginx-container
image: nginx:latest
ports:
- containerPort: 80
Ab isko apply karo:
kubectl apply -f pod.yaml
Status check:
kubectl get pods
๐ฅ 4. Pod delete
kubectl delete -f pod.yaml
๐ฅ 5. Pod logs dekhna
kubectl logs mypod
๐ง Aaj ka concept: Pod ek single application container chalata hai.
๐ Aaj ka Homework
In commands ko bolkar ya likhkar repeat karo:
kubectl get nodeskubectl get podskubectl apply -f pod.yamlPod ka kya kaam hota hai?