Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy MicroK8s- to Windows, macOS and Raspberry Pi

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "how to deploy MicroK8s- to Windows, macOS and Raspberry Pi". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to deploy MicroK8s- to Windows, macOS and Raspberry Pi.

Other deployment methods for MicroK8s

MicroK8s is easy to install on Ubuntu and supports other Linux systems with snap support. For other platforms, refer to:

Https://microk8s.io/docs/install-alternatives

Simple comparison between MicroK8s and K3s

Getting started with MicroK8s

Deployment and Application of KubeFlow- in Microk8s

Windows 10

Although Windows 10 now has some new features, such as installing Ubuntu as app, integrated WSL2 has always lacked some support for running MicroK8s.

If you want to experience some MicroK8s running in semi-built-in mode (semi-natively), you can refer to discourse post on WSL2.

Now the best way to run MicroK8s to Windows is still virtualization. MicroK8s supports running in multiple virtual machines, including VirtualBox.

It is recommended that you use multipass to run MicroK8s. Windows installer is in download here and the installation guide is in here.

MacOS

Like Windows, multipass is recommended.

Download the multipass installer to multipass site. Refer to the following to run MicroK8s on multipass.

Multipass

When multipass is installed, you can create a virtual machine to run MicroK8s. At least 4 gigabytes of RAM and 40 gigabytes of storage are recommended, which can be passed to the startup command line:

Multipass launch-name microk8s-vm-mem 4G-disk 40G

Find IP address and run:

Multipass list

Return information:

Name State IPv4 Releasemicrok8s-vm RUNNING 10.72.145.216 Ubuntu 18.04 LTS

Note that the IP as services is available in host machine.

You can also go directly to VM environment and run shell:

Multipass shell microk8s-vm

Then install MicroK8s snap and configure the network:

Sudo snap install microk8s-classic-channel=1.17/stablesudo iptables-P FORWARD ACCEPT

In VM shell, do something else: quick start instructions.

Commonly used multipass commands

Enter shell to VM:

Multipass shell microk8s-vm

Stop VM:

Multipass stop microk8s-vm

Delete and clean up VM:

Multipass delete microk8s-vmmultipass purgeRaspberry Pi/ARM

Running MicroK8s may be difficult on some ARM hardware because cgroups (required!) It is not enabled by default. You can modify it by editing the boot parameter of Rasberry Pi:

Sudo vi / boot/firmware/nobtcmd.txt

Note: the boot parameter of the old Raspberry Pi is / boot/firmware/cmdline.txt.

Add the following parameters:

Cgroup_enable=memory cgroup_memory=1 uses ZFS

Currently there are some known problems with MicroK8s on a ZFS filesystem because of the way containerd is configured. If you use MicroK8s on ZFS, you can fix:

Stop microk8s:

Microk8s.stop

Remove the old state of containerd:

Sudo rm-rf / var/snap/microk8s/common/var/lib/containerd

Configure containerd to use ZFS: edit the file / var/snap/microk8s/current/args/containerd-template.toml to replace snapshotter = "overlayfs" use snapshotter = "zfs"

Create a new zfs dataset for containerd to use:

Zfs create-o mountpoint=/var/snap/microk8s/common/var/lib/containerd/io.containerd.snapshotter.v1.zfs $POOL/containerd

Restart microk8s:

Microk8s.start offline deployment

You can run MicroK8s on a machine that is not connected to internet, but there are a few things you need to know:

Download snap

It can be downloaded from another machine with the following command:

Snap download microk8s

Two files will be downloaded to the local directory:

Microk8s_xxx.snap: The snap package with a versioned suffix.

Microk8s_xxx.assert: The assertion file (effectively a signature validating the package).

Transfer the files to offline machine, and the MicroK8s installation uses the following command:

Sudo snap ack microk8s_993.assertsudo snap install microk8s_993.snap

In an offline environment, it will not be updated.

Simulated network

In some environments, there may be no network at all (e.g. No NIC hardware), and Kubernetes apiserver will not work. This can be solved by simulating the hardware to add a virtual IP address.

At this point, I believe you have a deeper understanding of "how to deploy MicroK8s- to Windows, macOS, and Raspberry Pi". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report