Inspect Kubernetes pod and logs

Kubernetes

Inspect pod state, events, and logs for debugging.

  1. 1

    List pods

    kubectl get pods -n <namespace>
  2. 2

    Describe pod

    kubectl describe pod <pod> -n <namespace>
  3. 3

    Follow logs

    kubectl logs -f <pod> -n <namespace>
  4. 4

    Exec into pod

    kubectl exec -it <pod> -n <namespace> -- /bin/sh

Related commands: kubectl get pods, kubectl describe, kubectl logs