aylei / kubectl-debug

This repository is no longer maintained, please checkout https://github.com/JamesTGrant/kubectl-debug.
Apache License 2.0
2.31k stars 303 forks source link

I can't join some pods #142

Open MinistrBob opened 3 years ago

MinistrBob commented 3 years ago

I join one pod, but another I cannot. What could be the reason for this?

$ k debug selection-staging-798847b54b-g6nf9
container created, open tty...
bash-5.1# hostname
selection-staging-798847b54b-g6nf9
bash-5.1# exit
exit

$ k debug selection-db-staging-5974f5b9c9-8lqp7
error execute remote, error sending request: Post http://10.147.245.22:10027/api/v1/debug?command=%5B%22bash%22%5D&container=docker%3A%2F%2F84a34bba16510f36e4a3e044cd339eaa89af3c8f360b921fbcad60f548784fac&image=nicolaka%2Fnetshoot%3Alatest: dial tcp 10.147.245.22:10027: connect: connection refused
error: error sending request: Post http://10.147.245.22:10027/api/v1/debug?command=%5B%22bash%22%5D&container=docker%3A%2F%2F84a34bba16510f36e4a3e044cd339eaa89af3c8f360b921fbcad60f548784fac&image=nicolaka%2Fnetshoot%3Alatest: dial tcp 10.147.245.22:10027: connect: connection refused
MadEngineX commented 3 years ago

Hi! Try to activate: hostNetwork: true

And try to use this command, this helps to me.

kubectl-debug -n monitoring monitoring-prometheus-node-exporter-6f4ls --agentless=true --port-forward=true --agent-image=aylei/debug-agent:v0.1.1

If it works change in daemonset.yaml image: aylei/debug-agent:latest To image: aylei/debug-agent:v0.1.1


Also I have changed ports in daemonset.yaml from 10027 to 10028 (strange network problem: Predicate PodFitsHostPorts failed)

Good luck!