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.
Apr 14, 2021 Download files and build them with your 3D printer, laser cutter, or CNC. Thingiverse is a universe of things. Thanks for giving Multipass a try. In Multipass, we use Ubuntu cloud images by default, so there are a few things to be aware of. By default, cloud images do not have a user that has an enabled password. However, since they are cloud images, you can use cloud-init to provision your Multipass instance in many different ways.
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:
We can now find the IP address which has been allocated. Running:
… will return something like:
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:
Then install the MicroK8s snap and configure the network:
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:
Shutdown the VM:
Delete and cleanup the VM:
Raspberry Pi/ARM
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:
Note: In some Raspberry Pi Linux distributions the boot parameters are in `/boot/firmware/nobtcmd.txt`.
And adding the following:
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:
Remove old state of 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:
Restart microk8s:
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.
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:
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:
(substitute the actual names of the files you downloaded)
For all OSes, MicroK8s can then be installed with the following commands:
Note that in an offline environment, the snap will not be able to contact the store for
any updates.
Simulating a network
Multipass Gif
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.
Multipass Leeloo
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