This lab shows:
- how to install Kubeflow using Juju, MicroK8s on WSL2
-
If you are using Win 10 or Win 11, you should have Linux OS to install kubeflow
-
On Powershell:
wsl --setdefault Ubuntu-20.04
wsl -l -v # list all wsls
wsl --shutdown # to shutdown all wsl
- WSL2 has snap problem:
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
- Install MicroK8s:
sudo snap install microk8s --classic
microk8s status
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
# after commands, logout
exit
# if necessary, on the other powershell terminal, run
wsl -l -v # list all wsls
wsl --shutdown # to shutdown all wsl
# run again Ubuntu 20.04
- Install MicroK8s Plugins:
microk8s enable dns storage ingress metallb:10.64.140.43-10.64.140.49
# wait 3-4 mins
microk8s status --wait-ready
- Install Juju:
sudo snap install juju --classic
- Juju bootstrap existed K8s cluster, add-model and deploy:
juju bootstrap microk8s
juju add-model kubeflow
juju deploy kubeflow-lite --trust
- It will take time (20mins-45mins):
# monitoring the creating of the apps / containers
juju status --color
# monitoring the pods
microk8s kubectl get pods --all-namespaces
# monitoring K8s services
microk8s kubectl get svc -n kubeflow
# monitoring K8s all objects: services, pods, deployment, statefulset, daemonsets.
microk8s kubectl get all --all-namespaces
- After everything runs in normal (juju status --color), it is required to configure ingress to reach using browser
juju config dex-auth public-url=http://10.64.140.43.nip.io
juju config oidc-gatekeeper public-url=http://10.64.140.43.nip.io
juju config dex-auth static-username=admin
juju config dex-auth static-password=admin
- Install Ubuntu-Desktop, XRDP
sudo apt update
sudo apt install ubuntu-desktop xrdp
sudo apt install net-tools
ifconfig # to get IP of WSL Ubuntu
# use RDP (remote desktop application) to reach desktop
- Go to browser:
http://10.64.140.43.nip.io
- If it does not work:
microk8s kubectl get gateway -A
#If the response is No resources found you can force the charm to create it the following way:
juju run --unit istio-pilot/0 -- "export JUJU_DISPATCH_PATH=hooks/config-changed; ./dispatch"
- Minio is a object storage to store data (pipeline, output data, etc.)
- To see Minio console in browser:
microk8s kubectl get svc -n kubeflow | grep minio
microk8s kubectl port-forward svc/minio -n kubeflow 8081:9001 --address=0.0.0.0
http://localhost:8081/login
- To get Minio username and password:
microk8s kubectl get secrets -n kubeflow | grep minio
microk8s kubectl get secret minio-secret -n kubeflow -o yaml
data:
MINIO_ACCESS_KEY: bWluaW8=
MINIO_SECRET_KEY: UUhWTjJRVU5CNTlEMVVaTlpYVDVQWUczOVVRRjBN
echo bWluaW8= | base64 --decode
minio # username
echo UUhWTjJRVU5CNTlEMVVaTlpYVDVQWUczOVVRRjBN | base64 --decode
QHVN2QUNB59D1UZNZXT5PYG39UQF0M # password
- If one of the pod has always error, delete it, k8s automatically creates it:
microk8s kubectl delete pod dex-auth-0 -n kubeflow
- If there is still problem, shutdown WSL2 and restart WSL2.
sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig
sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target
exec sudo nsenter -t $(pidof systemd) -a su - $LOGNAME
microk8s status --wait-ready
juju status --color
response: ERROR cannot connect to k8s api server; try running 'juju update-k8s --client <k8s cloud name>'
juju clouds
juju update-k8s --client microk8s
- Monitor until all apps running correctly (all active)
juju status --color
microk8s kubectl get pods --all-namespaces