Configure Kubeflow Fairing with Access to GCP
This guide describes how to configure your development environment with access to Google Cloud Platform (GCP), so you can use Kubeflow Fairing to train or deploy a model on Kubeflow on Google Kubernetes Engine (GKE).
If you have not installed Kubeflow Fairing, follow the guide to installing Kubeflow Fairing before continuing.
The standard Kubeflow notebook images include Kubeflow Fairing and come preconfigured to run training jobs on your Kubeflow cluster. No additional configuration is required.
If your Kubeflow notebook server was built from a custom Jupyter Docker image, follow the instruction in this guide to configure your notebooks environment with access to your Kubeflow environment.
Follow these instructions to set up the Google Cloud SDK in your local development environment.
-
The response should be something like this:
If you do not have the Google Cloud SDK installed, follow the guide to .
Kubeflow Fairing needs a service account to make API calls to GCP. The recommended way to provide Fairing with access to this service account is to set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable. To check for theGOOGLE_APPLICATION_CREDENTIALS
environment variable, run the following command:The response should be something like this:
export SA_NAME=<your-sa-name>
gcloud iam service-accounts create $SA_NAME
gcloud projects add-iam-policy-binding $PROJECT_ID \
--role 'roles/editor'
Create a key for your service account.
Create the environment variable.
export GOOGLE_APPLICATION_CREDENTIALS=~/key.json
Authorize Docker to access your GCP Container Registry.
gcloud auth configure-docker
Use the following instructions to update your kubeconfig
with credentials and endpoint information for your Kubeflow cluster. If you do not have a Kubeflow cluster, follow the guide to to set one up.
To find your cluster’s name, run the following command to list the clusters in your project:
-
export CLUSTER_NAME=kubeflow
- Follow the GCP samples and tutorials to learn more about how to run training jobs remotely on GCP with Kubeflow Fairing.