You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My default WSL configuration has the networkingMode=mirrored option as described in the documentation.
I was able to install microk8s in WSL by following the directions at https://microk8s.io/docs/install-wsl2 with networkingMode=mirrored.
After I updated a few settings, rebooted the WSL and my machine, I am no longer able to run microk8s. I tried purging everything with snap and apt, restarting, and doing another install of microk8s with the snap install command, but the install command would fail.
Upon inspection, journalctl -xe would print this line every time the install failed: microk8s.daemon-containerd[ ]: containerd: failed to get listener for metrics endpoint: listen tcp 127.0.0.1:1338: bind: address already in use
Nothing is listening on 1338 on the host or the guest.
After some thinking, I tried switching my networking mode back to NAT, restarting WSL, and reinstalling microk8s. This worked. I was able to reinstall and run microk8s with networkingMode=NAT.
I tried going back to networkingMode=mirrored, but microk8s would hang forever at microk8s status --wait-ready.
What Should Happen Instead?
Microk8s should work with WSL's networkingMode=mirrored option.
If there is some technical incompatibility, then the documentation for WSL should call out that it is unstable with this option because none of the error logging makes it obvious.
Reproduction Steps
Windows 11 Pro version 10.0.26120
WSL version 2.4.10.0, Kernel version: 5.15.167.4-1
WSL Ubuntu 22.04.5 LTS
Add a .wslconfig file at $HOME\.wslconfig with the following
Install microk8s via snap install microk8s --classic.
In powershell, stop wsl: wsl --shutdown
Change the .wslconfig file to use NAT, run WSL and check microk8s status.
Shutdown WSL from powershell, change the networking mode back to mirrored and try checking microk8s status again. It should hang. Purging microk8s from the system at this point will make it impossible to reinstall via snap because of the port binding error.
Introspection Report
When it is in the stuck state, this command doesn't finish. I see only this output:
Inspecting system
Inspecting Certificates
Inspecting services
Service snap.microk8s.daemon-cluster-agent is running
FAIL: Service snap.microk8s.daemon-containerd is not running
For more details look at: sudo journalctl -u snap.microk8s.daemon-containerd
FAIL: Service snap.microk8s.daemon-kubelite is not running
For more details look at: sudo journalctl -u snap.microk8s.daemon-kubelite
Service snap.microk8s.daemon-k8s-dqlite is running
Service snap.microk8s.daemon-apiserver-kicker is running
Copy service arguments to the final report tarball
Inspecting AppArmor configuration
Gathering system information
Copy processes list to the final report tarball
Copy disk usage information to the final report tarball
Copy memory usage information to the final report tarball
Copy server uptime to the final report tarball
Copy openSSL information to the final report tarball
Copy snap list to the final report tarball
Copy VM name (or none) to the final report tarball
Copy current linux distribution to the final report tarball
Copy asnycio usage and limits to the final report tarball
Copy inotify max_user_instances and max_user_watches to the final report tarball
Copy network configuration to the final report tarball
Inspecting kubernetes cluster
Inspect kubernetes cluster
Can you suggest a fix?
I'm guessing that WSL's mirrored networking mode is doing something right as the process attempts to bind to port 1338, and maybe that's causing a conflict. Maybe there's a different way to do this or a workaround when bind fails.
Are you interested in contributing with a fix?
Maybe if the implementation is clear enough.
The text was updated successfully, but these errors were encountered:
Summary
My default WSL configuration has the networkingMode=mirrored option as described in the documentation.
I was able to install microk8s in WSL by following the directions at https://microk8s.io/docs/install-wsl2 with networkingMode=mirrored.
After I updated a few settings, rebooted the WSL and my machine, I am no longer able to run microk8s. I tried purging everything with snap and apt, restarting, and doing another install of microk8s with the snap install command, but the install command would fail.
Upon inspection,
journalctl -xe
would print this line every time the install failed:microk8s.daemon-containerd[ ]: containerd: failed to get listener for metrics endpoint: listen tcp 127.0.0.1:1338: bind: address already in use
Nothing is listening on 1338 on the host or the guest.
After some thinking, I tried switching my networking mode back to NAT, restarting WSL, and reinstalling microk8s. This worked. I was able to reinstall and run microk8s with networkingMode=NAT.
I tried going back to networkingMode=mirrored, but microk8s would hang forever at
microk8s status --wait-ready
.What Should Happen Instead?
Microk8s should work with WSL's
networkingMode=mirrored
option.If there is some technical incompatibility, then the documentation for WSL should call out that it is unstable with this option because none of the error logging makes it obvious.
Reproduction Steps
$HOME\.wslconfig
with the followingsnap install microk8s --classic
.wsl --shutdown
Introspection Report
When it is in the stuck state, this command doesn't finish. I see only this output:
Can you suggest a fix?
I'm guessing that WSL's mirrored networking mode is doing something right as the process attempts to bind to port 1338, and maybe that's causing a conflict. Maybe there's a different way to do this or a workaround when bind fails.
Are you interested in contributing with a fix?
Maybe if the implementation is clear enough.
The text was updated successfully, but these errors were encountered: