Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fengcharles opened this issue Feb 22, 2024 · 1 comment
Open

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

fengcharles opened this issue Feb 22, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@fengcharles
Copy link

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

日志的首个错误出现在
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):

  • Kubernetes [e.g. 1.10.1]
  • KT Version 0.3.7
  • Client Version: v1.27.2
  • Kustomize Version: v5.0.1
  • Server Version: v1.21.13
@fengcharles fengcharles added the enhancement New feature or request label Feb 22, 2024
@fengcharles
Copy link
Author

fengcharles commented May 7, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants