How to install MicroK8s on macOS
If you’ve been waiting for the perfect Kubernetes dev solution for macOS, the wait is over. Learn how to install Microk8s on macOS.
If you’re a developer, chances are good you use open source software and your platform of choice could be macOS. Chances are also good that you’re developing for the cloud. You put those pieces together and the need for a tool like Microk8s would be quite handy.
Fortunately, Microk8s has finally arrived for macOS.
I’m going to walk you through the process of installing Microk8s on macOS–specifically, macOS 10.15.5.
SEE: Serverless computing: A guide for IT leaders (TechRepublic Premium)
What you’ll need
The only thing you’ll need to install Microk8s on macOS is a laptop or desktop running at least Yosemite.
What is Microk8s?
By definition, Microk8s is a CNCF certified upstream Kubernetes deployment, capable of running entirely on a workstation or edge device. Microk8s runs all Kubernetes services natively, while packing the entire set of libraries and binaries needed.
In other words, it’s an easy way to run Kubernetes on your desktop for development and testing purposes.
How to install the brew package manager
In order to install Microk8s on macOS, you’ll need to use the brew package manager. However, brew isn’t installed by default, so you must install this first.
In order to install brew on your macOS machine, open the macOS terminal window and issue the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
You will first be prompted for your user password. Once you successfully authenticate, you’ll then be required to hit Enter on your keyboard to continue with the installation.
When that installation completes (it can take some time as it needs to download a number of packages), you’re ready to install Microk8s.
How to install Microk8s
The first step is to download the Microk8s installer with the command:
brew install ubuntu/microk8s/microk8s
Again, this can take some time as it must download a number of packages. Once the installer is downloaded, install Microk8s with the command:
Before the installation begins, you’ll be asked to allow the setup of Multipass, which is used for virtual machines (VMs). Type Y and then, when prompted, type your user password. This will create a Microk8s VM and then dump you back at the terminal prompt.
When the installation completes, you can then view a list of enableable services with the command:
microk8s enable --help
Scroll through that list and find the services you want to enable. To enable those services, you’d issue a command like:
microk8s enable dashboard dns registry istio
At this point, you can start using Microk8s on macOS for all of your cloud (or non-cloud) development needs. This powerful tool can serve as a gateway to Kubernetes deployments, by way of your platform of choice.