Learning with JupyterHub¶
Getting Started with Google Cloud¶
This section will help you:
- create a Google Cloud account
- install the Google Cloud SDK
- initialize the SDK and authenticate with Google Cloud
Create a Google Cloud account¶
Install the Google Cloud SDK¶

Google Cloud SDK Documentation

- Click the download button
- Install the downloaded package (using bash
./google-cloud/sdk/install.sh)
Initialize the SDK and authenticate¶
gcloud init
Answer prompts.
images
Use gcloud --help to get to help pages.
Create a Kubernetes cluster¶
Enter:
gcloud container clusters create my-cluster-name --num-nodes=3 --zone=us-central1-b
If you get this error:
ERROR: (gcloud.container.clusters.create) ResponseError: code=503, message=Project alert-result-161014 is not fully initialized with the default service accounts. Please try again later.
Go to this URL in browser:
https://console.cloud.google.com/kubernetes/list
Draft¶
This tutorial lets you set up a JupyterHub installation on a Kubernetes Cluster (on Google Cloud), using Helm for managing installation & upgrades.
Create a kubernetes cluster: gcloud container clusters create my-cluster-name –num-nodes=3 –zone=us-central1-b
If you get this error:
ERROR: (gcloud.container.clusters.create) ResponseError: code=503, message=Project alert-result-161014 is not fully initialized with the default service accounts. Please try again later.
go to in browser
https://console.cloud.google.com/kubernetes/list
Install kubectl and make sure it works:
gcloud components install kubectl
kubectl get node (should return 3 nodes)
Install helm using https://github.com/kubernetes/helm/blob/master/docs/install.md
Clone our git repository
git clone https://github.com/data-8/jupyterhub-k8s
Create a file called ‘config.yaml’. This will hold the various customizations we perform for our JupyterHub installation. Make the values initially be:
name: “name-of-your-hub”
hub:
cookieSecret: “<output-of-openssl rand -hex 32>”
token:
proxy: “<output-of-openssl rand -hex 32>”
(Note: Make sure these aren’t curly quotes in your file!)
Run helm init to prepare the kubernetes cluster for helm installation
Run helm install helm-chart --name=<name-of-your-hub> --namespace=<name-of-your-hub> -f config.yaml
You can see the pods being created with kubectl --namespace=<name-of-your-hub> get pod. Wait for the hub and proxy pod to get to running (the cull might be in error - ignore it for now, it’ll be fixed when https://github.com/data-8/jupyterhub-k8s/issues/143 is fixed)
You can find the IP to use for accessing the JupyterHub with kubectl --namespace=<name-of-your-hub> get svc - the external IP for the ‘proxy-public’ service should be accessible in a minute or two.
The default authenticator is ‘dummy’ - any username / password will let you in!
We can explore setting other options, such as persistent storage for users, memory / cpu limits, and other authenticators now!
Common errors:
Something like “could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.” Do gcloud auth application-default login and follow the prompts. The link provided has other options for advanced use cases.