Deploy Kubeflow and MLFlow using juju on MicroK8s Cluster

Deploy Kubeflow and MLFlow using juju on MicroK8s Cluster

We will deploy Kubeflow and MLFlow on our MicroK8S Cluster using juju application modeling tool.

Ubuntu 22.04

https://releases.ubuntu.com/jammy

Juju

https://juju.is

MicroK8s

https://microk8s.io

Kubeflow

https://www.kubeflow.org

MLflow

Prepare your Ubuntu 22.04

sudo apt update && sudo apt upgrade -y

I prefer using htop, atop, nload, iftop, nvtop and btop for various system level indepth analysis, so we will install these tools using below mentioned commands.

sudo apt install htop atop nload iftop nvtop btop -y

Now we will install and configure microk8s a lightweight kubernetes distribution, we will install k8s 1.32 stable version for better performance and security.

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

sudo usermod -a -G microk8s $USER

newgrp microk8s

Now we will reboot our system to get microk8s working with our system.

sudo microk8s enable dns hostpath-storage metallb:192.168.100.240-192.168.100.254 rbac 

microk8s status

microk8s.enable gpu

Now install juju 

sudo snap install juju --channel=3.4/stable

mkdir -p ~/.local/share

Configure microk8s with juju 

microk8s config | juju add-k8s my-k8s --client

Now bootstrap juju controller inside microk8s cluster

juju bootstrap my-k8s kubeflow

Now add model for juju 

juju add-model kubeflow

Fix kernel parameters with below mentioned  commands

sudo sysctl fs.inotify.max_user_instances=1280

sudo sysctl fs.inotify.max_user_watches=655360

Now save it for permanent configuration in Sysctl file

sudo nano /etc/sysctl.conf

fs.inotify.max_user_instances=1280
fs.inotify.max_user_watches=655360

Now we will deploy kubeflow 1.9 stable version using juju command

juju deploy kubeflow --trust --channel=1.9/stable

To check the deployment status

juju status

watch juju status 

Configure dex auth to access the application  using juju config command

juju config dex-auth static-username=kubeflow
juju config dex-auth static-password=Pakistani

Now check ip from metallb  load balancer has been assigned  to kubeflow dashboard

microk8s kubectl -n kubeflow get svc istio-ingressgateway-workload -o jsonpath='{.status.loadBalancer.ingress[0].ip}'

Deploy MLFlow

Now we will deploy MLflow and integrate it with kubeflow

juju deploy mlflow --channel=2.15/stable --trust
juju integrate mlflow-server:ingress istio-pilot:ingress
juju integrate mlflow-server:dashboard-links kubeflow-dashboard:links

microk8s kubectl -n kubeflow get svc istio-ingressgateway-workload -o jsonpath='{.status.loadBalancer.ingress[0].ip}'

Refences:

https://mlflow.org

https://microk8s.io/docs/getting-started

https://charmhub.io/kubeflow/docs/get-started

https://documentation.ubuntu.com/charmed-mlflow/en/latest/tutorial/mlflow-kubeflow