MicroK8s is a solution for teams wanting to deploy Kubernetes on Windows for developing and testing purposes. Below we include steps for quick set up on Windows.
MicroK8s, a Linux snap, is Ubuntu’s lightweight, CNCF-certified local distribution of Kubernetes that installs in 30 seconds or less. It runs all Kubernetes services natively on Ubuntu, or any operating system (OS) that supports snaps, and deploys a single cluster on a local PC. This gives teams flexibility to test microservices on a small scale, develop and train machine learning models locally, or embed upgradeable Kubernetes in IoT devices for easy evolution.
While MicroK8s automates the typical functions of Kubernetes locally, such as scheduling, scaling and debugging, it also adds another layer of reliability because it provides the latest Kubernetes for development. The latest upstream version of Kubernetes is always available on Ubuntu within one week of official release.
Kubernetes on Windows works by setting up a Kubernetes cluster in an Ubuntu VM.
With this is mind, MicroK8s and Kubernetes both need a Linux kernel to operate and require an Ubuntu VM, which can be created using Multipass. Multipass is the tool that instantly launches and manages Ubuntu VMs on Windows, MacOS and Linux. The VM provides another layer of security, isolating the Kubernetes instance from the outside world.
Kubernetes on Windows set up steps
What follows here are the steps to set up Multipass, interact with MicroK8s on the VM and how to add-on DNS to view the MicroK8s dashboard.
A basic MicroK8s add-on to set up is the Grafana dashboard. Below we show one way of accessing Grafana to monitor and analyse a MicroK8s instance. To do this execute:
multipass exec microk8s-vm -- /snap/bin/microk8s.enable dns dashboard Enabling DNS Applying manifest service/kube-dns created serviceaccount/kube-dns created configmap/kube-dns created deployment.extensions/kube-dns created Restarting kubelet DNS is enabled Enabling dashboard secret/kubernetes-dashboard-certs created serviceaccount/kubernetes-dashboard created deployment.apps/kubernetes-dashboard created service/kubernetes-dashboard created service/monitoring-grafana created service/monitoring-influxdb created service/heapster created deployment.extensions/monitoring-influxdb-grafana-v4 created serviceaccount/heapster created configmap/heapster-config created configmap/eventer-config created deployment.extensions/heapster-v1.5.2 created dashboard enabled
Next, check the deployment progress by running:
multipass exec microk8s-vm -- /snap/bin/microk8s.kubectl get all --all-namespaces
Which should return output similar to:
Once all services are running, access the dashboard. The image below shows the Grafana of our dashboard.
Kubernetes on Windows summary
MicroK8s gives teams the opportunity to test out their work before going public, automating the standard tasks of Kubernetes, while adding an extra layer of reliability.