Skip to content

Instantly share code, notes, and snippets.

@shivaylamba
Last active September 1, 2024 07:53
Show Gist options
  • Save shivaylamba/95479a6ba31b15f4f057576dc0ccd03c to your computer and use it in GitHub Desktop.
Save shivaylamba/95479a6ba31b15f4f057576dc0ccd03c to your computer and use it in GitHub Desktop.

Charmed Kubeflow Installation Guide

Prerequisites

  • Ubuntu 20.04 (Focal) or later
  • A host machine with at least:
    • 4-core CPU processor
    • 32GB RAM
    • 50GB of disk space available

Installation Steps

1. Install and Configure MicroK8s

# Install MicroK8s
sudo snap install microk8s --channel=1.29-strict/stable

# Set permissions
sudo usermod -a -G snap_microk8s ubuntu
sudo newgrp snap_microk8s

# Enable required add-ons
sudo microk8s enable dns hostpath-storage metallb:10.64.140.43-10.64.140.49 rbac

# Verify status
sudo microk8s status

2. Install Juju

# Install Juju
sudo snap install juju --channel=3.4/stable

# Create required directory
sudo mkdir -p ~/.local/share

# Configure MicroK8s with Juju
sudo microk8s config | sudo juju add-k8s my-k8s --client

# Deploy Juju controller
sudo juju bootstrap my-k8s uk8sx

# Add Kubeflow model
sudo juju add-model kubeflow

3. Deploy Charmed Kubeflow

# Increase inotify limits
sudo sysctl fs.inotify.max_user_instances=1280
sudo sysctl fs.inotify.max_user_watches=655360

# To make inotify limits persist across machine restarts:
sudo bash -c 'cat << EOF >> /etc/sysctl.conf
fs.inotify.max_user_instances=1280
fs.inotify.max_user_watches=655360
EOF'

# Apply changes
sudo sysctl -p

# Deploy Charmed Kubeflow
sudo juju deploy kubeflow --trust --channel=1.9/stable

# Monitor deployment status
sudo juju status --watch 5s

4. Configure Dashboard Access

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

# Set username and password
sudo juju config dex-auth static-username=admin
sudo juju config dex-auth static-password=admin

5. Verify Installation

  1. Open a browser and visit the IP address obtained in step 4.
  2. Log in using the credentials set in step 4.
  3. Follow the prompts to set up your namespace and access the Kubeflow dashboard.

Troubleshooting

If you encounter CrashLoopBackOff errors, ensure you've set the inotify limits as described in step 3. You can check pod status and logs using:

sudo microk8s kubectl get pod -n kubeflow
sudo microk8s kubectl logs -n kubeflow <name-of-the-pod>

For more information, refer to the official Charmed Kubeflow documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment