Install Kubeflow

The Juju Operator Lifecycle Manager leverages the concept of Charms, Kubernetes operator packages and provides easy operations (install, upgrade, integrate, remove) for your Kubeflow applications.

Note: If you are installing Kubeflow on top of MicroK8s, there is a specific add-on which will install and configure Kubeflow for you. See the instructions in the MicroK8s documentation.

The following steps allow you to install Kubeflow on any Kubernetes, provided that you have access to it via kubectl:

1. Install the Juju OLM

snap install juju --classic

Alternatively, you can brew install juju on macOS or download the Juju installer for Windows. If you are running a version of Linux which doesn’t yet support snap packages, see the Juju install page.

2. Point Juju at your Kubernetes cluster

If your kubectl config file is in the standard location (~/.kube/config on Linux), and you only have one k8s cluster, you can simply run:

juju add-k8s myk8scloud

If your kubectl config file contains multiple clusters, you can specify the appropriate one by name:

juju add-k8s myk8scloud --cluster-name=juju-cluster

To use a different config file, you can set the KUBECONFIG environment variable to point to the relevant file. For example:

KUBECONFIG=path-to-kubeconfig-file juju add-k8s myk8scloud --cluster-name=my_cluster_name

For more details, see the Juju documentation.

3. Create a controller

To operate in the cluster, Juju needs to create a controller with the bootstrap command:

juju bootstrap myk8scloud my-controller

You can read more about controllers in the Juju documentation.

4. Create a model

A Juju model is a blank canvas where your charm operators will be deployed. While creating a model, you can specify a name, e.g. kubeflow, and your Kubeflow applications will be deployed into a Kubernetes namespace with that name.

Create a Juju model with the command:

juju add-model kubeflow

5. Deploy Kubeflow

Once you have a model, it is possible to juju deploy any of the Kubeflow bundles into your cluster.

To deploy the full kubeflow bundle, it is recommended that you have at least 2 CPUs, 14Gb of free RAM, and 50Gb of disk available on your Linux machine or VM. If you have fewer resources consider deploying either the kubeflow-lite or kubeflow-edge bundles.

For the Kubeflow lite bundle, run:

juju deploy kubeflow-lite

Congratulations, Kubeflow is now installing!

You can observe your Kubeflow deployment getting spun-up with the command:

watch -c juju status --color

NOTE: There are currently a few manual steps required after deployment, described in the two steps below:

6. Add an RBAC role for istio

The istio-ingressgateway requires access to Kubernetes resources. The following command will create the appropriate role:

kubectl patch role -n kubeflow istio-ingressgateway-operator -p '{"apiVersion":"rbac.authorization.k8s.io/v1","kind":"Role","metadata":{"name":"istio-ingressgateway-operator"},"rules":[{"apiGroups":["*"],"resources":["*"],"verbs":["*"]}]}'

7. Set the public-url for dex-auth and oidc-gatekeeper:

juju config dex-auth public-url=http://<URL>
juju config oidc-gatekeeper public-url=http://<URL>

Where <URL> is the hostname that the Kubeflow dashboard responds to. On MicroK8s with the default MetalLB configuration, this should be set to http://10.64.140.43.xip.io.

Troubleshooting:

If you face any difficulties following these instructions, please create an issue here.

Surely just one page will suffice, since Kubeflow would install the same on any K8s cluster, with an extra paragraph for the fact that it’s built in to MicroK8s?

1 Like