Installieren von MicroK8S unter Ubuntu 22.10

Installieren von MicroK8S unter Ubuntu 22.10

Zweck: Verwenden von in WSL2 installiertem Ubuntu als Entwicklungsumgebung für Cloud Native Apps.

Erforderliche Installation: MicroK8S, das systemd erfordert, snap

Verweise:

  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

Ergebnisse(nach Anwendung der Referenzen):

  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.
    

Was ist falsch / fehlt

Dank im Voraus.

Ali

** **: Ich hatte zuvor 20.04 und 22.04 ausprobiert, indem ich wsl.conf mit [boot] systemd=true hinzugefügt habe

Antwort1

Wie inWSL 299. Snap funktioniert nicht mit Ubuntu 22.10. Sie müssen warten, bis Snapd 2.57.5+22.10 veröffentlicht wird. Sie können warten oder auf Ubuntu 22.04 LTS downgraden.

Antwort2

Ich habe versucht, einen Multi-Node-Cluster auf demselben Host zu installieren. SCHRITT 1 lxd init: alles Standard außer „Name des neuen Speicherpools“ SCHRITT 2 Knoten 1: lxc lxc launch ubuntu:20.04 k8sn1 Knoten 2: lxc lxc launch ubuntu:20.04 k8sw1 Knoten 3: lxc lxc launch ubuntu:20.04 k8sw2 SCHRITT 3: lxc exec k8sn1 bash run script fromhttps://github.com/pablorq/ubuntu-wsl2-systemd-script(nach dem Ändern des Skripts „enter-systemd-namespace“ –a -> –m –p) SCHRITT 4: Neustarten und wiederholen SCHRITT 5: ps –ef: systemd aktiviert, snapd, lxd ok! SCHRITT 6: sudo snap install microk8s –classic Von jetzt an sieht es seltsam aus:

microk8s status --> microk8s läuft nicht. Verwenden Sie microk8s inspect für eine genauere Untersuchung. microk8s kubectl cluster-info --> Die Kubernetes-Steuerebene läuft beihttps://127.0.0.1:16443 microk8s kubectl get all --all-namespaces --> kube-system pod/calico-node-tdclz 1/1 Läuft 0 98 s kube-system pod/calico-kube-controllers-f4c5ffbdc-xfxfc 1/1 Läuft 0 98 s

NAMESPACE NAME TYP CLUSTER-IP EXTERNE-IP PORT(S) ALTER Standarddienst/Kubernetes ClusterIP 10.152.183.1 443/TCP 105s

NAMESPACE-NAME GEWÜNSCHT AKTUELL BEREIT AKTUELL VERFÜGBAR KNOTEN-AUSWAHL ALTER kube-system daemonset.apps/calico-node 1 1 1 1 1 kubernetes.io/os=linux 104s

NAMESPACE NAME BEREIT AKTUELL VERFÜGBAR ALTER kube-system deployment.apps/calico-kube-controllers 1/1 1 1 104s

NAMESPACE-NAME GEWÜNSCHT AKTUELL BEREIT ALTER kube-system replicaset.apps/calico-kube-controllers-54c85446d4 0 0 0 100s kube-system replicaset.apps/calico-kube-controllers-f4c5ffbdc 1 1 1 98s

Ich denke, es ist an der Zeit, die Verwendung von WSL als Entwicklungsumgebung für Kubernetes aufzugeben.

Hinweise: Host und lxc haben die gleiche Ubuntu-Version, 20.04

lxc-Speicherliste --> NAME | TREIBER | QUELLE | BESCHREIBUNG | VERWENDET VON | STATUS | +---------+--------+-----------------------------------------+-------------+---------+---------+ | iot-lab | btrfs | /var/snap/lxd/common/lxd/disks/iot-lab.img | | 3 | ERSTELLT

lxc Netzwerkliste -->

eth0 | physisch | NEIN | | | | 0 | | +--------+----------+---------+-----------+---------------+---------------+---------------+-------------+---------+ | lxdbr0 | Brücke | JA | 10.25.76.1/24 | fd42:e2dc:d3f6:4774::1/64 | | 2 | ERSTELLT | +--------+----------+---------+---------------+---------------+-------------------------------+---------+---------

verwandte Informationen