A full instruction on how to deploy Jupyterhub with Kubernetes is available here. This repository is more of a documentation on what has been done in regards to Jupyterhub deployment for ESDL project. The scripts and configurations are created specifically for this purpose.
All the commands below are to be executed inside Google Cloud Shell.
- Create a project in GCP by first clicking the project list button at the top toolbar, and then click
new project
- When using Kubernetes Engine for the first time, you may need to activate Kubernetes Engine API. This is done by selecting
Kubernetes Engine
and there should be an activate button somewhere on the page.
git clone https://github.com/esa-esdl/jupyterhub-k8s.git
cd jupyterhub-k8s/scripts
./create_clusters.sh
vim config.yaml
proxy.secretToken
: generate the secret tokenproxy.service.loadBalancerIP
: reserve a static IP address and use its value (in GCP: go to Networking > VPC network > External IP addresses, and then clickreserve static address
)proxy.https.hosts
: select a host name (this will then need to be tied to the static IP address)proxy.https.letsencrypt.contactEmail
: an email address to which an expiry notice will be sentauth.admin.users
: list of GitHub usernames that will have admin roleauth.whitelist.users
: list of GitHub usernames that are allowed access to the Jupyterhubauth.github.[clientId|clientSecret|callbackUrl]
: information required for OAuth using GitHub
./initialize-helm.sh
./install-jupyterhub.sh
kubectl -n jupyterhub get all
-> to check if installation has been successful. Ensure that none of the pods or services indicates some errors. It may take a while until all the Kubernetes objects are up and running.
helm upgrade jupyterhub-kube jupyterhub/jupyterhub --version=v0.8-e29f3e7 -f config.yaml
./remove-jupyterhub-kube.sh
gcloud container clusters delete jupyterhub-kubernetes --zone=europe-west3-a
cd nfs
./create-datacube-volume.sh
./create-nfs-server.sh
kubectl -n jupyterhub describe service nfs-server
- copy the value of
IP
field, to be used on the next step
- copy the value of
vim nfs-pv.yaml
- update the value of
spec.nfs.server
to use the value from the previous step
- update the value of
./create-nfs-volume.sh
- follow this instruction: https://cloud.google.com/container-registry/docs/pushing-and-pulling
- for authentication, run
gcloud auth login
and then follow the instructions
- for authentication, run
More resources:
- https://gist.github.com/tallclair/849601a16cebeee581ef2be50c351841 (mount git repo using emptyDir)
- https://github.com/kubernetes/examples/tree/master/staging/volumes/nfs (create nfs persistent volume)