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

wsl2下连接超时 #471

Open
Holinc19 opened this issue Dec 29, 2024 · 0 comments
Open

wsl2下连接超时 #471

Holinc19 opened this issue Dec 29, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Holinc19
Copy link

Describe the bug
在Windows11环境下用kt-connect调试应用正常,但切换到改Windows11中的wsl2来调试就经常连接超时

Log
root@DESKTOP-ILBE48G:/xl-o2# ktctl --kubeconfig ./xl-dev-kt.yml --debug --namespace=xl-test connect
11:56AM INF KtConnect start at 305286
11:56AM DBG Private Key generated
11:56AM DBG Public key generated
11:56AM ERR End with error: Post "https://192.168.88.91:6443/api/v1/namespaces/xl-test/configmaps": net/http: TLS handshake timeout
11:56AM INF Cleaning workspace
11:56AM INF Removing pid /root/.ktctl/connect-305286.pid
root@DESKTOP-ILBE48G:
/xl-o2# ktctl --kubeconfig ./xl-dev-kt.yml --debug --namespace=xl-test connect
11:57AM INF KtConnect start at 305596
11:57AM DBG Private Key generated
11:57AM DBG Public key generated
11:57AM INF Successful create config map kt-connect-public-key-bsou
11:57AM DBG Client address 192.168.3.250
11:57AM INF Deploy shadow deployment kt-connect-daemon-txhpj in namespace xl-test
11:57AM INF Waiting for shadow pod kt-connect-daemon-txhpj-6644d88674-hm9hp ...
11:57AM INF Shadow pod kt-connect-daemon-txhpj-6644d88674-hm9hp is ready
11:57AM INF Scan proxy CIDR in namespace scope
11:58AM DBG Request port forward to https://192.168.88.91:6443
Forwarding from 127.0.0.1:2222 -> 22
Forwarding from [::1]:2222 -> 22
11:58AM INF Port forward connection established
11:58AM DBG Child, os.Args = [ktctl --kubeconfig ./xl-dev-kt.yml --debug --namespace=xl-test connect]
Handling connection for 2222
11:58AM DBG Child, name = vpn(sshuttle), cmd.Args = [sshuttle --dns --to-ns 10.244.3.188 --verbose --ssh-cmd ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -i /root/.ktctl/connect/kt_bsou_id_rsa --remote [email protected]:2222 --exclude 127.0.0.1 10.244.0.0/24 10.244.4.0/24 10.244.2.0/24 10.244.3.0/24 10.97.0.0/16 10.106.0.0/16 10.100.0.0/16 10.96.0.0/16]
Starting sshuttle proxy (version 1.1.1).
c : Starting firewall manager with command: ['/usr/bin/python3', '/usr/local/bin/sshuttle', '-v', '--method', 'auto', '--firewall']
11:58AM INF Start vpn(sshuttle) at pid: 306466
11:58AM INF Proxy start successful
fw: Starting firewall with Python version 3.8.10
fw: ready method name nat.
c : IPv6 enabled: Using default IPv6 listen address ::1
c : Method: nat
c : IPv4: on
c : IPv6: on
c : UDP : off (not available with nat method)
c : DNS : on
c : User: off (available)
c : Subnets to forward through remote host (type, IP, cidr mask width, startPort, endPort):
c : (<AddressFamily.AF_INET: 2>, '10.244.0.0', 24, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '10.244.4.0', 24, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '10.244.2.0', 24, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '10.244.3.0', 24, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '10.97.0.0', 16, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '10.106.0.0', 16, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '10.100.0.0', 16, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '10.96.0.0', 16, 0, 0)
c : Subnets to exclude from forwarding:
c : (<AddressFamily.AF_INET: 2>, '127.0.0.1', 32, 0, 0)
c : (<AddressFamily.AF_INET: 2>, '127.0.0.1', 32, 0, 0)
c : (<AddressFamily.AF_INET6: 10>, '::1', 128, 0, 0)
c : DNS requests normally directed at these servers will be redirected to remote:
c : (<AddressFamily.AF_INET: 2>, '127.0.0.42')
c : (<AddressFamily.AF_INET: 2>, '127.0.0.42')
c : TCP redirector listening on ('::1', 12300, 0, 0).
c : TCP redirector listening on ('127.0.0.1', 12300).
c : DNS listening on ('::1', 12299, 0, 0).
c : DNS listening on ('127.0.0.1', 12299).
c : Starting client with Python version 3.8.10
c : Connecting to server...
Handling connection for 2222
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
11:59AM DBG Heartbeat port forward 2222 ticked at 2024-12-29 11:59:04
Handling connection for 2222
s: Running server on remote host with /usr/bin/python3 (version 3.5.2)
s: latency control setting = True
s: auto-nets:False
c : Connected to server.
fw: setting up.
fw: ip6tables -w -t nat -N sshuttle-12300
fw: ip6tables -w -t nat -F sshuttle-12300
fw: ip6tables -w -t nat -I OUTPUT 1 -j sshuttle-12300
fw: ip6tables -w -t nat -I PREROUTING 1 -j sshuttle-12300
fw: ip6tables -w -t nat -A sshuttle-12300 -j RETURN -m addrtype --dst-type LOCAL
fw: ip6tables -w -t nat -A sshuttle-12300 -j RETURN --dest ::1/128 -p tcp
fw: iptables -w -t nat -N sshuttle-12300
fw: iptables -w -t nat -F sshuttle-12300
fw: iptables -w -t nat -I OUTPUT 1 -j sshuttle-12300
fw: iptables -w -t nat -I PREROUTING 1 -j sshuttle-12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 127.0.0.42 -p udp --dport 53 --to-ports 12299
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 127.0.0.42 -p udp --dport 53 --to-ports 12299
fw: iptables -w -t nat -A sshuttle-12300 -j RETURN -m addrtype --dst-type LOCAL
fw: iptables -w -t nat -A sshuttle-12300 -j RETURN --dest 127.0.0.1/32 -p tcp
fw: iptables -w -t nat -A sshuttle-12300 -j RETURN --dest 127.0.0.1/32 -p tcp
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.244.0.0/24 -p tcp --to-ports 12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.244.4.0/24 -p tcp --to-ports 12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.244.2.0/24 -p tcp --to-ports 12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.244.3.0/24 -p tcp --to-ports 12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.97.0.0/16 -p tcp --to-ports 12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.106.0.0/16 -p tcp --to-ports 12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.100.0.0/16 -p tcp --to-ports 12300
fw: iptables -w -t nat -A sshuttle-12300 -j REDIRECT --dest 10.96.0.0/16 -p tcp --to-ports 12300
11:59AM DBG Heartbeat port forward 2222 ticked at 2024-12-29 11:59:33
Handling connection for 2222
12:00PM DBG Heartbeat port forward 2222 ticked at 2024-12-29 12:00:01
Handling connection for 2222
E1229 12:00:02.262118 305596 portforward.go:362] error creating forwarding stream for port 2222 -> 22: Timeout occured
E1229 12:00:30.679947 305596 portforward.go:340] error creating error stream for port 2222 -> 22: Timeout occured
Handling connection for 2222
12:00PM DBG Heartbeat port forward 2222 ticked at 2024-12-29 12:00:30
12:00PM DBG Heartbeat port forward 2222 ticked at 2024-12-29 12:00:59
Handling connection for 2222
E1229 12:00:59.345712 305596 portforward.go:340] error creating error stream for port 2222 -> 22: Timeout occured
12:01PM DBG Heartbeat port forward 2222 ticked at 2024-12-29 12:01:28
Handling connection for 2222
E1229 12:01:28.015766 305596 portforward.go:340] error creating error stream for port 2222 -> 22: Timeout occured

Environment (please complete the following information):

  • OS: [e.g. Ubuntu 20.04]
  • Kubernetes [e.g. 1.10.1]
  • KtConnect version 0.1.2

Additional context
Add any other context about the problem here.

@Holinc19 Holinc19 added the enhancement New feature or request label Dec 29, 2024
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