Skip to content

Commit d8bedee

Browse files
authored
Merge pull request jupyterhub#1917 from rgaiacs/docker-desktop
Expand documentation to cover local test and development
2 parents 7031b34 + 374b67b commit d8bedee

File tree

2 files changed

+97
-14
lines changed

2 files changed

+97
-14
lines changed

docs/source/zero-to-binderhub/setup-binderhub.rst

Lines changed: 88 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,51 @@ where:
110110
Create ``config.yaml``
111111
----------------------
112112

113-
Create a file called ``config.yaml`` and choose the following directions based
114-
on the registry you are using.
113+
Create a file called ``config.yaml``.
114+
115+
Exposing JupyterHub and BinderHub
116+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117+
118+
By default, JupyterHub and BinderHub is exposed as a ``LoadBalancer``.
119+
If you want to expose JupyterHub and BinderHub using an ingress controller,
120+
you need to add::
121+
122+
service:
123+
type: ClusterIP
124+
125+
ingress:
126+
enabled: true
127+
annotations:
128+
# replace with your ingress class
129+
kubernetes.io/ingress.class: "nginx"
130+
https:
131+
# This is unsafe! Only se for local development
132+
enabled: false
133+
hosts:
134+
# replace with your domain for BinderHub
135+
- binderhub.XXX.XXX.XXX.XXX.nip.io
136+
137+
jupyterhub:
138+
proxy:
139+
service:
140+
type: ClusterIP
141+
ingress:
142+
enabled: true
143+
annotations:
144+
# replace with your ingress class
145+
kubernetes.io/ingress.class: "nginx"
146+
hosts:
147+
# replace with your domain for JupyterHub
148+
- jupyterhub.XXX.XXX.XXX.XXX.nip.io
149+
150+
The above snippet assumes that you are using `Ingress NGINX Controller <https://kubernetes.github.io/ingress-nginx/>`_
151+
and uses `nip.io <https://nip.io/>`_ to provide you with a temporary domain
152+
to the IP ``XXX.XXX.XXX.XXX``.
153+
154+
Expand ``config.yaml``
155+
----------------------
156+
157+
Choose the following directions based on the registry you are using.
115158

116159
If you are using ``gcr.io``
117160
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -284,10 +327,18 @@ First, get the latest helm chart for BinderHub.::
284327
Next, **install the Helm Chart** using the configuration files
285328
that you've just created. Do this by running the following command::
286329

287-
helm install <choose-name> jupyterhub/binderhub --version=0.2.0-3b53fce --namespace=<choose-namespace> -f secret.yaml -f config.yaml
288-
289-
This command will install the Helm chart released on March 3rd, 2019 as
290-
identified by the commit hash (the random string after `0.2.0-`), which is
330+
helm upgrade \
331+
<choose-name> \
332+
jupyterhub/binderhub \
333+
--install \
334+
--version=1.0.0-0.dev.git.3673.h040c9bbe \
335+
--create-namespace \
336+
--namespace=<choose-namespace> \
337+
-f secret.yaml \
338+
-f config.yaml
339+
340+
This command will install the Helm chart released on 23 January 2025 as
341+
identified by the commit hash (the random string after `1.0.0-`), which is
291342
provided as a working example. You should provide the commit hash for the most
292343
recent release, which can be found
293344
`here <https://jupyterhub.github.io/helm-chart/#development-releases-binderhub>`__.
@@ -313,8 +364,11 @@ few minutes to be set up.
313364
Connect BinderHub and JupyterHub
314365
--------------------------------
315366

316-
In the google console, run the following command to print the IP address
317-
of the JupyterHub we just deployed.::
367+
When using ``LoadBalancer``
368+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
369+
370+
Run the following command to print the IP address
371+
of the JupyterHub we just deployed. ::
318372

319373
kubectl --namespace=<namespace-from-above> get svc proxy-public
320374

@@ -325,14 +379,34 @@ JupyterHub. Now, add the following lines to ``config.yaml`` file::
325379
BinderHub:
326380
hub_url: http://<IP in EXTERNAL-IP>
327381

328-
Next, upgrade the helm chart to deploy this change::
382+
When using ``Ingress``
383+
~~~~~~~~~~~~~~~~~~~~~~
384+
385+
If JupyterHub is exposed using an ``Ingress``,
386+
copy the domains that JupyterHub is answering
387+
(for example, ``http://jupyterhub.XXX.XXX.XXX.XXX.nip.io``)
388+
and add to ``config.yaml``::
329389

330-
helm upgrade <name-from-above> jupyterhub/binderhub --version=0.2.0-3b53fce -f secret.yaml -f config.yaml
390+
config:
391+
BinderHub:
392+
hub_url: http://jupyterhub.XXX.XXX.XXX.XXX.nip.io
393+
394+
In the above snippet,
395+
`nip.io <https://nip.io/>`_ provides you
396+
with a temporary domain to the IP ``XXX.XXX.XXX.XXX``.
397+
398+
Updating the deployment
399+
~~~~~~~~~~~~~~~~~~~~~~~
400+
401+
Next, upgrade the helm chart to deploy this change::
331402

332-
For the first deployment of your BinderHub, the commit hash parsed to the
333-
`--version` argument should be the same as in step 3.4. However, when it comes
334-
to updating your BinderHub, you can parse the commit hash of a newer chart
335-
version.
403+
helm upgrade \
404+
<name-from-above> \
405+
jupyterhub/binderhub \
406+
--install \
407+
--version=1.0.0-0.dev.git.3673.h040c9bbe \
408+
-f secret.yaml \
409+
-f config.yaml
336410

337411
Try out your BinderHub Deployment
338412
---------------------------------

docs/source/zero-to-binderhub/setup-prerequisites.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ JupyterHub guide
1818
<https://zero-to-jupyterhub.readthedocs.io/en/latest/kubernetes/setup-kubernetes.html>`_.
1919
When you're done, move on to the next section.
2020

21+
Local Kubernetes cluster
22+
~~~~~~~~~~~~~~~~~~~~~~~~
23+
24+
If you are using a local Kubernetes cluster on a single computer
25+
for learning and development, you might need to setup a ingress controller
26+
such as `Ingress NGINX Controller <https://kubernetes.github.io/ingress-nginx/>`_
27+
and run JupyterHub and BinderHub services as ``ClusterIP`` instead of ``LoadBalancer``.
28+
This is due some limitations with local Kubernetes cluster.
29+
2130
Installing Helm
2231
---------------
2332

0 commit comments

Comments
 (0)