List pods in all namespaces
Shows every pod with its node and IP address
kubectl get pods -A -o wide
More kubectl commands
-
kubectl describe pod <name> -n <ns>Shows events, conditions and volume mounts; the first stop when a pod is unhappy
-
kubectl logs -f <pod> -n <ns>Streams logs in real time; for a pod with several containers add -c <container>
-
kubectl logs <pod> --previous -n <ns>Logs from the container that crashed or restarted last time; the real error is usually here
-
kubectl exec -it <pod> -n <ns> -- bashStarts an interactive bash shell in a running container
-
kubectl port-forward svc/<name> 8080:80 -n <ns>Forwards a service port from the cluster to localhost:8080