Skip to main content

Command Palette

Search for a command to run...

Kubernetes Day 2

Published
โ€ข1 min readโ€ขView as Markdown
S

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:

  1. kubectl get nodes

  2. kubectl get pods

  3. kubectl apply -f pod.yaml

  4. Pod ka kya kaam hota hai?

1 views

More from this blog

Full Stack Development | Software Engineering | Web Development | DevOps | Testing | MVC | Microservices | Automation

27 posts