Cheatsheet: Setting up JupyterHub¶
Prepare configuration file config.yaml
¶
Create a file called
config.yaml
.Create two random hex strings to use as security tokens:
openssl rand -hex 32 openssl rand -hex 32
Insert these lines into the
config.yaml
file. Substitute each occurrence ofRANDOM_STRING_N
below with the output ofopenssl rand -hex 32
.config.yaml file
hub: # output of first execution of 'openssl rand -hex 32' cookieSecret: "RANDOM_STRING_1" proxy: # output of second execution of 'openssl rand -hex 32' secretToken: "RANDOM_STRING_2"
Save the
config.yaml
file.
Install JupyterHub¶
From terminal:
# add jupyterhub helm repository helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/ helm repo update # install chart helm install jupyterhub/jupyterhub \ --version=v0.4 \ --name=<YOUR-RELEASE-NAME> \ --namespace=<YOUR-NAMESPACE> \ -f config.yaml # check hub and proxy pods are running kubectl --namespace=<YOUR_NAMESPACE> get pod # find IP to access JupyterHub (external IP for proxy-public service) kubectl --namespace=<YOUR_NAMESPACE> get svc # alternative verbose command for IP # kubectl --namespace=<YOUR_NAMESPACE> describe svc proxy-public
To use JupyterHub:
- enter external IP for the
proxy-public
service into a browser. - entering any username and password combination as JupyterHub is running with a default dummy authenticator
- enter external IP for the
Notes¶
--name
For a class called data8 you might wish set the name to data8-jupyterhub. Find out the name by usinghelm list
.--namespace
is to identify a particular application- We recommend using the same value for
--name
and--namespace
- If you get a
release exists
error, thenhelm delete --purge <YOUR-RELEASE-NAME>
. Reinstall by repeating this step. If it persists,kubectl delete <YOUR-NAMESPACE>
and try again. - If you get a time out error, add a
--timeout=SOME-LARGE-NUMBER
parameter to thehelm install
command.