【发布时间】:2020-03-14 16:41:52
【问题描述】:
我正在使用此命令远程调试我的 kubernetes(v1.15.2) pod:
kubectl port-forward soa-room-service-65986bddb4-6cz76 5011:5011
但是当我使用我的 Intellij Idea 连接调试端口时,它显示:
Forwarding from 127.0.0.1:5011 -> 5011
Forwarding from [::1]:5011 -> 5011
Handling connection for 5011
E0314 15:50:53.351183 41712 portforward.go:400] an error occurred forwarding 5011 -> 5011: error forwarding port 5011 to pod 2d40e44288507f65a256ed7c591658cd1f5caf7f268feb34afda01be480de6c8, uid : unable to do port forwarding: socat not found.
Handling connection for 5011
E0314 15:51:19.031476 41712 portforward.go:400] an error occurred forwarding 5011 -> 5011: error forwarding port 5011 to pod 2d40e44288507f65a256ed7c591658cd1f5caf7f268feb34afda01be480de6c8, uid : unable to do port forwarding: socat not found.
我从互联网上搜索并尝试在本地 Mac OS Catalina 中安装 socat:
brew install socat
$ socat -h
socat by Gerhard Rieger and contributors - see www.dest-unreach.org
Usage:
socat [options] <bi-address> <bi-address>
options:
-V print version and feature information to stdout, and exit
并在远程服务器的 pod 中安装 socat:
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& apk add --no-cache curl socat
当我调试时,错误仍然存在,我应该如何解决这个问题并通过kubernetes pod远程调试启用?我错过了什么吗?
【问题讨论】:
标签: kubernetes