Ordered events for a pod

Stream only Warning events scoped to one pod in chronological order; modern: replaces get events filter

kubectl events --for pod/<pod> -n <ns> --types=Warning

tool
k8s-debug27 commands
tags
k8s-debugtroubleshootingobservabilityk8s

More k8s-debug commands

  • kubectl logs <pod> -n <ns> -c <name> --previous --timestamps --tail=200

    Tail the crashed container's prior instance logs to catch the pre-restart stack trace

  • kubectl debug -it <pod> --image=nicolaka/netshoot -n <ns>

    Attach a debug container (netshoot) to a running pod — shares PID/net namespaces

  • kubectl top nodes

    CPU and memory per node (requires metrics-server)

  • kubectl top pods -A --sort-by=memory

    Memory-sorted pod usage across all namespaces — find the hungry ones

  • kubectl get cm <name> -n <ns> -o jsonpath='{.data}'

    Print just the data field; pipe to python -m json.tool for formatting

all 27 k8s-debug commands