kubectl-debug icon indicating copy to clipboard operation
kubectl-debug copied to clipboard

debug command fail

Open thetruechar opened this issue 5 years ago • 10 comments

kubectl debug gateway-0 -n testing
error execute remote, error sending request: Post http://172.18.45.169:10027/api/v1/debug?command=%5B%22bash%22%5D&container=docker%3A%2F%2F400076b42616a628173867c4de002eb38e31ba645b5a08183610ce40b7bd4f5e&image=nicolaka%2Fnetshoot%3Alatest: unexpected EOF
error: error sending request: Post http://172.18.45.169:10027/api/v1/debug?command=%5B%22bash%22%5D&container=docker%3A%2F%2F400076b42616a628173867c4de002eb38e31ba645b5a08183610ce40b7bd4f5e&image=nicolaka%2Fnetshoot%3Alatest: unexpected EOF

集群是阿里云容器服务托管的k8s集群

thetruechar avatar Apr 21 '20 09:04 thetruechar

没有安装debug-agent吧

kingreatwill avatar Apr 25 '20 03:04 kingreatwill

装了, 而且不是说不装也可以吗

thetruechar avatar Apr 26 '20 02:04 thetruechar

You'd better check the connectivity of the debug agent address:port, which supplies 172.168.45.169:10027 above.

charlie [email protected] 于2020年4月26日周日 上午10:22写道:

装了, 而且不是说不装也可以吗

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aylei/kubectl-debug/issues/98#issuecomment-619469304, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGITFQO2J7NAS5TAUN3VKKLROOLGPANCNFSM4MNFBGIA .

markzhang0928 avatar Apr 26 '20 02:04 markzhang0928

The same wrong:error execute remote, error sending request: Post http://****:10027/api/v1/debug?command=......&image=nicolaka%2Fnetshoot%3Alatest: dial tcp ****:10027: connect: connection refused

fralychen avatar Apr 28 '20 07:04 fralychen

@fralychen @thetruechar What's the output of kubectl debug --version? It should have created the debug agent automatically on launch in after v1.0.1

aylei avatar Apr 28 '20 07:04 aylei

@aylei @thetruechar It's fine for: kubectl-debug --agentless --port-forward myapp -n default

fralychen avatar Apr 28 '20 08:04 fralychen

brew install 7 days ago.

❯ kubectl debug --version
debug version v0.0.0-master+$Format:%h$

brew install aylei/tap/kubectl-debug

Updating Homebrew...
^CWarning: aylei/tap/kubectl-debug 0.1.1 is already installed and up-to-date

thetruechar avatar Apr 28 '20 08:04 thetruechar

[root@localhost ~]# kubectl-debug --version debug version v0.0.0-master+$Format:%h$

fralychen avatar Apr 28 '20 08:04 fralychen

@fralychen @thetruechar It turns out that v0.1.1 does have --agentless and --port-forward by default, so you must command --agentless explicitly if the agent is not installed in advance and command --port-forward explicitly if the 10027 port of the target node is not directly accessible.

An alternative is to configure the default value of these options in a local configuration file https://github.com/aylei/kubectl-debug#configuration, or you can upgrade to v0.2.0-rc via brew upgrade aylei/tap/kubectl-debug.

aylei avatar Apr 28 '20 12:04 aylei

Thanks

fralychen avatar Aug 17 '20 07:08 fralychen