microsoft / microsoft/WSL

The LoadBalancer type service in Kubernetes on WSL2 should be accessible from both Windows and WSL2.

Open
#12,473 7 comments 1 reaction 0 assignees View on GitHub
feature network question
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

I encountered an issue in wsl2 ubuntu22.04 while using Kind and its corresponding loadbalancer -- cloud-provider-kind.

I am using Docker Desktop shared between WSL2 and Windows, and I’ve tried both NAT and mirrored WSL2 network configurations.

Notably:

- In NAT mode, cloud-provider-kind needs to be started in privileged mode in WSL2. In this case, the external IP can only be accessed via curl from WSL2, and not from Windows. On Windows, the service can be accessed through localhost with the port kindccm exposing to host machine.
- In mirrored mode: cloud-provider-kind must be started in privileged mode on either Windows or WSL2, along with the --enable-lb-port-mapping=true flag, for the LoadBalancer service to be assigned an external IP. However, the external IP at this point is not accessible—it cannot be accessed from either WSL2 or Windows. service can only be accessed through localhost with the port kindccm exposing to host machine.

Both of these configurations can assign an external IP to a LoadBalancer service. However, is there a way to make the LoadBalancer service accessible directly through the external IP on both WSL2 and Windows, like it is on macOS?

ref:
https://github.com/kubernetes-sigs/cloud-provider-kind
https://github.com/kubernetes-sigs/cloud-provider-kind/issues/189

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with WSL2 Ubuntu 22.04, Kind, and cloud-provider-kind under both NAT and mirrored networking, including --enable-lb-port-mapping=true. Compare access to the assigned LoadBalancer external IP from Windows and WSL2; done means the service is directly reachable from both rather than only through localhost and kindccm's host port.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes, ubuntu
Domain
devops, networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.