Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgianaElena committed Jun 21, 2020
1 parent 0ef5d01 commit 6140889
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions docs/topic/escape-hatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ Custom configuration snippets
The two main TLJH components are **JupyterHub** and **Traefik**.

* JupyterHub takes its configuration from the ``jupyterhub_config.py`` file.
* Traefik takes its configuration from the ``traefik.toml`` file.
* Traefik loads its:
* `static configuration <https://docs.traefik.io/v1.7/basics/#static-traefik-configuration>`_
from the ``traefik.toml`` file.
* `dynamic configuration <https://docs.traefik.io/v1.7/basics/#dynamic-traefik-configuration>`_
from the ``rules`` directory.

These files are created by TLJH during installation and can be edited by the
user only through ``tljh-config``. Any direct modification to these files
is unsupported, and will cause hard to debug issues.
The ``jupyterhub_config.py`` and ``traefik.toml`` files are created by TLJH during installation
and can be edited by the user only through ``tljh-config``. The ``rules`` directory is also created
during install along with a ``rules/rules.toml`` file, to be used by JupyterHub to store the routing
table from users to their notebooks.

.. note::
Any direct modification to these files is unsupported, and will cause hard to debug issues.

But because sometimes TLJH needs to be customized in ways that are not officially
supported, an escape hatch has been introduced to allow easily extending the
Expand Down Expand Up @@ -65,3 +73,22 @@ proxy for the new configuration to take effect:
sudo tljh-config reload proxy
.. warning:: This instructions might change when TLJH will switch to Traefik > 2.0

Extending ``rules.toml``
========================

``Traefik`` is configured to load its routing table from the ``/opt/tljh/state/rules``
directory. The existing ``rules.toml`` file inside this directory is used by
``jupyterhub-traefik-proxy`` to add the JupyterHub routes from users to their notebook servers
and shouldn't be modified.

However, the routing table can be extended outside JupyterHub's scope using the ``rules``
directory, by adding other dynamic configuration files with the desired routing rules.

.. note::
* Any files in ``/opt/tljh/state/rules`` that end in ``.toml`` will be hot reload by Traefik.
This means that there is no need to reload the proxy service for the rules to take effect.

Checkout Traefik' docs about `dynamic configuration <https://docs.traefik.io/v1.7/basics/#dynamic-traefik-configuration>`_
and how to provide dynamic configuration through
`multiple separated files <https://docs.traefik.io/v1.7/configuration/backends/file/#multiple-separated-files>`_.

0 comments on commit 6140889

Please sign in to comment.