if my target pods is kubernetes coredns, i can not find shared pid and mnt namespace, Because there is no shell, command line operations cannot be executed
[root@master ~]# cdebug exec --namespace=kube-system -it pod/coredns-5cd85ddb9f-ls5dl Debugger container name: cdebug-47f86597 Starting debugger container... Waiting for debugger container... Attaching to debugger container... If you don't see a command prompt, try pressing enter. / # ps aux PID USER TIME COMMAND 1 root 0:00 sh /.cdebug-entrypoint.sh 11 root 0:00 sh 12 root 0:00 ps aux
if i use kubectl debug ,i can find shared pid and mnt namesapce. kubectl debug coredns-5cd85ddb9f-ls5dl -it --image=netshoot --image-pull-policy=IfNotPresent --target=coredns -n kube-system coredns-5cd85ddb9f-ls5dl ~ ps aux PID USER TIME COMMAND 1 root 3:01 /coredns -conf /etc/coredns/Corefile 55 root 0:01 zsh 119 root 0:00 ps aux
Thanks for the report! The reason for you not seeing the expected processes is because you're targeting the Pod and not the concrete container inside of it. Could you try cdebug exec --namespace=kube-system -it pod/coredns-5cd85ddb9f-ls5dl/coredns instead? (notice the /coredns addition).
Thanks for the report! The reason for you not seeing the expected processes is because you're targeting the Pod and not the concrete container inside of it. Could you try
cdebug exec --namespace=kube-system -it pod/coredns-5cd85ddb9f-ls5dl/corednsinstead? (notice the/corednsaddition).
I do it,but doesn't works. and it say no coredns
Could you please provide the output of the kubectl -n kube-system get pod coredns-5cd85ddb9f-ls5dl -o yaml command?
cdebug exec -it --image busybox:musl --namespace=kube-system pod/coredns-c97d8fd78-kg4s5/coredns
Debugger container name: cdebug-860ce1e2 Starting debugger container... Waiting for debugger container... sh: can't open no: no such file cdebug: Debugger container "cdebug-860ce1e2" terminated: Error - (exit code: 1).
Ran into the same problem, getting into the coredns container reported an error. If you don't add coredns, there is no problem
Thanks for the report! The reason for you not seeing the expected processes is because you're targeting the Pod and not the concrete container inside of it. Could you try
cdebug exec --namespace=kube-system -it pod/coredns-5cd85ddb9f-ls5dl/corednsinstead? (notice the/corednsaddition).