kubernetes-sigs / cloud-provider-kind

Cloud provider for KIND clusters
Apache License 2.0
146 stars 35 forks source link

WSL2 support #100

Closed sky92zwq closed 2 months ago

sky92zwq commented 3 months ago

env: wsl2, ubuntu22.04

% go version                 
go version go1.21.4 linux/amd64
% kind version               
kind v0.20.0 go1.21.4 linux/amd64
% kubectl get svc
NAME                            TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)               AGE
envoy-default-eg-e41e7b31       LoadBalancer   10.96.164.54    172.18.0.3    80:31407/TCP          5d20h
envoy-gateway                   ClusterIP      10.96.240.27    <none>        18000/TCP,18001/TCP   4d23h
envoy-gateway-metrics-service   ClusterIP      10.96.163.151   <none>        19001/TCP             4d23h

I can see the external-ip, but it will be hang when curl the ip. % curl 172.18.0.3:80 And I deploy the example from this. It is same.

aojea commented 3 months ago

It seems this require some magic with docker https://github.com/microsoft/WSL/issues/4983#issuecomment-1560668422

What version of cloud provider kind are you using?

sky92zwq commented 3 months ago

It seems this require some magic with docker microsoft/WSL#4983 (comment)

What version of cloud provider kind are you using?

I use go install sigs.k8s.io/cloud-provider-kind@latest, maybe v0.3.0,(I don't find the command of cloud-provider-kind about version) And I tried the magic, but not success until now. my ip add shows like: inet 172.21.225.217/20 brd 172.21.239.255 scope global eth0 the address and the external-ip are Not in the same network segment. And I found I can't ping the external-ip 172.18.0.3 in WSL2 And I get into the container kindccm-5WRHPD52BKYNVNTNHIULBLNWIR4DMNZ4WECIGO2S , the 172.18.0.3 can be accessed.

aojea commented 2 months ago

should be fixed by https://github.com/kubernetes-sigs/cloud-provider-kind/pull/101

sky92zwq commented 2 months ago

works except this old-tiny issue

yukha-dw commented 1 week ago

Hello, does anyone know how to forward external IP from WSL2 to Windows? I can curl the IP inside WSL2, but because it is on separate network, I can't access it from Windows. Weirdly, I believe I was able to access them right away in the past