Must Know kubectl Commands

  1. kubectl get pods # List all pods

  2. kubectl get nodes # List all nodes

  3. kubectl describe pod <name> # Get pod details

  4. kubectl logs <pod> # View pod logs

  5. kubectl exec -it <pod> -- sh # Enter a pod

  6. kubectl apply -f file.yaml # Apply a config

  7. kubectl delete pod <name> # Delete a pod

  8. kubectl get all # See everything