Exec into sidecar container
Open shell in a specific container of a multi-container pod
kubectl exec -it mypod -c sidecar-name -- /bin/sh
- tool
- k8s-debug27 commands
More k8s-debug commands
-
kubectl get pod mypod -o jsonpath='{range .spec.containers[*]}{.name}{"\t"}{.resources}{"\n"}{end}'Show resource requests and limits for each container
-
kubectl describe node my-node | grep -A5 'Conditions:'Check node conditions: Ready, MemoryPressure, DiskPressure
-
kubectl top pods -A --sort-by=memory | head -20Top 20 pods sorted by memory consumption
-
kubectl get events -n mynamespace --field-selector involvedObject.name=mypod --watchStream events for a specific pod
-
kubectl cp mynamespace/mypod:/var/log/app.log ./app.logDownload a file from a running container