Skip to content

Latest commit

 

History

History
162 lines (107 loc) · 4.15 KB

README.md

File metadata and controls

162 lines (107 loc) · 4.15 KB

Instruction for Kubeflow Cluster

This instruction is for the deployment steps to create Kubeflow Cluster on GCP. This instruction assumes that you have already created Management Cluster for creating Google Cloud related resources. And have authorized Config Connector to manage Kubeflow project.

Prerequisite

Install the necessary tools if not already.

  1. Install gcloud SDK and deployment tools:
gcloud components install kubectl kustomize kpt anthoscli beta
gcloud components update

Note: Starting from Kubeflow 1.4, it requires kpt v1.0.0-beta.6 or above to operate in kubeflow/gcp-blueprints repository. gcloud hasn't caught up with this kpt version yet, install kpt separately from https://github.com/GoogleContainerTools/kpt/tags for now. Note that kpt requires docker to be installed.

Fetch packages

Go to Kubeflow Cluster

cd kubeflow

kubeflow/gcp-blueprints utilizes upstream repositority kubeflow/manifests for versioned manifests of multiple Kubeflow components. We need to first fetch upstream manifests by running command:

bash ./pull_upstream.sh

Environment Variables

Provide actual value for the following variables in env.sh, refer to detailed documentation in env.sh.

Set the environment variables in your shell:

source env.sh

Configure kpt setters as environement variables in packages:

bash kpt-set.sh

Set the Client ID and Secret from IAP OAuth step:

export CLIENT_ID=<Your CLIENT_ID>
export CLIENT_SECRET=<Your CLIENT_SECRET>

Deploy Kubeflow Cluster

Run following command to login:

gcloud auth login

Set the google project you want to deploy.

gcloud config set project $KF_PROJECT

Deploy Kubeflow cluster, required Google Cloud resources and all Kubeflow components:

make apply

Other Commands

Reminder, all the following commands assume you already set up env vars by:

source env.sh

Hydrate all manifests but not apply them

If you want to check the resources in build directories first, run the following command before make apply:

make hydrate

Clean up the hydration result from all components

After hydration or apply, you will have build folder in each component for manifest yaml files. If you want to clean them up, you can run:

make clean-build

Uninstall the whole Kubeflow cluster

Deleting cluster itself doesn't necessarily remove all resources created by this instruction. You can run the following command to clean them up:

make delete

Delete managed storage

Managed storage -- CloudSQL and Cloud Storage (GCS) bucket contains Kubeflow Pipelines data, they are not deleted by default when deleting the Kubeflow cluster, because you can re-deploy a new Kubeflow cluster using existing managed storages.

Run the following commands to delete managed storage:

cd common/managed-storage
make delete

Working with individual components

The Makefile helps you apply all components in one batch, but you can apply each component individually too. It has the same effect as doing it in one batch.

Before you start, confirm:

  • You've ran above commands in Kubeflow root folder:

    source ./env.sh
    bash ./pull_upstream.sh
    bash ./kpt-set.sh
  • You've deployed all required components and dependencies of the component you choose.

Then for example, if you have a component at apps/pipelines, visit the component folder:

cd apps/pipelines
ls Makefile

If there's a Makefile, you can:

  • apply by make apply
  • hydrate by make hydrate
  • delete by make delete

There may be other commands supported depending on the component, you can read the README.md or the Makefile to learn more.

If not, you can:

  • apply by kustomize build . | kubectl --context "${KF_NAME}" apply -f -
  • hydrate by mkdir -p build && kustomize build . -o ./build/
  • delete by kustomize build . | kubectl --context "${KF_NAME}" delete -f -