Install Kubeflow
This guide covers installing Kubeflow version 1.5. It is also suitable for installing version 1.6.
- Connect the Selectel ML platform.
- Create a cloud server with a Linux operating system.
- Connect to the cloud server.
- Install kustomize on the cloud server.
- Install kubectl on the cloud server.
- Install Kubeflow on the cloud server.
Connect ML platform
Kubeflow requires a Kubernetes cluster with a StorageClass. Connect the ML platform — a ready-to-use Managed Kubernetes cluster will be created automatically.
Recommended Managed Kubernetes cluster versions:
Create a 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.
If you use a different CPU architecture or a different operating system, issues may arise when using kustomize version 3.2.0
-
In the control panel, on the top menu, click Products and select Cloud Servers.
-
Click Create server.
-
In the Source block, open the OS tab and select a Linux operating system image (e.g. Ubuntu 18.04).
-
Select the server boot disk. You can choose:
- local disk — check the Local NVMe SSD checkbox;
- network volume — select the type of volume 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).
-
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.
-
Create an SSH key and copy its public part. In the Access block, click Upload SSH key and paste the public part of the key. Click Add key.
-
Select the remaining server settings — for more details, see the Create a cloud server instructions.
-
Click Create.
Connect to the cloud server
-
In the control panel, on the top menu, click Products and select Cloud Servers.
-
In the cloud server row, in the IP address column, click .
-
Connect to the cloud server via SSH:
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
Kubeflow 1.5.0 is not compatible with kustomize versions higher than 4.x — we use kustomize version 3.2.0
-
Download the kustomize distribution binary to the cloud server:
wget https://github.com/kubernetes-sigs/kustomize/releases/download/v3.2.0/kustomize_3.2.0_linux_amd64 -
Install kustomize:
install -o root -g root -m 0755 kustomize_3.2.0_linux_amd64 /usr/local/bin/kustomize -
Verify that kustomize is installed:
kustomize versionResponse:
Version: {KustomizeVersion:3.2.0 GitCommit:a3103f1e62ddb5b696daa3fd359bb6f2e8333b49 BuildDate:2019-09-18T16:26:36Z GoOs:linux GoArch:amd64}
Install kubectl on the cloud server
-
Download the kubectl distribution to the cloud server:
curl -LO 'https://dl.k8s.io/release/v1.21.0/bin/linux/amd64/kubectl' -
Install kubectl:
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl -
In the control panel, on the top menu, click Products and select Managed Kubernetes.
-
Open the cluster page → Settings tab.
-
Click Download kubeconfig.
-
Disconnect from the cloud server and open a terminal on your local machine.
-
Copy the configuration file from your local machine to the cloud server:
scp -i <~/.ssh/id_rsa> <~/Downloads/kubeconfig.yaml> root@<IP_address>:/root/<kubeconfig.yaml>Specify:
<~/.ssh/id_rsa>— the path on your local machine to the SSH key generated in step 6 of the Create a cloud server instructions;<~/Downloads/kubeconfig.yaml>— the path on your local machine to the configuration file downloaded in step 6;<IP_address>— the cloud server's public IP address;<kubeconfig.yaml>— the name of the configuration file.
-
Check that the configuration file has been uploaded:
ls -ailh -
Export the configuration file:
export KUBECONFIG=/root/<kubeconfig.yaml>Specify
<kubeconfig.yaml>— the name of the configuration file. -
Verify that kubectl is installed:
kubectl versionResponse:
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 -
Access the cluster via kubectl:
kubectl get nodesThe nodes must be in the Ready status.
Install Kubeflow on the cloud server
-
Install git:
apt updateapt install git -
Clone the Kubeflow manifest repository:
git clone [https://github.com/kubeflow/manifests.git](https://github.com/kubeflow/manifests.git) -
Go to the manifest folder:
cd manifests/ -
Open the branch:
git checkout v1.5-branch -
Ensure the correct branch is open:
git branch -aResponse:
master* v1.5-branch -
Install the official Kubeflow components:
while ! kustomize build example | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done -
Check that all namespaces are active:
kubectl get namespaces -
If errors occur during installation, install the components separately — use the Kubeflow documentation.
-
Check that all components are active — they must have the status Running:
kubectl get pods -n authkubectl get pods -n cert-managerkubectl get pods -n istio-systemkubectl get pods -n knative-eventingkubectl get pods -n kservekubectl get pods -n knative-servingkubectl get pods -n kubeflowkubectl get pods -n kubeflow-user-example-com -
Port forward:
kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80 -
Open the
http://localhost:8080page in your browser -
To connect to Kubeflow, enter the default credentials — login (
user@example.com) and password (12341234).