<p>I am trying to create cluster by using <a href="https://gridscale.io/en/community/tutorials/kubernetes-cluster-with-kubeadm/" rel="nofollow noreferrer">this article</a> in my WSl Ubuntu. But It returns some errors.</p>
<p>Errors:</p>
<pre><code>yusuf@DESKTOP-QK5VI8R:~/aws/kubs2$ sudo systemctl daemon-reload
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
yusuf@DESKTOP-QK5VI8R:~/aws/kubs2$ sudo systemctl restart kubelet
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
yusuf@DESKTOP-QK5VI8R:~/aws/kubs2$ sudo kubeadm init --pod-network-cidr=10.244.0.0/16
[init] Using Kubernetes version: v1.21.1
[preflight] Running pre-flight checks
        [WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
        [WARNING IsDockerSystemdCheck]: detected &quot;cgroupfs&quot; as the Docker cgroup driver. The recommended driver is &quot;systemd&quot;. Please follow the guide at https://kubernetes.io/docs/setup/cri/
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Port-6443]: Port 6443 is in use
        [ERROR Service-Docker]: docker service is not active, please run 'systemctl start docker.service'
        [ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
</code></pre>
<p>I don't understand the reason when I use <code>sudo systemctl restart kubelet</code>. Error like this occurs:</p>
<pre><code>docker service is not enabled, please run 'systemctl enable docker.service'
</code></pre>
<p>When I use:</p>
<pre><code>yusuf@DESKTOP-QK5VI8R:~/aws/kubs2$ systemctl enable docker.service
Failed to enable unit, unit docker.service does not exist.
</code></pre>
<p>But I have docker images still runnig:</p>
<p><a href="https://i.stack.imgur.com/Zs5eQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zs5eQ.png" alt="enter image description here" /></a></p>
<p>What is wrong while creating Cluster Kubernetes in WSL? Is there any good tutorial for creating cluster in WSL?</p>

Penguen
<p>Tutorial you're following is designed for cloud Virtual machines with Linux OS on them (this is important since WSL works a bit differently).
E.g. SystemD is not presented in WSL, behaviour you're facing is currently <a href="https://github.com/MicrosoftDocs/WSL/issues/457" rel="nofollow noreferrer">in development phase</a>.</p>
<p>What you need is to follow designated tutorial for WSL (WSL2 in this case). Also see that docker is set up on Windows machine and shares its features with WSL integration. Please find <a href="https://kubernetes.io/blog/2020/05/21/wsl-docker-kubernetes-on-the-windows-desktop/" rel="nofollow noreferrer">Kubernetes on Windows desktop tutorial</a> (this uses KinD or minikube which is enough for development and testing)</p>
<p>Also there's a <a href="https://kubernetes.io/blog/2020/05/21/wsl-docker-kubernetes-on-the-windows-desktop/#minikube-enabling-systemd" rel="nofollow noreferrer">part for enabling SystemD</a> which can potentially resolve your issue on a state where you are (I didn't test this as I don't have a windows machine).</p>
