Score:0

Installing MicroK8S on Ubuntu 22.10

kh flag

Purpose: Using Ubuntu installed in WSL2 as a development env for Cloud Native Apps.

Required installation: MicroK8S, which requires systemd, snap

References:

  1. https://ubuntu.com/blog/ubuntu-wsl-enable-systemd
  2. https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/

WSL Version:

WSL version: 0.70.4.0
Kernel version: 5.15.68.1
WSLg version: 1.0.45
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22000.1098

Results (after applying the references):

  1. ~# ps -ef

    root           1       0  0 16:22 ?        00:00:02 /sbin/init  # I think this should be systemd
    
  2. ~# sudo snap install microk8s --classic

    Interacting with snapd is not yet supported on Windows Subsystem for Linux.
    This command has been left available for documentation purposes only.
    

What is wrong / missing

Thanks in advance.

Ali

** **: I had tried 20.04 and 22.04 before by addding wsl.conf with [boot] systemd=true

us flag
As it says, interacting with snapd is not yet supported in WSL. Use regular Ubuntu instead.
a.lgl avatar
kh flag
If systemd is enabled then snapd works according to the refs i given above. ( windows 10/Ubuntu 20.04 works with https://youtu.be/cWlYe0CE2iU )
a.lgl avatar
kh flag
Finally! ( But not in the way proposed by the official references given above. Perhaps I am doing something wrong) Ubuntu Version: 22.04 . Apply https://github.com/DamionGans/ubuntu-wsl2-systemd-script/tree/4d221c4f9bf89187eee7cd7ee298e5344190b191 but replace -a with -m -p as advised by pablorq (https://github.com/DamionGans/ubuntu-wsl2-systemd-script/issues/36)
Score:1
kh flag

As noted in WSL 299. Snap won't work with Ubuntu 22.10, you will need to wait for snapd 2.57.5+22.10 to be released. You can wait or downgrade to Ubuntu 22.04 LTS.

Score:1
sn flag

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 | +--------+----------+---------+---------------+---------------------------+-------------+---------+---------

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.