Initialize a Helm chart configuration file¶
In this step we will initialize a chart configuration file for you to adjust
your installation of JupyterHub. We will name and refer to it as
Introduction to YAML
If you haven’t worked with YAML before, investing some minutes [learning about it](YAML will likely be worth your time.
As of version 1.0.0, you don’t need any configuration to get started so you can
just create a
config.yaml file with some helpful comments.
# This file can update the JupyterHub Helm chart's default configuration values. # # For reference see the configuration reference and default values, but make # sure to refer to the Helm chart version of interest to you! # # Introduction to YAML: https://www.youtube.com/watch?v=cdLNKUoMc6c # Chart config reference: https://zero-to-jupyterhub.readthedocs.io/en/stable/resources/reference.html # Chart default values: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/HEAD/jupyterhub/values.yaml # Available chart versions: https://jupyterhub.github.io/helm-chart/ #
In case you are working from a terminal and are unsure how to create this file,
can try with
Make Helm aware of the JupyterHub Helm chart repository so you can install the JupyterHub chart from it without having to use a long URL name.
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/ helm repo update
This should show output like:
Hang tight while we grab the latest from your chart repositories... ...Skip local chart repository ...Successfully got an update from the "stable" chart repository ...Successfully got an update from the "jupyterhub" chart repository Update Complete. ⎈ Happy Helming!⎈
Now install the chart configured by your
config.yamlby running this command from the directory that contains your
helm upgrade --cleanup-on-fail \ --install <helm-release-name> jupyterhub/jupyterhub \ --namespace <k8s-namespace> \ --create-namespace \ --version=<chart-version> \ --values config.yaml
<helm-release-name>refers to a Helm release name, an identifier used to differentiate chart installations. You need it when you are changing or deleting the configuration of this chart installation. If your Kubernetes cluster will contain multiple JupyterHubs make sure to differentiate them. You can list your Helm releases with
<k8s-namespace>refers to a Kubernetes namespace, an identifier used to group Kubernetes resources, in this case all Kubernetes resources associated with the JupyterHub chart. You’ll need the namespace identifier for performing any commands with
This step may take a moment, during which time there will be no output to your terminal. JupyterHub is being installed in the background.
If you get a
release named <helm-release-name> already existserror, then you should delete the release by running
helm delete <helm-release-name>. Then reinstall by repeating this step. If it persists, also do
kubectl delete namespace <k8s-namespace>and try again.
In general, if something goes wrong with the install step, delete the Helm release by running
helm delete <helm-release-name>before re-running the install command.
If you’re pulling from a large Docker image you may get a
Error: timed out waiting for the conditionerror, add a
--timeout=<number-of-minutes>mparameter to the
--versionparameter corresponds to the version of the Helm chart, not the version of JupyterHub. Each version of the JupyterHub Helm chart is paired with a specific version of JupyterHub. E.g.,
0.11.1of the Helm chart runs JupyterHub
1.3.0. For a list of which JupyterHub version is installed in each version of the JupyterHub Helm Chart, see the Helm Chart repository.
While Step 2 is running, you can see the pods being created by entering in a different terminal:
kubectl get pod --namespace jhub
To remain sane we recommend that you enable autocompletion for kubectl (follow the kubectl installation instructions for your platform to find the shell autocompletion instructions)
and set a default value for the
kubectl config set-context $(kubectl config current-context) --namespace <k8s-namespace>
Wait for the hub and proxy pod to enter the
NAME READY STATUS RESTARTS AGE hub-5d4ffd57cf-k68z8 1/1 Running 0 37s proxy-7cb9bc4cc-9bdlp 1/1 Running 0 37s
Find the IP we can use to access the JupyterHub. Run the following command until the
proxy-publicservice is available like in the example output.
kubectl get service --namespace <k8s-namespace>
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hub ClusterIP 10.51.243.14 <none> 8081/TCP 1m proxy-api ClusterIP 10.51.247.198 <none> 8001/TCP 1m proxy-public LoadBalancer 10.51.248.230 126.96.36.199 80:31916/TCP 1m
If the IP for
proxy-publicis too long to fit into the window, you can find the longer version by calling:
kubectl describe service proxy-public --namespace <k8s-namespace>
To use JupyterHub, enter the external IP for the
proxy-publicservice in to a browser. JupyterHub is running with a default dummy authenticator so entering any username and password combination will let you enter the hub.
Some examples of customizations are:
Configure the login to use the account that makes sense to you (Google, GitHub, etc.).
Use a suitable pre-built image for the user container or build your own.
Host it on https://your-domain.com.