JupyterHub in Google’s Cloud Platform with Github OAuth and HTTPS using Helm. Part III
Simple guide to setup a JupyterHub using Helm.
Lets again recall what we have done previously and what is left:
- Create a cluster in GCP and connect to that cluster locally. ✔️
- Setup Helm and Install JupyterHub using Helm. ✔️
- Setup Github OAuth for Authentication. ✔️
- 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
- Buy a domain name from any registrar.
- Go to DNS Management/configuration of that domian
- 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.
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:
- 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)
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.yaml
file.
3. Wait minute or two.
Congratulations! you have your JupyterHub HTTPS enabled.
The End
Setup HTTPS. ✔️
Any queries?, mail me at saurssaurav33@gmail.com