Can't attach gdbserver to process through kubectl

4/20/2017

It looks like I have some sort of permissions problem with kubectl. I have a Docker image, that contains server with native dynamic library + gdbserver. When I'm trying to debug Docker container running on my local machine all is fine. I'm using the following workflow:

  1. start gdb
  2. target remote | docker exec -i CONTAINER gdbserver - --attach PID
  3. set sysroot /path/to/local/binary
  4. Good to go!

But when I'm trying to do such operation with kubectl I'm getting the following error:

Cannot attach to lwp 7: Operation not permitted (1) Exiting Remote connection closed

The only difference is step 2: target remote | kubectl exec -i POD -- gdbserver - --attach PID

-- vglazkov
gdb
gdbserver
google-kubernetes-engine
kubectl

0 Answers