Install Kubeflow
This guide describes how to use the kfctl binary todeploy Kubeflow on Azure.
- Install kubectl
- Install and configure the
- Log in with
- (Optional) Install Docker
- For Windows and WSL: Guide
- For other OS:
You do not need to have an existing Azure Resource Group or Cluster for AKS (Azure Kubernetes Service). You can create a cluster in the deployment process.
The deployment process is controlled by the following commands:
- build - (Optional) Creates configuration files defining the variousresources in your deployment. You only need to run
kfctl build
if you wantto edit the resources before runningkfctl apply
. - apply - Creates or updates the resources.
- delete - Deletes the resources.
Your Kubeflow application directory ${KF_DIR} contains the following files anddirectories:
${CONFIG_FILE} is a YAML file that defines configurations related to yourKubeflow deployment.
- This file is a copy of the GitHub-based configuration YAML file thatyou used when deploying Kubeflow. For example, https://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_k8s_istio.0.7.1.yaml.
- When you run
kfctl apply
orkfctl build
, kfctl createsa local version of the configuration file,${CONFIG_FILE}
,which you can further customize if necessary.
If you experience any issues running these scripts, see the for more information.
az group create -n <RESOURCE_GROUP_NAME> -l <LOCATION>
Example variables:
- RESOURCE_GROUP_NAME=KubeTest
- LOCATION=westus
Create a specifically defined cluster:
az aks create -g <RESOURCE_GROUP_NAME> -n <NAME> -s <AGENT_SIZE> -c <AGENT_COUNT> -l <LOCATION> --generate-ssh-keys
Example variables:
- NAME=KubeTestCluster
- AGENT_SIZE=Standard_D4_v3
- AGENT_COUNT=2
- Use the same resource group and name from the previous step
NOTE: If you are using a GPU based AKS cluster (For example: AGENT_SIZE=Standard_NC6), you also need to install the NVidia drivers on the cluster nodes before you can use GPUs with Kubeflow.
Run the following commands to set up and deploy Kubeflow.
- Create user credentials. You only need to run this command once.
Download the kfctl v0.7.1 release from the.
Unpack the tar ball
tar -xvf kfctl_v0.7.1_<platform>.tar.gz
- Run the following commands to set up and deploy Kubeflow. The code below includes an optional command to add the binary kfctl to your path. If you don’t add the binary to your path, you must use the full path to the kfctl binary each time you run it.
# The following command is optional, to make kfctl binary easier to use.
# Set KF_NAME to the name of your Kubeflow deployment. This also becomes the
# name of the directory containing your configuration.
export KF_NAME=<your choice of name for the Kubeflow deployment>
# Set the path to the base directory where you want to store one or more
# Kubeflow deployments. For example, /opt/.
# Then set the Kubeflow application directory for this deployment.
export BASE_DIR=<path to a base directory>
export KF_DIR=${BASE_DIR}/${KF_NAME}
export CONFIG_URI="https://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_k8s_istio.0.7.1.yaml"
# Generate and deploy Kubeflow:
mkdir -p ${KF_DIR}
cd ${KF_DIR}
kfctl apply -V -f ${CONFIG_URI}
${KF_DIR} - The full path to your Kubeflow application directory.
- Check the resources deployed correctly in namespace
kubeflow
- Open Kubeflow Dashboard
The default installation does not create an external endpoint but you can use port-forwarding to visit your cluster. Run the following command and visit http://localhost:8080.
kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80
In case you want to expose the Kubeflow Dashboard over an external IP, you can change the type of the ingress gateway. To do that, you can edit the service:
From that file, replace type: NodePort
with and save.
While the change is being applied, you can watch the service until below command prints a value under the EXTERNAL-IP
column:
The external IP should be accessible by visiting http://
You can find general information about Kubeflow configuration in the guide to configuring Kubeflow with kfctl and kustomize.