Alternative installs (MacOS/Windows 10/Multipass)
MicroK8s is spectacularly easy to install and use on Ubuntu or any Linux which
supports snaps. For other platforms or less common scenarios, see the relevant
notes below.
Windows 10
Note: We recommend Windows 10 Professional or Windows 10 Enterprise. MicroK8s will also require at least 4GB of available RAM and 40GB of storage.
Download the MicroK8s Installer
Download the latest installer hereRun the installer
The installer checks if Hyper-V is available and switched on. If you don’t have Hyper-v (e.g. on Windows 10 Home edition) it is possible to use VirtualBox as an alternative.Configure MicroK8s
You can now configure MicroK8s - the minimum recommendations are already provided.
For information on changing the ‘Snap Track’, see this page.
You can change this configuration at a later date by re-running the installer. Note that the Memory and Disk limits are initially set at the minimum values. If you are planning on running large workloads (e.g.kubeflow
will require around 12GB RAM) you will want to set these higher.Open a command line
Check the status while Kubernetes starts
microk8s status --wait-ready
Turn on the services you want
MicroK8s includes a series of add-ons and services which can be enabled at any time. For example:microk8s enable dashboard dns registry istio
Try runningmicrok8s enable --help
for a list of built-in services.
Turn off services with themicrok8s disable
command.Start using Kubernetes!
MicroK8s wraps thekubectl
command familiar to Kubernetes users, so you can simply perform any usual Kubernetes operation. Try:microk8s kubectl get all --all-namespaces
Access the Kubernetes dashboard
microk8s dashboard-proxy
Start and stop Kubernetes
Kubernetes is a collection of system services that talk to each other all the time. If you don’t need them running in the background then you will save battery and resources by stopping them.microk8s start
andmicrok8s stop
will do the work for you.
What next?
- Want to experiment with alpha releases of Kubernetes? See the documentation on setting channels.
- Need to tweak the Kubernetes configuration? Find out how to configure the Kubernetes services.
- Having problems? Check out our troubleshooting section.
- Love MicroK8s? Want to contribute or suggest a feature? Give us your feedback.
macOS
Note: Installing MicroK8s with Multipass requires macOS Yosemite, version 10.10.3 or later installed on hardware from 2010 onwards. It will also require at least 4GB of available RAM and 40GB of storage.
Note: Some users, who have upgraded to Big Sur, have experienced issues with Homebrew and Python when installing MicroK8s. To fix this, run brew reinstall python
.
The installer for MicroK8s uses HomeBrew. If you don’t have the brew
command you can install it from the Homebrew website.
Download the MicroK8s installer
brew install ubuntu/microk8s/microk8s
Run the installer
microk8s install
Check the status while Kubernetes starts
microk8s status --wait-ready
Turn on the services you want
microk8s enable dashboard dns registry istio
Trymicrok8s enable --help
for a list of available services built in. Themicrok8s disable
command turns off a service.Start using Kubernetes!
microk8s kubectl get all --all-namespaces
Access the Kubernetes dashboard
microk8s dashboard-proxy
Start and stop Kubernetes
Kubernetes is a collection of system services that talk to each other all the time. If you don’t need them running in the background then you will save battery/resources by stopping them. themicrok8s start
andmicrok8s stop
commands will do the work for you.
Multipass
With multipass installed, you can now create a VM to run MicroK8s. At least 4
Gigabytes of RAM and 40G of storage is recommended – we can pass these
requirements when we launch the VM:
multipass launch --name microk8s-vm --mem 4G --disk 40G
We can now find the IP address which has been allocated. Running:
multipass list
… will return something like:
Name State IPv4 Release
microk8s-vm RUNNING 10.72.145.216 Ubuntu 18.04 LTS
Take a note of this IP as services will become available there when accessed
from the host machine.
To work within the VM environment more easily, you can run a shell:
multipass shell microk8s-vm
Then install the MicroK8s snap and configure the network:
sudo snap install microk8s --classic --channel=1.18/stable
sudo iptables -P FORWARD ACCEPT
From within the VM shell, you can now follow along the rest of the
quick start instructions
Useful multipass commands
Get a shell inside the VM:
multipass shell microk8s-vm
Shutdown the VM:
multipass stop microk8s-vm
Delete and cleanup the VM:
multipass delete microk8s-vm
multipass purge
Raspberry Pi/ARM
Note: Running Kubernetes can cause a lot of I/O requests and pressure on storage. It is not recommended to use a USB stick as primary storage when running MicroK8s.
Running MicroK8s on some ARM hardware may run into difficulties because cgroups
(required!) are not enabled by default. This can be remedied on the Rasberry Pi
by editing the boot parameters:
sudo vi /boot/firmware/cmdline.txt
Note: In some Raspberry Pi Linux distributions the boot parameters are in `/boot/firmware/nobtcmd.txt`.
And adding the following:
cgroup_enable=memory cgroup_memory=1
To address disk performance issues often present on Raspberry Pi see the troubleshooting section.
Systems using ZFS
There is currently an issue surrounding using MicroK8s on a ZFS filesystem due
to the way containerd is configured. If you have installed MicroK8s on ZFS
you can fix this:
Stop microk8s:
microk8s stop
Remove 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
replacingsnapshotter = "overlayfs"
withsnapshotter = "zfs"
Create 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 deployments
There are situations where it is necessary or desirable to run MicroK8s on a
machine not connected to the internet. This is possible, but there are a few
extra things to be aware of.
Downloading a snap
If the machine you are intending to install MicroK8s to has no connectivity at
all, it is possible to download the snap from a machine which does have
access to the internet.
snap download microk8s
this will retrieve two files 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).
If you are installing on a non-Ubuntu OS, you will also need to download the core
snap, in a similar way:
snap download core
this will retrieve an additional two files to the local directory:
- core_xxx.snap: The snap package with a versioned suffix.
- core_xxx.assert: The assertion file (effectively a signature validating the package).
Transfer the files to the target, offline machine.
In the case of non-Ubuntu OSes, install the core snap first:
snap ack core_9993.assert
snap install core_9993.snap
(substitute the actual names of the files you downloaded)
For all OSes, MicroK8s can then be installed with the following commands:
sudo snap ack microk8s_993.assert
sudo snap install microk8s_993.snap
Note that in an offline environment, the snap will not be able to contact the store for
any updates.
Simulating a network
In some environments, as well as being offline, there is no network capability
at all (e.g. no NIC hardware). In such cases the Kubernetes apiserver will not
be able to work. This can be solved by simulating hardware (e.g. in a VM) or
adding a virtual address.
For an example, see this answer on askubuntu.
Setting up proxies
While the above method works fine for MicroK8s itself, in a true offline environment additional difficulties will be encountered when enabling various add-ons. The content of the add-ons themselves are fetched when they are first enabled. E.g. the istio
add-on fetches a tarball from github, the kubeflow
addon fetches resources from the Juju charm store. To enable MicroK8s to work offline with add-ons, the services required by the individual add-ons will need to be proxied locally. Setting up individual proxies is beyond the scope of this documentation. For Ubuntu systems, you may find the Server documentation useful.
Other architectures
Currently MicroK8s is actively tested and developed on amd64 and arm64. If you run into difficulties running on other architectures (e.g. PPC/S390), please follow the procedure to
file a bug
Last updated 2 months ago. Help improve this document in the forum.