adamant-kite-43734
10/25/2024, 10:23 PMagreeable-xylophone-88850
10/25/2024, 10:25 PM192.168.127.2:7140
Windows `ipconfig`:
seese@Einstein MINGW64 ~
$ ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::4caf:e1fb:f212:75c5%4
IPv4 Address. . . . . . . . . . . : 10.0.0.10
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.1
Unknown adapter OpenVPN Data Channel Offload for NordVPN:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Unknown adapter Local Area Connection 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter Bluetooth Network Connection 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter vEthernet (WSL (Hyper-V firewall)):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::a099:4218:32d6:1b97%42
IPv4 Address. . . . . . . . . . . : 172.19.48.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
Ubuntu (not RD) `ifconfig`:
seese@Einstein:/mnt/c/Users/seese$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.61.52 netmask 255.255.240.0 broadcast 172.19.63.255
inet6 fe80::215:5dff:feb3:5a54 prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:b3:5a:54 txqueuelen 1000 (Ethernet)
RX packets 6199 bytes 883457 (883.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 2586 (2.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 733 bytes 60941 (60.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 733 bytes 60941 (60.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
veth-rd-wsl: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.143.2 netmask 255.255.255.0 broadcast 192.168.143.255
inet6 fe80::8835:32ff:fead:d840 prefixlen 64 scopeid 0x20<link>
ether 8a:35:32:ad:d8:40 txqueuelen 0 (Ethernet)
RX packets 434 bytes 41725 (41.7 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 365 bytes 33642 (33.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
agreeable-xylophone-88850
10/25/2024, 10:27 PM192.168.127.2
is not the pod IP, but the cluster hostIP
. here's one of the pod yamls:
apiVersion: v1
kind: Pod
metadata:
annotations:
agones.dev/container: game-server
agones.dev/ready-container-id: <docker://90ef6b47a85467138b2dea7f1dd60d22c9ae6e87883d0c87d95613073dae29a>5
agones.dev/sdk-version: 1.44.0
<http://cluster-autoscaler.kubernetes.io/safe-to-evict|cluster-autoscaler.kubernetes.io/safe-to-evict>: "false"
creationTimestamp: "2024-10-25T21:57:17Z"
# ...
# ...
status:
# ...
hostIP: 192.168.127.2
agreeable-xylophone-88850
10/25/2024, 10:28 PMagreeable-xylophone-88850
10/25/2024, 10:30 PMagreeable-xylophone-88850
10/25/2024, 10:41 PMfast-garage-66093
10/25/2024, 11:16 PMagreeable-xylophone-88850
10/25/2024, 11:16 PMcalm-sugar-3169
10/25/2024, 11:22 PMagreeable-xylophone-88850
10/26/2024, 12:04 AMecho-server.yaml
file which specifies to use a hostPort
calm-sugar-3169
10/26/2024, 1:08 AMagreeable-xylophone-88850
10/26/2024, 1:53 AMwsl ~ -d rancher-desktop
gives me a terminal for the RD WSL image that's running k3s
under the hood. Running ps | grep k3s
there does show it running as a bare metal process. So I'd expect that specifying hostPort
in a Pod
spec would show the port 12345
up as listening in netstat -peanut
:
~ # netstat -peanut
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:6443 0.0.0.0:* LISTEN 753/wsl-proxy
udp 0 0 127.0.0.1:323 0.0.0.0:* -
udp 0 0 ::1:323 :::*
am I correct that sans RD that running k3s would bind the port from the pod on the machine running k3s?
I also tried downgrading to k8s v1.27.12 to see if that would help, but it didn't
I'm starting to doubt my sanity haha. I stopped NordVPN services (which were running but not active) and I ensured I had nothing on my windows machine bound to ports 80/443fast-garage-66093
10/26/2024, 5:32 AMrdctl shell
to get a shell inside the "VM". We are running in a separate network namespace, and wsl -d rancher-desktop
will not switch to that namespace. So various things won't work correctly.agreeable-xylophone-88850
10/26/2024, 5:30 PMrdctl shell
I can confirm that port 12345
is being bound in the "VM"; this was ran from inside of rdctl shell
where 192.168.127.2
is the eth0
interface:
/ # curl 192.168.127.2:12345/param?query=demo
{"host":{"hostname":"192.168.127.2","ip":"::ffff:192.168.127.2","ips":[]},"http":{"method":"GET","baseUrl":"","originalUrl":"/param?query=demo","protocol":"http"},"request":{"params":{"0":"/param"},"query":{"query":"demo"},"cookies":{},"body":{},"headers":{"host":"192.168.127.2:12345","user-agent":"curl/8.5.0","accept":"*/*"}},"environment":{"PATH":"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","HOSTNAME":"echo-server","KUBERNETES_SERVICE_PORT":"443","KUBERNETES_SERVICE_PORT_HTTPS":"443","KUBERNETES_PORT":"<tcp://10.43.0.1:443>","KUBERNETES_PORT_443_TCP":"<tcp://10.43.0.1:443>","KUBERNETES_PORT_443_TCP_PROTO":"tcp","KUBERNETES_PORT_443_TCP_PORT":"443","KUBERNETES_PORT_443_TCP_ADDR":"10.43.0.1","KUBERNETES_SERVICE_HOST":"10.43.0.1","NODE_VERSION":"16.16.0","YARN_VERSION":"1.22.19","HOME":"/root"}}/
So this seems like a network routing issue from windows to the RD host, in which case I'd expect just ping 192.168.127.2
from Windows to work. With that said, not sure if the network tunneling does anything special for pods vs any port on the "VM"
FWIW, I'm running Windows 11 Pro 23H2, OS build 22631.4317
, Windows Feature Experience Pack 1000.22700.1041.0
calm-sugar-3169
10/28/2024, 6:03 PM192.168.127.2
from the windows host correct?calm-sugar-3169
10/28/2024, 6:04 PMcalm-sugar-3169
10/28/2024, 6:16 PMkubectl create deployment nginx --image=nginx
kubectl create service nodeport nginx --tcp=80:80 --node-port=32000
I can then access the nginx on the host at port 32000 using any of the available IP address on the host, e.g:
curl localhost:32000
or
curl 10.0.0.10:32000
but I still wouldn’t be able to talk to my service on that that IP address 192.168.127.2
. Because, that is for the subnet of the virtual network that runs inside a network namespace, and it is only accessible if you did rdctl shell
agreeable-xylophone-88850
10/28/2024, 6:30 PMtrying to access the pod on@calm-sugar-3169 Correct. My actual application is using Google's Agones K8s extensions which starts up game server pods, which the game client on Windows gets matched to and connects to. It doesn't make sense for me to make a service because these pods are ephemeral and there can be several of them, each with their own port assigned to the k3s host. I've been able to successfully do this application until some time this year (and for at least a year+ prior to that). I'm only recently discovering this because I've created a workflow without K8s that I use more often than K8s, but I used to only use K8s as almost a daily driver to do these kinds of game server hosting on my Windows machinefrom the windows host correct?192.168.127.2
agreeable-xylophone-88850
10/28/2024, 6:32 PMagreeable-xylophone-88850
10/28/2024, 6:35 PMlocalhost
rather than `192.168.127.2`; ideally I'd want to use whatever Agones/K8s thinks the host IP is, but I can manhandle that in development to ignore it and use localhost
if necessarycalm-sugar-3169
10/29/2024, 1:05 AMnetstat -ano | findstr "12345"
, I didn’t see anything exposed at all. That’s why I suggested exposing ports in my previous response. Furthermore, I can confirm that once you have your ports exposed on the host, you should have no problem accessing the pods via localhost
or any of the network interfaces on the host.agreeable-xylophone-88850
10/29/2024, 4:01 AMrdctl shell
I can do curl 127.0.0.1:12345/param?query=demo
(192.168.127.2
also works), but it's not showing up in netstat -alt
for some reason as I'd expect
Regardless, my product has a regression that needs to be fixed. The solutions I see going forward are:
• Moving away from RD and to self-managed k3s on a traditional WSL distro where hostPort will be accessible via the WSL network interface that's shared with Windows
• Creating an virtual network interface in windows that will route to the network namespace that k3s server is running in (either delivered via RD or 3rd party)
• Figuring out if I can find away to expose the the ephemeral, likely many, ports over to Windows, like using a service(s) with NodePort as you mentioned
The only solution that potentially involves feature dev for RD is the second bullet, but it seems like it might be the most difficult to implement, so I'll investigate the other 2 options first. The first option feels like the closest to a production environment, but I've otherwise been really enjoying having RD since onboarding is super simple
I really appreciate your time!! I'll let you know if I get anywhereagreeable-xylophone-88850
10/29/2024, 4:26 AMhostPort
definitions to bind to my WSL 172.19.61.52
interface since there is no namespaced network. Looks like my best solution is to fork RD at 1.14.2, cherry pick needed improvements, and deliver that fork to my customers that uses the legacy networking onlyfast-garage-66093
11/16/2024, 1:11 AMagreeable-xylophone-88850
11/16/2024, 1:16 AMwont-fix
or a "nice to have, but not sure the technical feasibility for it". I've already started maintaining a fork and distributing that installer to my users (though haven't figured out signing or auto updating yet).
Not sure if it's the easiest solution but adding back the legacy networking mode to allow me to opt in is one solution if upstream is to get it to work. My gut feeling (without the experience) is the other solution would require a new virtual network interface and some routing layer to the namespaced network of the new networking tunnel modefast-garage-66093
11/16/2024, 1:17 AMagreeable-xylophone-88850
11/16/2024, 1:18 AMfast-garage-66093
11/16/2024, 1:18 AMfast-garage-66093
11/16/2024, 1:19 AMagreeable-xylophone-88850
11/16/2024, 1:19 AMcalm-sugar-3169
11/18/2024, 6:55 PMcalm-sugar-3169
11/18/2024, 6:55 PMcalm-sugar-3169
11/18/2024, 6:57 PMagreeable-xylophone-88850
11/18/2024, 6:58 PMagreeable-xylophone-88850
11/18/2024, 6:58 PMcalm-sugar-3169
11/18/2024, 6:59 PM