Kubeflow Deployment with kfctl_k8s_istio

Instructions for installing Kubeflow on your existing Kubernetes cluster using kfctl_k8s_istio config

This configuration creates a vanilla deployment of Kubeflow with all its core components without any external dependencies. The deployment can be customized based on your environment needs.

Maintainer and supporter: Kubeflow community

Before you start

This Kubeflow deployment requires a default StorageClass with a dynamic volume provisioner. Verify the provisioner field of your default StorageClass definition.If you don’t have a provisioner, ensure that you have configured volume provisioning in your Kubernetes cluster appropriately as mentioned below.

Prepare your environment

Follow these steps to download the kfctl binary for the Kubeflow CLI and setsome handy environment variables:

  1. tar -xvf kfctl_v0.7.1_<platform>.tar.gz
  • Create environment variables to make the deployment process easier:
  1. # The following command is optional. It adds the kfctl binary to your path.
  2. # If you don't add kfctl to your path, you must use the full path
  3. # each time you run kfctl.
  4. # Use only alphanumeric characters or - in the directory name.
  5. export PATH=$PATH:"<path-to-kfctl>"
  6. # Set KF_NAME to the name of your Kubeflow deployment. You also use this
  7. # value as directory name when creating your configuration directory.
  8. # For example, your deployment name can be 'my-kubeflow' or 'kf-test'.
  9. export KF_NAME=<your choice of name for the Kubeflow deployment>
  10. # Set the path to the base directory where you want to store one or more
  11. # Kubeflow deployments. For example, /opt/.
  12. # Then set the Kubeflow application directory for this deployment.
  13. export BASE_DIR=<path to a base directory>
  14. export KF_DIR=${BASE_DIR}/${KF_NAME}
  15. # Set the configuration file to use when deploying Kubeflow.
  16. # The following configuration installs Istio by default. Comment out
  17. # the Istio components in the config file to skip Istio installation.
  18. # See https://github.com/kubeflow/kubeflow/pull/3663
  19. export CONFIG_URI="https://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_k8s_istio.0.7.1.yaml"

Notes:

  • ${KF_NAME} - The name of your Kubeflow deployment.If you want a custom deployment name, specify that name here.For example, my-kubeflow or kf-test.The value of KF_NAME must consist of lower case alphanumeric characters or‘-’, and must start and end with an alphanumeric character.The value of this variable cannot be greater than 25 characters. It mustcontain just a name, not a directory path.You also use this value as directory name when creating the directory whereyour Kubeflow configurations are stored, that is, the Kubeflow applicationdirectory.

  • ${KF_DIR} - The full path to your Kubeflow application directory.

  • ${CONFIG_URI} - The GitHub address of the configuration YAML file thatyou want to use to deploy Kubeflow. The URI used in this guide ishttps://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_k8s_istio.0.7.1.yaml.When you run kfctl apply or kfctl build (see the next step), kfctl createsa local version of the configuration YAML file which you can furthercustomize if necessary.

Set up and deploy Kubeflow

To set up and deploy Kubeflow using the default settings,run the kfctl apply command:

  1. mkdir -p ${KF_DIR}
  2. cd ${KF_DIR}
  3. kfctl apply -V -f ${CONFIG_URI}

Check the resources deployed in namespace kubeflow:

  1. kubectl -n kubeflow get all

Alternatively, set up your configuration for later deployment

If you want to customize your configuration before deploying Kubeflow, you canset up your configuration files first, then edit the configuration, thendeploy Kubeflow:

  • Run the kfctl build command to set up your configuration:
  1. mkdir -p ${KF_DIR}
  2. cd ${KF_DIR}
  3. kfctl build -V -f ${CONFIG_URI}
  1. export CONFIG_FILE=${KF_DIR}/kfctl_k8s_istio.0.7.1.yaml
  • Run the kfctl apply command to deploy Kubeflow:
  1. kfctl apply -V -f ${CONFIG_FILE}

Access the Kubeflow user interface (UI)

After Kubeflow is deployed, the Kubeflow Dashboard can be accessed via istio-ingressgateway service. If loadbalancer is not available in your environment, NodePort or Port forwarding can be used to access the Kubeflow Dashboard.Refer Ingress Gateway guide.

Delete Kubeflow

Run the following commands to delete your deployment and reclaim all resources:

  1. cd ${KF_DIR}
  2. # If you want to delete all the resources, run:
  3. kfctl delete -f ${CONFIG_FILE}

Understanding the deployment process

The kfctl deployment process includes the following commands:

  • kfctl 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 running kfctl apply.
  • kfctl apply - Creates or updates the resources.
  • kfctl delete - Deletes the resources.

Application layout

Your Kubeflow application directory ${KF_DIR} contains the following filesand directories:

  • ${CONFIG_FILE} is a YAML file that defines configurations related to yourKubeflow deployment.

  • kustomize is a directory that contains the kustomize packages for Kubeflowapplications. Seehow Kubeflow uses kustomize.

    • The directory is created when you run kfctl build or kfctl apply.
    • You can customize the Kubernetes resources by modifying the manifests andrunning kfctl apply again.

We recommend that you check in the contents of your ${KF_DIR} directoryinto source control.

Provisioning of Persistent Volumes in Kubernetes

Note that you can skip this step if you have a dynamic volume provisioner already installed in your cluster.

If you don’t have one:

  • You can choose to create PVs manually after deployment of Kubeflow.
  • Or install a dynamic volume provisioner like Local Path Provisioner. Ensure that the StorageClass used by this provisioner is the default StorageClass.

Troubleshooting

Persistent Volume Claims are in Pending State

Check if PersistentVolumeClaims get Bound to PersistentVolumes.

  1. kubectl -n kubeflow get pvc

If the PersistentVolumeClaims (PVCs) are in Pending state after deployment and they are not bound to PersistentVolumes (PVs), you may have to either manually create PVs for each PVC in your Kubernetes Cluster or an alternative is to set up dynamic volume provisioning to create PVs on demand and redeploy Kubeflow after deleting existing PVCs.

Next steps