Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document alternative deploy method of Kubeflow Pipelines #1174

Merged
merged 12 commits into from
Oct 17, 2019
138 changes: 138 additions & 0 deletions content/docs/pipelines/pipelines-deploy-alternatives.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
+++
title = "Pipelines Deploy Alternatives"
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
description = "Alternative approaches to deploy just Kubeflow Pipelines to a cluster"
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
weight = 15
+++

Kubeflow Pipelines has kustomize manifests for lite deployment solution. You can
follow the instruction to deploy Kubeflow Pipelines (without other components of
Kubeflow) in an existing cluster.

Knowledge about Kubernetes, kubectl and kustomize will help you understand this
document and customize based on your needs.


## TL;DR
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

To deploy Kubeflow Pipelines in an existing Kubernetes cluster, do the following:

1. Deploy latest version of Kubeflow Pipelines
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
```
export PIPELINE_VERSION={{% kfp-latest-version %}}
kubectl apply -f https://storage.googleapis.com/ml-pipeline/pipeline-lite/$PIPELINE_VERSION/namespaced-install.yaml
```

2. Get the Pipeline UI URL
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
```
kubectl describe configmap inverse-proxy-config -n kubeflow | grep googleusercontent.com
```

## Step by step tutorial to deploy Pipelines from scratch

1. Prepare a Kubernetes cluster

You have many options from cloud service providers. For GCP, you can reference
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
[Creating a cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster).

You can also set up your own Kubernetes cluster.

Cluster minimum requirement: node pool with at least 2 nodes and 2 CPUs per node.

1. Download kubectl CLI tool

You can get kubectl from [its official doc](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

1. Configure kubectl to talk to your cluster

For GCP, you can reference [Configuring cluster access for kubectl](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl)

1. Deploy latest version of Kubeflow Pipelines Lite to your cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The capital letter in "Lite" implies that we have a branding decision to call this deployment "Kubeflow Pipelines Lite". Is that so? If yes, then use this branding throughout the doc. If not, then use "lightweight deployment" throughout.


```
export PIPELINE_VERSION={{% kfp-latest-version %}}
kubectl apply -f kubectl apply -f https://storage.googleapis.com/ml-pipeline/pipeline-lite/$PIPELINE_VERSION/namespaced-install.yaml
```

Kubeflow pipelines applications take a while (~3 minutes) to start.
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

1. Get public URL of Pipelines UI and use it to use Kubeflow Pipelines
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
```
kubectl describe configmap inverse-proxy-config -n kubeflow | grep googleusercontent.com
```


## Customization
Customization can be done through Kustomize [Overlay](https://github.com/kubernetes-sigs/kustomize/blob/master/docs/glossary.md#overlay).
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
Bobgy marked this conversation as resolved.
Show resolved Hide resolved

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](https://kubernetes.io/docs/tasks/tools/install-kubectl/)

For the following instructions, first clone [Kubeflow Pipelines repo](https://github.com/kubeflow/pipelines),
and use it as working directory.

### Deploy on GCP with CloudSQL and GCS
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
This is recommended for production environments. See
[here](https://github.com/kubeflow/pipelines/tree/master/manifests/kustomize/env/gcp) for more details.

### Change deploy namespace
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
To deploy Kubeflow Pipelines in namespace FOO,
- Edit [dev/kustomization.yaml](https://github.com/kubeflow/pipelines/blob/master/manifests/kustomize/env/dev/kustomization.yaml)
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
or [gcp/kustomization.yaml](https://github.com/kubeflow/pipelines/blob/master/manifests/kustomize/env/gcp/kustomization.yaml)
namespace section to FOO
- Then run
```
kubectl apply -k manifests/kustomize/env/dev # or other env of your choice
```

### Disable the public endpoint
By default, the deployment install an [invert proxy agent](https://github.com/google/inverting-proxy) that exposes a public URL. If you want to skip installing it,
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
- Comment out the proxy component in the [kustomization.yaml](https://github.com/kubeflow/pipelines/blob/master/manifests/kustomize/base/kustomization.yaml).
Bobgy marked this conversation as resolved.
Show resolved Hide resolved
- Then run
```
kubectl apply -k manifests/kustomize/env/dev # or other env of your choice
```

The UI is still accessible by port-forwarding
```
kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80
```
and open http://localhost:8080/



## Uninstall
You can uninstall Kubeflow Pipelines by running
```
export PIPELINE_VERSION={{% kfp-latest-version %}}
kubectl delete -f https://raw.githubusercontent.com/kubeflow/pipelines/$PIPELINE_VERSION/manifests/kustomize/namespaced-install.yaml
```

Or if you deployed through kustomize
```
kubectl delete -k manifests/kustomize/env/dev
# or
kubectl delete -k manifests/kustomize/env/gcp
```

## Troubleshooting

### Permission error installing Kubeflow Pipelines to a cluster
Run
```
kubectl create clusterrolebinding your-binding --clusterrole=cluster-admin --user=[your-user-name]
```

### Samples that require "user-gcp-sa" secret
If sample code requires a "user-gcp-sa" secret, you could create one by

- First download the GCE VM service account token [Document](https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating_service_account_keys)
```
gcloud iam service-accounts keys create application_default_credentials.json \
--iam-account [SA-NAME]@[PROJECT-ID].iam.gserviceaccount.com
```

- Run
```
kubectl create secret -n [your-namespace] generic user-gcp-sa \
--from-file=user-gcp-sa.json=application_default_credentials.json
```
1 change: 1 addition & 0 deletions layouts/shortcodes/kfp-latest-version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.31