---
title: "Install Kubeflow"
sidebar_position: 1
description: "How to install kustomize, kubectl, and the Kubeflow platform for machine learning"
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import {CustomTable} from 'docs-kit/components'
import CopyIcon from 'docs-kit/icons/copy'

# Install Kubeflow

:::info

This guide covers installing Kubeflow version 1.5. It is also suitable for installing version 1.6.

:::

1. [Connect the Selectel ML platform](#order-ml-platform).
2. [Create a cloud server with a Linux operating system](#create-cloud-server).
3. [Connect to the cloud server](#connect-to-cloud-server).
4. [Install kustomize on the cloud server](#install-kustomize-on-cloud-server).
5. [Install kubectl on the cloud server](#install-kubectl-on-cloud-server).
6. [Install Kubeflow on the cloud server](#install-kubeflow-on-cloud-server).

## Connect ML platform \{#order-ml-platform}

Kubeflow requires a Kubernetes cluster with a StorageClass. [Connect the ML platform](/ml-platform/about-ml-platform.mdx#order-platform) — a ready-to-use Managed Kubernetes cluster will be created automatically.

Recommended Managed Kubernetes cluster versions:

<CustomTable>
  <table data-sticky>
    <thead>
      <tr>
        <th>Kubeflow</th><th>Managed Kubernetes</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>1.5</td><td>1.21</td>
      </tr>

      <tr>
        <td>1.6</td><td>1.22</td>
      </tr>
    </tbody>
  </table>
</CustomTable>

## Create a cloud server \{#create-cloud-server}

To install Kubeflow 1.5, you need kustomize version 3.2.0 (version 3.2.0 can also be used for Kubeflow 1.6). The compiled binary for kustomize 3.2.0 is only available for the Linux operating system and amd64, so this guide covers installing all components on a cloud server running Linux.

:::info

If you use a different CPU architecture or a different operating system, issues may arise when using kustomize version 3.2.0.

:::

1. In the [control panel](https://my.selectel.ru/vpc/default/servers/), on the top menu, click **Products** and select **Cloud Servers**.

2. Click **Create server**.

3. In the **Source** block, open the **OS** tab and select a Linux operating system image (e.g. Ubuntu 18.04).

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

   * [local disk](/cloud-servers/volumes/about-local-disks.mdx) — check the **Local NVMe SSD** checkbox;
   * [network volume](/cloud-servers/volumes/about-network-volumes.mdx) — select the [type of volume](/cloud-servers/volumes/about-network-volumes.mdx#network-volume-types) and specify the size.

   We recommend using a disk with a size of at least 5 GB (the 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 required to connect to the server via SSH.

6. [Create an SSH key and copy its public part](/cloud-servers/manage/create-and-place-ssh-key.mdx#create-ssh-keys). In the **Access** block, click **Upload SSH key** and paste the public part of the key. Click **Add key**.

7. Select the remaining server settings — for more details, see the [Create a cloud server](/cloud-servers/create/create-server.mdx) instructions.

8. Click **Create**.

## Connect to the cloud server \{#connect-to-cloud-server}

1. In the [control panel](https://my.selectel.ru/vpc/default/servers/), on the top menu, click **Products** and select **Cloud Servers**.
2. In the cloud server row, in the **IP address** column, click <CopyIcon />.
3. Connect to the cloud server via SSH:

   ```bash
   ssh root@<IP_address> -i <path_to_private_key>
   ```

   Specify:

   * `<IP_address>` — the public IP address of the cloud server copied in step 2;
   * `<path_to_private_key>` — the path to the private key.

## Install kustomize on the cloud server \{#install-kustomize-on-cloud-server}

Kubeflow 1.5.0 is not compatible with kustomize versions higher than 4.x — we recommend installing kustomize version 3.2.0.

1. Download the kustomize distribution binary to the cloud server:

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

2. Install kustomize:

   ```bash
   install -o root -g root -m 0755 kustomize_3.2.0_linux_amd64 /usr/local/bin/kustomize
   ```

3. Verify that kustomize is installed:

   ```bash
   kustomize version
   ```

   Response:

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

## Install kubectl on the cloud server \{#install-kubectl-on-cloud-server}

1. Download the kubectl distribution to the cloud server:

   ```bash
   curl -LO 'https://dl.k8s.io/release/v1.21.0/bin/linux/amd64/kubectl'
   ```

2. Install kubectl:

   ```bash
   install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
   ```

3. In the [Control panel](https://my.selectel.ru/mks/), on the top menu, click **Products** and select **Managed Kubernetes**.

4. In the **Clusters** section, open the cluster page → **Settings**.

5. Click **Download kubeconfig**.

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

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

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

   Specify:

   * `<~/.ssh/id_rsa>` — path on the local machine to the SSH key generated in step 6 of the [Create a cloud server](#create-cloud-server) instructions;
   * `<~/Downloads/kubeconfig.yaml>` — path on the local machine to the configuration file downloaded in step 6;
   * `<IP_address>` — public IP address of the cloud server;
   * `<kubeconfig.yaml>` — configuration file name.

8. [Connect to the cloud server](#connect-to-cloud-server).

9. Check that the configuration file has been uploaded:

   ```bash
   ls -ailh
   ```

10. Export the configuration file:

    ```bash
    export KUBECONFIG=/root/<kubeconfig.yaml>
    ```

    Specify `<kubeconfig.yaml>` — configuration file name.

11. Verify that kubectl is installed:

    ```bash
    kubectl version
    ```

    Response:

    ```bash
    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:

    ```bash
    kubectl get nodes
    ```

    The nodes must be in the Ready status.

## Install Kubeflow on the cloud server \{#install-kubeflow-on-cloud-server}

1. Install git:

   ```bash
   apt update
   apt install git
   ```

2. Clone the Kubeflow manifest repository:

   ```bash
   git clone [https://github.com/kubeflow/manifests.git](https://github.com/kubeflow/manifests.git)
   ```

3. Go to the manifest folder:

   ```bash
   cd manifests/
   ```

4. Open the branch:

   ```bash
   git checkout v1.5-branch
   ```

5. Ensure the correct branch is open:

   ```bash
   git branch -a
   ```

   Response:

   ```bash
   master

   * v1.5-branch
   ```

6. Install the official Kubeflow components:

   ```bash
   while ! kustomize build example | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done
   ```

7. Check that all namespaces are active:

   ```bash
   kubectl get namespaces
   ```

8. If errors occur during installation, install the components separately — use the [Kubeflow documentation](https://github.com/kubeflow/manifests#install-individual-components).

9. Check that all components are active — they must have the status Running:

   ```bash
   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. Port forward:

    ```bash
    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 — username (`user@example.com`) and password (`12341234`).

<Formbricks />
