Kubeflow Pipelines Standalone Deployment

Instructions to deploy Kubeflow Pipelines standalone to a cluster

As an alternative to deploying Kubeflow Pipelines (KFP) as part of theKubeflow deployment, you also have a choiceto deploy only Kubeflow Pipelines. Follow the instructions below to deployKubeflow Pipelines standalone using the supplied kustomize manifests.

You should be familiar with Kubernetes,kubectl, and kustomize.

Installation options for Kubeflow Pipelines standalone

This guide currently describes how to install Kubeflow Pipelines standaloneon Google Cloud Platform (GCP). You can also install Kubeflow Pipelines standalone on otherplatforms. This guide needs updating. See Issue 1253.

Before you get started

Working with Kubeflow Pipelines requires a Kubernetes cluster as well as an installation of kubectl.

Download and install kubectl

Download and install kubectl by following the kubectl installation guide.

You need kubectl version 1.14 or later for native support of kustomize.

Set up your cluster

If you have an existing Kubernetes cluster, continue with the instructions for configuring kubectl to talk to your cluster.

To create a new Kubernetes cluster, run the following:

See the GKE guide to creating a cluster for Google Cloud Platform (GCP).

Use the gcloud container clusters create command to create a cluster that can run all Kubeflow Pipelines samples:

  1. # The following parameters can be customized based on your needs.
  2. CLUSTER_NAME="kubeflow-pipelines-standalone"
  3. ZONE="us-central1-a"
  4. MACHINE_TYPE="n1-standard-2" # A machine with 2 CPUs and 7.50GB memory
  5. SCOPES="cloud-platform" # These scopes are needed for running some pipeline samples
  6. gcloud container clusters create $CLUSTER_NAME \
  7. --zone $ZONE \
  8. --machine-type $MACHINE_TYPE \
  9. --scopes $SCOPES

Warning: Using SCOPES="cloud-platform" grants all GCP permissions to the cluster. For a more secure cluster setup, refer to Authenticating Pipelines to GCP.

References:

Configure kubectl to talk to your cluster

See the Google Kubernetes Engine (GKE) guide toconfiguring cluster access for kubectl.

Deploying Kubeflow Pipelines

  • Deploy the latest version of Kubeflow Pipelines:

Note: The following commands apply to Kubeflow Pipelines version 0.2.0 and later.

  1. export PIPELINE_VERSION=0.2.5
  2. kubectl apply -k github.com/kubeflow/pipelines/manifests/kustomize/base/crds?ref=$PIPELINE_VERSION
  3. kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
  4. kubectl apply -k github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION

The Kubeflow Pipelines deployment requires approximately 3 minutes to complete.

Note: To deploy versions of Kubeflow Pipelines prior to version 0.2.0, run:

  1. export PIPELINE_VERSION=<kfp-version>
  2. kubectl apply -k github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION

Note: kubectl apply -k accepts local paths and paths that are formatted as hashicorp/go-getter URLs. While the paths in the preceding commands look like URLs, the paths are not valid URLs.

  • Get the public URL for the Kubeflow Pipelines UI and use it to access the Kubeflow Pipelines UI:
  1. kubectl describe configmap inverse-proxy-config -n kubeflow | grep googleusercontent.com

Upgrading Kubeflow Pipelines

  1. export PIPELINE_VERSION=<version-you-want-to-upgrade-to>
  2. kubectl apply -k github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION

Customizing Kubeflow Pipelines

Kubeflow Pipelines can be configured through kustomize overlays.

To begin, first clone the Kubeflow Pipelines GitHub repository,and use it as your working directory.

Deploy on GCP with CloudSQL and Google Cloud Storage

Note: This is recommended for production environments. For more details about customizing your environmentfor GCP, see the Kubeflow Pipelines GCP manifests.

Change deployment namespace

To deploy Kubeflow Pipelines standalone in namespace <my-namespace>:

  1. kubectl apply -k manifests/kustomize/env/dev

