Ephemeral debug container k8s-debug
Attach a debug container (netshoot) to a running pod — shares PID/net namespaces
kubectl debug -it <pod> --image=nicolaka/netshoot -n <ns>
more k8s-debug
all 27 commands →
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()]"
List all resources in namespace
kubectl api-resources --verbs=list --namespaced -o name | xargs -I{} kubectl get {} -n <ns> --ignore-not-found