I have tried to install multi-node cluster in same host.
STEP-1 lxd init : all default except "Name of the new storage pool"
STEP-2
node-1: lxc lxc launch ubuntu:20.04 k8sn1
node-2: lxc lxc launch ubuntu:20.04 k8sw1
node-3: lxc lxc launch ubuntu:20.04 k8sw2
STEP-3:
lxc exec k8sn1 bash
run script from https://github.com/pablorq/ubuntu-wsl2-systemd-script ( after changing enter-systemd-namespace script -a -> -m -p)
STEP-4:
Restart and repeat
STEP-5:
ps -ef: systemd enabled , snapd , lxd ok!
STEP-6:
sudo snap install microk8s --classic
From now on seems weird:
microk8s status --> microk8s is not running. Use microk8s inspect for a deeper inspection.
microk8s kubectl cluster-info --> Kubernetes control plane is running at https://127.0.0.1:16443
microk8s kubectl get all --all-namespaces -->
kube-system pod/calico-node-tdclz 1/1 Running 0 98s
kube-system pod/calico-kube-controllers-f4c5ffbdc-xfxfc 1/1 Running 0 98s
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default service/kubernetes ClusterIP 10.152.183.1 443/TCP 105s
NAMESPACE NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR
AGE
kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 104s
NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE
kube-system deployment.apps/calico-kube-controllers 1/1 1 1 104s
NAMESPACE NAME DESIRED CURRENT READY AGE
kube-system replicaset.apps/calico-kube-controllers-54c85446d4 0 0 0 100s
kube-system replicaset.apps/calico-kube-controllers-f4c5ffbdc 1 1 1 98s
I think it is time to give up using wsl as a development environment for kubernetes.
Notes:
host and lxc have the same Ubuntu version, 20.04
lxc storage list -->
NAME | DRIVER | SOURCE | DESCRIPTION | USED BY | STATE |
+---------+--------+--------------------------------------------+-------------+---------+---------+
| iot-lab | btrfs | /var/snap/lxd/common/lxd/disks/iot-lab.img | | 3 | CREATED
lxc network list -->
eth0 | physical | NO | | | | 0 | |
+--------+----------+---------+---------------+---------------------------+-------------+---------+---------+
| lxdbr0 | bridge | YES | 10.25.76.1/24 | fd42:e2dc:d3f6:4774::1/64 | | 2 | CREATED |
+--------+----------+---------+---------------+---------------------------+-------------+---------+---------