Pipelines Standalone Deployment

Instructions to deploy Kubeflow Pipelines standalone to a cluster

As an alternative to deploying Kubeflow as awhole with many components including pipelines, you also have a choice to deployonly Kubeflow Pipelines. Follow the instructions below to deployKubeflow Pipelines standalone using the supplied kustomizemanifests.

Knowledge about Kubernetes, kubectl and kustomize will help you understand thisdocument better and be able to customize your deployment based on your needs.

Installation outside GCP is also available

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

Common prerequisites

These are common one time setups you need for all the instructions below:

Download kubectl CLI tool

Follow the kubectl installation guide.

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

Configure kubectl to talk to your cluster

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

Deploying Kubeflow Pipelines standalone to an existing cluster

  • Deploy the latest version of Kubeflow Pipelines:
  1. export PIPELINE_VERSION=0.2.0
  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

Note: The above approach is introduced in Kubeflow Pipelines version 0.2.0. For older versions please run the following instead:

  1. export PIPELINE_VERSION=0.2.0
  2. kubectl apply -k github.com/kubeflow/pipelines//manifests/kustomize/env/dev?ref=$PIPELINE_VERSION
  • Get the URL for the Kubeflow Pipelines UI :
  1. kubectl describe configmap inverse-proxy-config -n kubeflow | grep googleusercontent.com

Deploying Kubeflow Pipelines standalone from scratch

  • Prepare a Kubernetes cluster:

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

Use the following gcloud command to create a cluster that can run all pipeline 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="storage-rw,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 \
  10. --num-nodes 2 \
  11. --max-nodes 5 \
  12. --min-nodes 2 \
  13. --enable-autoscaling

WARNING: Using SCOPES="storage-rw,cloud-platform" overgrants all GCP permissions to the cluster, so it’s convenient to use. For a more secure cluster setup, refer to Authenticating Pipelines to GCP.

Reference:

  • Deploy the latest version of Kubeflow Pipelines standalone to your cluster:
  1. export PIPELINE_VERSION=0.2.0
  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

Kubeflow Pipelines applications take a while (~3 minutes) to start.

Note: The above approach is introduced in Kubeflow Pipelines version 0.2.0. For older versions please run the following instead:

  1. export PIPELINE_VERSION=0.2.0
  2. kubectl apply -k github.com/kubeflow/pipelines//manifests/kustomize/env/dev?ref=$PIPELINE_VERSION
  • Get public URL of Pipelines UI and use it to access Kubeflow Pipelines:
  1. kubectl describe configmap inverse-proxy-config -n kubeflow | grep googleusercontent.com

Upgrade

  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

Check Kubeflow Pipelines github repo for available releases.

Customization

Customization can be done through kustomize overlays.

Note - The instruction below assume you installed kubectl v1.14.0 or later, which has native support of kustomize.To get latest kubectl, visit here

For the following instructions, first clone Kubeflow Pipelines repo,and use it as working directory.

Deploy on GCP with CloudSQL and Google Cloud Storage

This is recommended for production environments. Seehere for more details.

Change deployment namespace

To deploy Kubeflow Pipelines standalone in namespace FOO:

  1. kubectl apply -k manifests/kustomize/env/dev
  2. # Or the following if using GCP Cloud SQL + Google Cloud Storage
  3. # kubectl apply -k manifests/kustomize/env/gcp

Disable the public endpoint

By default, the deployment installs an inverting proxy agent that exposes a public URL. If you want to skip installing it,

  1. kubectl apply -k manifests/kustomize/env/dev
  2. # Or the following if using GCP Cloud SQL + Google Cloud Storage
  3. # kubectl apply -k manifests/kustomize/env/gcp

The UI is still accessible by port-forwarding:

  1. kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80

and open http://localhost:8080/.

Uninstall

You can uninstall Kubeflow Pipelines by:

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

Or if you deployed through kustomize:

  1. kubectl delete -k manifests/kustomize/env/dev
  2. # Or the following if using GCP Cloud SQL + Google Cloud Storage
  3. # kubectl delete -k manifests/kustomize/env/gcp

Best practices maintaining custom manifests

Maintain a repo for your manifests

Save the following to a source controlled repo.

File kustomization.yaml.

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

How to deploy, upgrade and uninstall using the repo

Deploy: kubectl apply -k $YOUR_REPO

Upgrade:

  • (Recommended) Back up your data storages for KFP.
  • Edit ref=0.2.0 to a version you want to upgrade to.
  1. Check [Kubeflow Pipelines github repo](https://github.com/kubeflow/pipelines/releases) for available releases.
  • Deploy: kubectl apply -k $YOUR_REPO.

Uninstall: kubectl delete -k $YOUR_REPO.

Further reading

Troubleshooting

Permission error installing Kubeflow Pipelines standalone to a cluster

Run:

  1. kubectl create clusterrolebinding your-binding --clusterrole=cluster-admin --user=[your-user-name]