0

I'm following this article https://kubernetes.io/blog/2020/05/21/wsl-docker-kubernetes-on-the-windows-desktop/ but I'm facing and issue.

So Windows 10, WSL2 enabled with Ubuntu 22.04 and Docker Desktop.

Using Kind I tried to create a cluster using the command: kind create cluster --name wslkind

But after that, a kubectl get nodes shows:

NAME                    STATUS     ROLES    AGE     VERSION
wslkind-control-plane   NotReady   master   8m22s   v1.17.0

A describe is giving this reason:

Ready            False   Thu, 29 Dec 2022 21:14:54 +0100   Thu, 29 Dec 2022 21:02:26 +0100   KubeletNotReady              runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized

I don't know how to fix that issue.

I'm expecting a ready status of the nodes

VLAZ
  • 26,331
  • 9
  • 49
  • 67
  • You need to install a network plugin, like calico. – Chris Dec 29 '22 at 20:41
  • 1
    Well, I thought that using Kubernetes in Docker meant not having to set up a CNI layer such as calico, or flannel – DrCyclotron Dec 29 '22 at 21:16
  • For the record, the default behavior of Kind under Linux does not require setting up a network plugin. I'm not familiar with WSL and I don't have a Windows system handy on which to test it. – larsks Dec 29 '22 at 22:01
  • Well in that case: What is the status of the network plugin pods? What do their logs say? – Chris Dec 30 '22 at 08:04
  • Well if in Docker Desktop I expose daemon on tcp://localhost:2375 without TLS, then one pod is crashing only with this log `...Failed to read file /lib/modules/5.10.102.1-microsoft-standard-WSL2/modules.builtin with error open /lib/modules/5.10.102.1-microsoft-standard-WSL2/modules.builtin: no such file or directory. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules` – DrCyclotron Dec 30 '22 at 10:23
  • `...Failed to load kernel module ip_vs with modprobe. You can ignore ... ...Failed to load kernel module ip_vs_rr with modprobe. You can ignore ... ...Failed to load kernel module ip_vs_sh with modprobe. You can ignore ... ...Failed to load kernel module nf_conntrack with modprobe. You can ignore ... ...Unknown proxy mode "", assuming iptables proxy ...Successfully retrieved node IP: 172.17.0.2 ...Using iptables Proxier. ...Version: v1.17.0 ...Set sysctl 'net/netfilter/nf_conntrack_max' to 393216 ...open /proc/sys/net/netfilter/nf_conntrack_max: permission denied` – DrCyclotron Dec 30 '22 at 10:24

1 Answers1

0

I gave up with WSL + Docker Desktop. Instead I installed Docker Engine on Ubuntu directly on the wsl and no issue anymore.

sudo apt-get update
sudo apt-get remove -t docker docker-engine docker.io containerd runc
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
VLAZ
  • 26,331
  • 9
  • 49
  • 67