Note: If using GCP Cloud SQL and Google Cloud Storage, apply with this command:

  1. kubectl apply -k manifests/kustomize/env/gcp

Disable the public endpoint

By default, the KFP standalone deployment installs an inverting proxy agent that exposes a public URL. If you want to skip the installation of the inverting proxy agent, complete the following:

  • Comment out the proxy components in the base kustomization.yaml.

  • Apply the changes to update the Kubeflow Pipelines deployment:

  1. kubectl apply -k manifests/kustomize/env/dev

Note: If using GCP Cloud SQL and Google Cloud Storage, apply with this command:

  1. kubectl apply -k manifests/kustomize/env/gcp
  • Verify that the Kubeflow Pipelines UI is accessible by port-forwarding:
  1. kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80

Uninstalling Kubeflow Pipelines

To uninstall Kubeflow Pipelines, run kubectl delete -k <manifest-file>.

For example, to uninstall KFP using manifests from a GitHub repository, run:

  1. export PIPELINE_VERSION=0.2.5
  2. kubectl delete -k github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION

To uninstall KFP using manifests from your local repository or file system, run:

  1. kubectl delete -k manifests/kustomize/env/dev

Note: If you are using GCP Cloud SQL and Google Cloud Storage, run:

  1. kubectl delete -k manifests/kustomize/env/gcp

Best practices for maintaining manifests

Similar to source code, configuration files belong in source control.A repository manages the changes to yourmanifest files and ensures that you can repeatedly deploy, upgrade,and uninstall your components.

Maintain your manifests in source control

After creating or customizing your deployment manifests, save your manifeststo a local or remote source control respository.For example, save the following kustomization.yaml:

  1. # kustomization.yaml
  2. apiVersion: kustomize.config.k8s.io/v1beta1
  3. kind: Kustomization
  4. # Edit the following to change the deployment to your custom namespace.
  5. namespace: kubeflow
  6. # You can add other customizations here using kustomize.
  7. # Edit ref in the following link to deploy a different version of Kubeflow Pipelines.
  8. bases:
  9. - github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=0.2.5

Use a repository to deploy, upgrade, and uninstall Kubeflow Pipelines

Note: The following commands reference an existing repository.

Caution: For upgrades, it is recommended to back up your data storage for Kubeflow Pipelines.

To deploy Kubeflow Pipelines using a repository, run:

  1. export PIPELINE_VERSION=<kfp-version>
  2. export KFP_MANIFESTS_REPO_LINK=github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION
  3. kubectl apply -k $KFP_MANIFESTS_REPO_LINK

To upgrade your Kubeflow Pipelines deployment from a repository, follow these steps:

  • Check Kubeflow Pipelines GitHub repository for available releases.
  • Set the PIPELINE_VERSION environment variable to a version you want to upgrade to.
  • Upgrade Kubeflow Pipelines by running:
  1. export PIPELINE_VERSION=<version-you-want-to-upgrade-to>
  2. export KFP_MANIFESTS_REPO_LINK=github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION
  3. kubectl apply -k $KFP_MANIFESTS_REPO_LINK

To uninstall Kubeflow Pipelines using a repository, run:

  1. export PIPELINE_VERSION=<kfp-version>
  2. export KFP_MANIFESTS_REPO_LINK=github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION
  3. kubectl delete -k $KFP_MANIFESTS_REPO_LINK

Further reading

To learn about kustomize workflows with off-the-shelf configurations, see thekustomize configuration workflows guide.

Troubleshooting

If you encounter a permission error when installing Kubeflow Pipelines standalone, run:

  1. kubectl create clusterrolebinding your-binding --clusterrole=cluster-admin --user=<your-user-name>

Feedback

Was this page helpful?

Glad to hear it! Please tell us how we can improve.

Sorry to hear that. Please tell us how we can improve.

Last modified 03.03.2020: format lists and cleanup, KFP standalone (#1689) (f9c56054)