On Google Cloud¶
Create a Google Cloud Service Account, and give it enough permissions to access your Kubernetes cluster.
roles/container.developershould be enough permission.Create a JSON Service Account Key for your service account. This is what
kubectlwill eventually use to authenticate to the kubernetes cluster. You’ll need to put this service account key in your production JupyterHub environment as well.Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to point to the location of this JSON Service Account key.export GOOGLE_APPLICATION_CREDENTIALS=<path-to-json-service-account-key>
Generate an appropriate entry in your custom
kubeconfigfile.gcloud container clusters get-credentials <cluster-name> --zone=<zone>
When you deploy your JupyterHub, make sure that you set the environment variable
GOOGLE_APPLICATION_CREDENTIALS to point to the service account key in a place where
JupyterHub can find it.