Previous crash logs with timestamps k8s-debug
Tail the crashed container's prior instance logs to catch the pre-restart stack trace
kubectl logs <pod> -n <ns> -c <name> --previous --timestamps --tail=200
more k8s-debug
all 27 commands →
Ephemeral debug container
kubectl debug -it <pod> --image=nicolaka/netshoot -n <ns>
Node resource usage
kubectl top nodes
Pod resource usage sorted
kubectl top pods -A --sort-by=memory
Check what's in a ConfigMap
kubectl get cm <name> -n <ns> -o jsonpath='{.data}'
Decode a Secret
kubectl get secret <name> -n <ns> -o jsonpath='{.data}' | python3 -c "import sys,json,base64; [print(k,'=',base64.b64decode(v).decode()) for k,v in json.load(sys.stdin).items()]"