TIL: debug kubernetes pods when they use some image without shell access, like distroless or scratch.
copy the container you want to debug to another pod with the
busybox image to get a shell. also, include
--share-processes to even get the processes available on the debug container.
kubectl debug -it logging-fluentbit-m2v94 --copy-to=fluentdebug --image=busybox --share-processes
don’t forget to remove things afterwards:
kubectl delete pod fluentdebug
all the docs are available here and this might be the better source after all, since things change … like daily.