alibaba / kt-connect

A toolkit for Integrating with your kubernetes dev environment more efficiently
https://alibaba.github.io/kt-connect/#/
GNU General Public License v3.0
1.48k stars 230 forks source link

ktctl connect 无法连接到 k8s集群 #455

Open fengcharles opened 4 months ago

fengcharles commented 4 months ago

使用 命令连接的时候日志显示报错,请问下是什么问题导致的?

日志的首个错误出现在 5:39PM DBG Request port forward pod:53 -> local:16454 via https://xxx.com/k8s/clusters/c-rfb2l 5:39PM ERR Exit: connect to port-forward failed

以下是详细日志 5:38PM DBG Background task log to /tmp/kt-1554385902 5:38PM INF Using cluster context czt-test-1 (czt-test-1) 5:38PM INF KtConnect 0.3.7 start at 27509 (darwin arm64) 5:38PM DBG Rectify pod kt-rectifier-rhvcb created 5:38PM INF Fetching cluster time ... 5:39PM DBG Execute command [date +%s] in kt-rectifier-rhvcb:standalone 5:39PM DBG No time difference 5:39PM INF Using tun2socks mode 5:39PM DBG Found local domains: czt 5:39PM DBG Private Key generated 5:39PM DBG Public key generated 5:39PM INF Successful create config map kt-connect-shadow-nonky 5:39PM INF Deploying shadow pod kt-connect-shadow-nonky in namespace default 5:39PM INF Waiting for pod kt-connect-shadow-nonky ... 5:39PM DBG Find 3 kt pods 5:39PM INF Pod kt-connect-shadow-nonky is ready 5:39PM DBG Using port 64047 5:39PM DBG Request port forward pod:22 -> local:64047 via https://xxx.com/k8s/clusters/c-rfb2l 5:39PM INF Port forward local:64047 -> pod kt-connect-shadow-nonky:22 established 5:39PM INF Socks proxy established 5:39PM INF Tun device utun6 is ready 5:39PM DBG Found 30 IPs 5:39PM DBG Service CIDR are: [10.43.0.0/16] 5:39PM DBG Found 54 IPs 5:39PM DBG Pod CIDR are: [10.42.0.0/16 172.16.0.0/16] 5:39PM DBG Using cluster IP 5:39PM DBG Cluster CIDR are: [10.43.0.0/16 10.42.0.0/16 172.16.0.0/16] 5:39PM INF Adding route to 10.43.0.0/16 5:39PM DBG Task /sbin/ifconfig with args [ifconfig utun6 inet 10.43.0.0/16 10.43.0.0] 5:39PM DBG Task /sbin/route with args [route add -net 10.43.0.0/16 -interface utun6] 5:39PM INF Adding route to 10.42.0.0/16 5:39PM DBG Task /sbin/ifconfig with args [ifconfig utun6 add 10.42.0.0/16 10.42.0.0] 5:39PM DBG Task /sbin/route with args [route add -net 10.42.0.0/16 -interface utun6] 5:39PM INF Adding route to 172.16.0.0/16 5:39PM DBG Task /sbin/ifconfig with args [ifconfig utun6 add 172.16.0.0/16 172.16.0.0] 5:39PM DBG Task /sbin/route with args [route add -net 172.16.0.0/16 -interface utun6] 5:39PM DBG Task /usr/sbin/netstat with args [netstat -rn] 5:39PM INF Route to tun device completed 5:39PM INF Setting up dns in local mode 5:39PM DBG Dump hosts successful 5:39PM DBG Using port 16454 5:39PM DBG Request port forward pod:53 -> local:16454 via https://xxx.com/k8s/clusters/c-rfb2l 5:39PM ERR Exit: connect to port-forward failed 5:39PM DBG Cleaning workspace 5:39PM INF Removed pid file /Users/von/.kt/pid/connect-27509.pid 5:39PM DBG Received event "/Users/von/.kt/pid/connect-27509.pid": REMOVE 5:39PM INF Pid file was removed 5:39PM INF Removed key file /Users/von/.kt/key/kt-connect-shadow-nonky.key 5:39PM DBG Dropping hosts records ... 5:39PM INF Drop hosts successful 5:39PM INF Cleaning configmap kt-connect-shadow-nonky 5:39PM ERR Delete configmap kt-connect-shadow-nonky failed error="Delete \"https://xxx.com/k8s/clusters/c-rfb2l/api/v1/namespaces/default/configmaps/kt-connect-shadow-nonky\": read tcp 10.8.0.22:57636->172.16.102.44:443: read: no route to host" 5:39PM INF Cleaning shadow pod kt-connect-shadow-nonky 5:39PM ERR Delete shadow pod kt-connect-shadow-nonky failed error="Delete \"https://xxx.com/k8s/clusters/c-rfb2l/api/v1/namespaces/default/pods/kt-connect-shadow-nonky\": net/http: TLS handshake timeout"

Environment (please complete the following information):

fengcharles commented 1 month ago

非常感谢!

冯银鹏

@. | ---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2024年5月6日 19:19 | | 收件人 | @.> | | 抄送人 | @.>, @.***> | | 主题 | Re: [alibaba/kt-connect] ktctl connect 无法连接到 k8s集群 (Issue #455) |

@fengcharles 试试 kubevpn 吧😂

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>