Follow pod logs
Stream logs in real time; add -c <container> for multi-container pods
kubectl logs -f <pod> -n <ns>
- tool
- kubectl73 commands
More kubectl commands
-
kubectl logs <pod> --previous -n <ns>Logs from the last crashed/restarted container instance
-
kubectl exec -it <pod> -n <ns> -- bashInteractive shell inside a running container
-
kubectl port-forward svc/<name> 8080:80 -n <ns>Tunnel a cluster service port to localhost
-
kubectl rollout status deployment/<name> -n <ns>Block until rollout completes or times out (use in CI)
-
kubectl rollout undo deployment/<name> -n <ns>Revert to the previous revision