MicroK8s on Windows, the Canonical way

MicroK8s is a compact Kubernetes distribution that will install a complete, single node cluster of Kubernetes on your PC. This is great for local development, CI/CD and for the edge where resources may be limited.

Installing MicroK8s is as simple as:

sudo snap install microk8s --classic 

On a Windows machine

MicroK8s and Kubernetes require a Linux kernel to operate. Currently, the way to achieve this is by running MicroK8s in a virtual machine (VM).

The Canonical way to get a VM on Windows is with multipass. Multipass gives you an easy to use interface to manage VMs on Windows, MacOS and Linux. You have the option of creating VMs with HyperV on Windows Pro and Enterprise or you can take advantage of a local installation of VirtualBox.

Here is what you have to do:

  • Go to https://github.com/CanonicalLtd/multipass/releases/ and grab the windows executable.
  • Open Command Prompt or PowerShell and run
multipass launch ubuntu -n microk8s-vm -mem 4G -disk 40G

Above, we name the VM microk8s-vm and we give it 4GB of RAM and 40GB of disk.

You can read more on the multipass installation and VM creation process here.

Getting MicroK8s in the VM

Installing MicroK8s is as simple as:

multipass exec microk8s-vm - sudo snap install microk8s -classic
multipass exec microk8s-vm - sudo iptables -P FORWARD ACCEPT

Where to go from here?

In our previous blog we showed how to manage the VM and the hosted MicroK8s so this is a good place to start getting familiar with this setup.

You may find interesting information on MicroK8s in the official docs.

Finally, have a look at the production grade offerings from Canonical Ltd. I am pleased to see how committed Canonical is. The production grade K8s distribution (CDK) runs on-premises and/or in public clouds. All offerings including MicroK8s, are covered by a simplified, coherent support contract.