Kubeflow is a great tool to implement and deploy Machine Learning pipelines on a Kubernetes cluster. It supports a lot of cloud platforms, but developers might want to experiment with it before deploying the pipeline to the cloud.
However, installation can be quite tricky. In this article, I will share with you the easiest and the most elegant way I personally find to install Kubeflow on MacOS. So without further ado, let’s start!
The best way I personally found to run Kubeflow on a local cluster is via Multipass and Microk8s. In essence, we are creating a lightweight Kubernetes cluster via Microk8s in a virtual Ubuntu instance created using Multipass.
First of all, you might ask: why not install Microk8s directly on the MacBook?
Well, while this is certainly feasible, a lot of tutorials and resources are targeted to Ubuntu. Some commands don’t work on MacOS and you might have a hard time getting around them. Also, it creates an extra layer of encapsulation, so if things get out of hand, you can just remove the instance and start over again.
Nevertheless, if you feel like installing Microk8s directly, then just go straight to step 4.
The recommended requirements are at least 14GB RAM and 50GB disk space. If you don’t have that much RAM, you could still try the following steps with the last step being slightly different. However, it is possible that the installation gets stuck due to insufficient memory.
Step 1: Install Multipass
brew cask install multipass
Step 2: Launch an instance
multipass launch --name kubeflow --mem 16G --disk 50G --cpus 4
Step 3: Go into the shell of the instance
multipass shell kubeflow
Step 4: Install Microk8s
sudo snap install microk8s --classic
Step 5: Check if the installation was successful
sudo microk8s status --wait-ready
Step 6: Join the “microk8s” group
This step is very important, since it will allow you to use commands that require admin privilege. DO NOT run all commands using sudo. This might cause permission problems later on.
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
Step 7: Exit shell and re-enter for the step 6 to take effect
multipass shell kubeflow
Step 8: Forward internet traffic
sudo iptables -P FORWARD ACCEPT
Step 9: Enable necessary services
microk8s.enable dns dashboard storage
Step 10: Install Kubeflow
if you have less than 14GB RAM, run the following command:
KUBEFLOW_IGNORE_MIN_MEM=true microk8s.enable kubeflow
That’s it! If the installation has been successful, you will see the following message: “Congratulations, Kubeflow is now available.”
If you like my articles, don’t forget to give them a clap 👏 and share them with your friends and colleagues! Cheers! 😉