Exec into sidecar container k8s-debug
Open shell in a specific container of a multi-container pod
kubectl exec -it mypod -c sidecar-name -- /bin/sh
more k8s-debug
all 27 commands →
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
Copy file from pod
kubectl cp mynamespace/mypod:/var/log/app.log ./app.log