Kubectl Commands for Pod, ReplicaSet and Deployment
🚀 Kubernetes Pod, ReplicaSet & Deployment – Commands Cheat Sheet (with comments) 🟢 POD Commands kubectl run nginx --image=nginx # Create a simple pod quickly (imperative way) kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml # Generate pod YAML without creating it kubectl apply -f pod.yaml # Create pod from YAML kubectl get pods # List all pods kubectl get pods -o wide # Show pods with node + IP info kubectl describe pod nginx # Detailed info + events (best for troubleshooting) kubectl logs nginx # Show container logs kubectl logs -f nginx # Stream logs live (follow mode) kubectl exec -it nginx -- bash # Enter inside container shell kubectl delete pod nginx # Delete pod 🟡 REPLICASET Commands kubectl apply -f rs.yaml # Create ReplicaSet from YAML kubectl get rs # List ReplicaSets kubectl describe rs myrs # Detailed ReplicaSet info kubectl scale rs myrs --replicas=5 # Increase/decrease number of pods kubectl get pods -l app=myapp # Show pods created by this Re...