# Kubernetes Day 2

# 🚀 **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

```bash
kubectl get nodes
```

### ✔ Sab pods dekhna

```bash
kubectl get pods
```

### ✔ Pod ki detail

```bash
kubectl describe pod podname
```

### ✔ Pod delete

```bash
kubectl delete pod podname
```

---

# 🔥 **3\. Pehla Pod kaise banate hain (Manifest file se)**

YAML file banti hai:

**pod.yaml**

```bash
apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
    - name: nginx-container
      image: nginx:latest
      ports:
        - containerPort: 80
```

Ab isko apply karo:

```bash
kubectl apply -f pod.yaml
```

Status check:

```bash
kubectl get pods
```

---

# 🔥 **4\. Pod delete**

```bash
kubectl delete -f pod.yaml
```

---

# 🔥 **5\. Pod logs dekhna**

```bash
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?
