Run debug pod on node k8s-debug
Get privileged shell on a cluster node via debug pod
kubectl debug node/my-node -it --image=ubuntu
more k8s-debug
all 27 commands →
Exec into sidecar container
kubectl exec -it mypod -c sidecar-name -- /bin/sh
Check resource requests/limits
kubectl get pod mypod -o jsonpath='{range .spec.containers[*]}{.name}{"\t"}{.resources}{"\n"}{end}'
Describe node conditions
kubectl describe node my-node | grep -A5 'Conditions:'
Find pods by resource usage
kubectl top pods -A --sort-by=memory | head -20
Watch pod events
kubectl get events -n mynamespace --field-selector involvedObject.name=mypod --watch