Skip to main content
Install Kubeflow
Last update:

Install Kubeflow

For your information

In the instructions, we look at installing Kubeflow version 1.5. The instruction is also suitable for installing version 1.6

  1. Connect Selectel ML Platform.
  2. Create a cloud server with Linux operating system.
  3. Connect to cloud server.
  4. Install kustomize on cloud server.
  5. Install kubectl on cloud server.
  6. Install Kubeflow on cloud server.

Connect ML platform

Kubeflow requires a Kubernetes cluster with StorageClass. Connect ML-platform — A ready-to-go Managed Kubernetes cluster will be automatically created.

Recommended versions of the Managed Kubernetes cluster:

KubeflowManaged Kubernetes
1.51.21
1.61.22

Create a cloud server

To install Kubeflow 1.5, you need kustomize version 3.2.0 (you can use version 3.2.0 for Kubeflow 1.6 too). The assembled binary for installing kustomize 3.2.0 is only available for Linux and amd64 operating system, so in the instructions we consider installation of all components on a cloud server with Linux.

For your information

If you are using a different CPU architecture or a different operating system, you may have problems using kustomize version 3.2.0

  1. In Control Panel, go to Cloud PlatformServers.

  2. Click Create Server.

  3. In the Source box, click Select another source and select a ready-made image with a Linux operating system (e.g. Ubuntu 18.04).

  4. Select the server boot disk. You can choose:

    We recommend using a disk size of at least 5 GB (minimum available size) — the cloud server requires space for the kustomize binary (~25 MB) and the Kubeflow manifest (~7 MB).

  5. In the Network block, select a private subnet with a public IP address. The IP address is needed to connect to the server via SSH.

  6. Create an SSH key and copy its public part. In the Access block, click Download SSH Key and insert the public portion of the key. Click Add Key.

  7. Select the rest of the server settings — see the Create Cloud Server instructions for details.

  8. Press Create.

Connect to the cloud server

  1. In Control Panel, go to Cloud PlatformServers.

  2. In the row with the cloud server, copy the value in the IP address column.

  3. Connect to the cloud server via SSH:

    ssh root@<IP_address> -i <path_to_private_key>

    Specify:

    • <IP_address> is the public IP address of the cloud server copied in step 2;
    • <path_to_private_key> is the path to the private part of the key.

Install kustomize on the cloud server

Kubeflow 1.5.0 is not compatible with kustomize versions above 4.x — we are looking at installing kustomize version 3.2.0

  1. Upload the binary file with the kustomize distribution to the cloud server:

    wget https://github.com/kubernetes-sigs/kustomize/releases/download/v3.2.0/kustomize_3.2.0_linux_amd64
  2. Install kustomize:

    install -o root -g root -m 0755 kustomize_3.2.0_linux_amd64 /usr/local/bin/kustomize
  3. Verify that kustomize is installed:

    kustomize version

    Response:

    Version: {KustomizeVersion:3.2.0 GitCommit:a3103f1e62ddb5b696daa3fd359bb6f2e8333b49 BuildDate:2019-09-18T16:26:36Z GoOs:linux GoArch:amd64}

Install kubectl on the cloud server

  1. Upload the kubectl distribution to the cloud server:

    curl -LO https://dl.k8s.io/release/v1.21.0/bin/linux/amd64/kubectl
  2. Install kubectl:

    install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
  3. In Control Panel, go to Cloud PlatformKubernetes.

  4. Open the cluster page → Settings tab.

  5. Click Download kubeconfig.

  6. Disconnect from the cloud server and open the terminal on your local machine.

  7. Copy the configuration file from the local machine to the cloud server:

    scp -i <~/.ssh/id_rsa> <~/Downloads/kubeconfig.yaml> root@<IP_address>:/root/<kubeconfig.yaml>

    Specify:

    • <~/.ssh/id_rsa> is the path on the local machine to the SSH key that was generated in step 6 of the Create Cloud Server instruction;
    • <~/Downloads/kubeconfig.yaml> is the path on the local machine to the configuration file that was downloaded in step 6;
    • <IP_address> is the public IP address of the cloud server;
    • <kubeconfig.yaml> is the name of the configuration file.
  8. Connect to cloud server.

  9. Check that the configuration file is loaded:

    ls -ailh
  10. Export the configuration file:

    export KUBECONFIG=/root/<kubeconfig.yaml>

    Specify <kubeconfig.yaml> as the name of the configuration file.

  11. Check that kubectl is installed:

    kubectl version

    Response:

    Client Version: version.Info{Major: "1", Minor: "21", GitVersion: "v1.21.0", GitCommit: "cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState: "clean", BuildDate: "2021-04-08T16:31:21Z", GoVersion: "go1.16.1", Compiler: "gc", Platform: "linux/amd64"}
    Server Version: version.Info{Major: "1", Minor: "23", GitVersion: "v1.23.13", GitCommit:"592eca05be27f7d927d0b25cbb4241d75a9574bf", GitTreeState:"clean", BuildDate:"2022-10-12T10:50:48Z", GoVersion:"go1.17.13", Compiler: "gc", Platform: "linux/amd64"}
    WARNING: version difference between client (1.21) and server (1.23) exceeds the supported minor version skew of +/-1
  12. Access the cluster via kubectl:

    kubectl get nodes

    Nodes must be in Ready status.

Install Kubeflow on a cloud server

  1. Install git:

    apt update
    apt install git
  2. Clone the repository with Kubeflow manifests:

    git clone [https://github.com/kubeflow/manifests.git](https://github.com/kubeflow/manifests.git)
  3. Navigate to the manifest folder:

    cd manifests/
  4. Open a branch:

    git checkout v1.5-branch
  5. Make sure the correct branch is open:

    git branch -a

    Response:

    master

    * v1.5-branch
  6. Install the official Kubeflow components:

    while ! kustomize build example | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done
  7. Check that all namespaces are active:

    kubectl get namespaces
  8. If installation errors occur, install the components separately — use Kubeflow documentation.

  9. Check that all components are active — they should have a Running status:

    kubectl get pods -n auth
    kubectl get pods -n cert-manager
    kubectl get pods -n istio-system
    kubectl get pods -n knative-eventing
    kubectl get pods -n kserve
    kubectl get pods -n knative-serving
    kubectl get pods -n kubeflow
    kubectl get pods -n kubeflow-user-example-com
  10. Reroute the ports:

    kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80
  11. Open the http://localhost:8080 page in your browser

  12. To connect to Kubeflow, enter the default credentials — login (user@example.com) and password (12341234).