Install Kubeflow
The instructions cover the installation of Kubeflow version 1.5. The instructions are also suitable for installing version 1.6.
- Connect the Selectel ML platform.
- Create a cloud server with Linux operating system.
- Connect to the cloud server.
- Install kustomize on the cloud server.
- Install kubectl on the cloud server.
- Install Kubeflow on a cloud server.
Connect ML platform
Kubeflow requires a Kubernetes cluster with StorageClass. Connect the ML platform — A ready-to-work Managed Kubernetes cluster will be automatically created.
Recommended versions of the Managed Kubernetes cluster:
Create a cloud server
To install Kubeflow 1.5 you need kustomize version 3.2.0 (for Kubeflow 1.6 you can also use version 3.2.0). The assembled binary for installing kustomize 3.2.0 is available only for Linux and amd64 operating system, so in the instructions we consider installation of all components on a cloud server with Linux.
If you are using a different CPU architecture or a different operating system, you may have problems using kustomize version 3.2.0
-
In control panel go to Cloud platform → Servers.
-
Click Create a server.
-
In the block Source click Choose another source and select a ready-made image with a Linux operating system (for example, Ubuntu 18.04).
-
Select the server boot disk. You can select:
- local disk — check the box Local SSD NVMe disk;
- network disk — select disk type and specify the size.
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).
-
In the block Network select a private subnet with a public IP address. The IP address is needed to connect to the server via SSH.
-
Create an SSH key and copy the public part of it. In the block Access click Download SSH key and insert the public portion of the key. Press Add key.
-
Select the rest of the server settings — more details in the instructions Create a cloud server.
-
Click Create.
Connect to a cloud server
-
In control panel go to Cloud platform → Servers.
-
In the row with the cloud server, copy the value in the column IP address.
-
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>
— path to the private part of the key.
Install kustomize on a 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
-
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
-
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 version
Response:
Version: {KustomizeVersion:3.2.0 GitCommit:a3103f1e62ddb5b696daa3fd359bb6f2e8333b49 BuildDate:2019-09-18T16:26:36Z GoOs:linux GoArch:amd64}
Install kubectl on a cloud server
-
Upload 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 control panel go to Cloud platform → Kubernetes.
-
Open the cluster page → tab Settings.
-
Click Download kubeconfig.
-
Disconnect from the cloud server and open the terminal on your local machine.
-
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>
— the path on the local machine to the SSH key that was generated in step 6 of the instructions Create a cloud server;<~/Downloads/kubeconfig.yaml>
— path on the local machine to the configuration file that was downloaded in step 6;<IP_address>
— The public IP address of the cloud server;<kubeconfig.yaml>
— name of the configuration file.
-
Check that the configuration file is loaded:
ls -ailh
-
Export the configuration file:
export KUBECONFIG=/root/<kubeconfig.yaml>
Specify
<kubeconfig.yaml>
— name of the configuration file. -
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 -
Access the cluster via kubectl:
kubectl get nodes
Nodes must be in Ready status.
Install Kubeflow on a cloud server
-
Install git:
apt update
apt install git -
Clone the repository with Kubeflow manifests:
git clone [https://github.com/kubeflow/manifests.git](https://github.com/kubeflow/manifests.git)
-
Navigate to the manifest folder:
cd manifests/
-
Open a branch:
git checkout v1.5-branch
-
Make sure the correct branch is open:
git branch -a
Response:
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 installation errors occur, install the components separately — use the Kubeflow documentation.
-
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 -
Reroute the ports:
kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80
-
Open a page in your browser
http://localhost:8080
-
To connect to Kubeflow, enter the default login credentials (
user@example.com
) and password (12341234
).