Quick start guide to Kubeflow

currently under construction!

Ready to try out Kubeflow? This tutorial will guide you through the steps to get Kubeflow up and running with the minimum of hassle. To keep things simple, we are going to make the following assumptions:

  • You are running Ubuntu 20.04(focal) or later.

  • You have at least 16GB free memory and 20GB of disk space

  • You have access to the internet for downloading the snaps and charms required.

The fastest, simplest way to get started with Kubeflow is to set up a local Kubernetes with [MicroK8s][]. The low overheads required by MicroK8s make it ideal if you are trying to squeeze Kubeflow onto a laptop or virtual machine for a quick experiment or working on the move.

Install and prepare MicroK8s

The first step on our journey is to install MicroK8s. MicroK8s is installed from a snap package. The published snap maintains different channels for different releases of Kubernetes. As Kubeflow does not yet support the latest 1.22 version of Kubernetes, we will set the snap to install the 1.21 release of Kubernetes.

sudo snap install microk8s --classic --channel=1.21/stable

For MicroK8s to work without having to use sudo for every command, it creates a group called microk8s. To make it more convenient to run commands, you should add the current user to this group:

sudo usermod -a -G microk8s $USER

newgrp microk8s

It is also useful to make sure the user has the proper access and ownership of any kubectl configuration files

sudo chown -f -R $USER ~/.kube

MicroK8s will start up as soon as it is installed. It is a completely functional Kubernetes, running with the least amount of overhead possible. However, for our purposes we will need a Kubernetes with a few more features. A lot of extra services are available as MicroK8s “add-ons” - code which is shipped with the snap and can be turned on and off when it is needed. We can now enable some of these features to get a Kubernetes where we can usefully install Kubeflow. We will add a DNS service, so the applications can find each other, storage, an ingress controller so we can access Kubeflow components and the MetalLB load balancer application. These can all be enabled simply at the same time:

microk8s enable dns storage ingress metallb:

You can see that we added some detail when enabling MetalLB, in this case the address pool to use. Many of the add-ons have extra configuration options, which can be found in the [MicroK8s documentation][].

It can take some minutes for MicroK8s to install and set up these additional features. Before we do anything else, we should check that the add-ons have been enabled successfully and that MicroK8s is ready for action. We can do this by requesting the status, and supplying the --wait-ready option, which tells microk8s to finish whatever processes it is working on before returning:

microk8s status --wait-ready

Now we have a working Kubernetes ready, the next step is to install Juju.

Install Juju

[Juju][] is an opereation Lifecycle manager(OLM) for clouds, bare metal or Kubernetes. We will be using it to deploy and manage the components which make up Kubeflow.

As with MicroK8s, Juju is installed from a snap package:

sudo snap install juju --classic

As Juju already has a built-in knowledge of MicroK8s and how it works, there is no additional set up or configuration needed. All we need to do is run the command to deploy a Juju controller to the Kubernetes we set up with MicroK8s:

juju bootstrap microk8s

The controller is Juju’s agent, running on Kubernetes, which can be used to deploy and control the components of Kubeflow.

The controller can work with different models, which map to namespaces in Kubernetes. It is recommended to set up a specific model for Kubeflow:

juju add-model kubeflow

That’s it for installing Juju!

Deploying Kubeflow

Charmed Kubeflow is really a collection of charms. Each of these charms deploy and control one application which goes to make up Kubeflow. You can actually just install the components you want, by individually deploying the charms and relating them to each other to build up Kubeflow. For convenience though, there are three bundles available. The bundles are really a recipe for a particular deployment of Kubeflow, configuring and relating the applications so you end up with a working deployment with the minimum of effort.

The full Kubeflow bundle will require a lot of resources (at least 4 cpus, 14GB orf free RAM and 60GB of disk space), so unless you know that’s what you want and have the resources to match, we reccomend starting with the ‘kubeflow-lite’ bundle. (the contents of the bundles are shown in the [reference documentation][] ).

juju deploy cs:kubeflow-lite

Juju will now fetch the applications and begin deploying them to the MicroK8s Kubernetes. This process can take several minutes. You can track the progress by running:

watch -c juju status --color

This will show a list of the applications and their current status. Don’t be surprised if a few show up error messages to begin with - a lot of the components rely on the operation of others, so it can take some time before everything is ready and talking to one another.

While that is going in, there are two pieces of post-install configuration which can usefully be done at this point.

For authentication and allowing access to the dashboard service, some components will need to be configured with the URL to be allowed. This depends on the underlying network provider, but for the known case of running on a local MicroK8s, we also know what the URL will be. It can be configured with Juju using the following commands:

juju config dex-auth public-url=
juju config oidc-gatekeeperpublic-url=
1 Like