JupyterHub in Google’s Cloud Platform with Github OAuth and HTTPS using Helm. Part III

Simple guide to setup a JupyterHub using Helm.

saurs saurav
3 min readJan 16, 2019

Lets again recall what we have done previously and what is left:

  1. Create a cluster in GCP and connect to that cluster locally. ✔️
  2. Setup Helm and Install JupyterHub using Helm. ✔️
  3. Setup Github OAuth for Authentication. ✔️
  4. Setup HTTPS.

Setup HTTPS

This part will go through how to enable HTTPS on your JupyterHub. Jupyterhub uses Let’s Encrypt to automatically create HTTPS certificates and we will be using Let’s Encrypt for this guide.

In order to get a certificate for your website’s domain from Let’s Encrypt, you have to demonstrate control over the domain.

Get a domain and point to External IP

  1. Buy a domain name from any registrar.
  2. Go to DNS Management/configuration of that domian
  3. Create (if not available) an A record from the domain you want to use, point A record variable to the External-IP of proxy-public service. The exact way to do this will depend on the DNS provider that you’re using.
how to point domain to external-ip (example from godaddy.com)

4. Wait until you can type in the name of the domain you bought and it shows you the JupyterHub landing page.

Setup Automatic HTTPS

To enable https, make the following changes to your config.yaml file:

  1. Two bits of information that we need to automatically provision HTTPS certificates — your domain name & a contact email address.
proxy:
https:
hosts:
- <your-domain-name>
letsencrypt:
contactEmail: <your-email-address>

so, your finalconfig.yaml should look something like:

proxy:
https:
hosts:
- <your-domain-name>
letsencrypt:
contactEmail: <your-email-address>
secretToken: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
auth:
type: github
github:
clientId: "xxxxxxxxxxxxxxxx"
clientSecret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
callbackUrl: "http://<your-domain-name>/hub/oauth_callback"

Note : As our domain point to external point, we have changed callbackurl in config.yaml from external-ip to domain’s name.

2. Change a Authorization callback URL and Homepage URL in github’s OAuth App which we made in Part II at Ceate OAuth credentials on GitHub(step 4)

change external-ip to domain name in github OAuth’s App

3. Apply the changes by running:

helm upgrade jhub jupyterhub/jupyterhub \
--version=0.7.0 \
--values config.yaml

Here jhub is RELEASE’s name

Note : helm list should display <YOUR_RELEASE_NAME> if you forgot it. And you need to helm upgrade every-time you change something in config.yamlfile.

3. Wait minute or two.

Congratulations! you have your JupyterHub HTTPS enabled.

The End

Setup HTTPS. ✔️

Any queries?, mail me at saurssaurav33@gmail.com

Previously on JupyterHub in Google’s Cloud Platform with Github OAuth and HTTPS using Helm

--

--