Skip to content

Commit

Permalink
add explanation for lifecycle_hooks in kubespawner_override
Browse files Browse the repository at this point in the history
  • Loading branch information
dowjones-jupyterhub committed Jun 11, 2019
1 parent fad028e commit 9a210af
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion doc/source/user-environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ a list of profiles with specific configuration options each. Here's an example:
The above configuration will show a screen with information about this profile
displayed when users start a new server.

Here's an example with two profiles that lets users select the environment they
Here's an example with four profiles that lets users select the environment they
wish to use.

.. code-block:: yaml
Expand All @@ -360,10 +360,30 @@ wish to use.
description: "The Jupyter Stacks spark image!"
kubespawner_override:
image: jupyter/all-spark-notebook:2343e33dec46
- display_name: "Learning Data Science"
description: "Datascience Environment with Sample Notebooks"
kubespawner_override:
image: jupyter/datascience-notebook:2343e33dec46
lifecycle_hooks:
postStart:
exec:
command:
- "sh"
- "-c"
- >
gitpuller https://github.com/data-8/materials-fa17 master materials-fa;
This allows users to select from three profiles, each with their own
environment (defined by each Docker image in the configuration above).

The "Learning Data Science" environment in the above example overrides the postStart lifecycle hook. Note that when
using ``kubespawner_override`` the values must be in the format that comply with the `KubeSpawner configuration
<https://jupyterhub-kubespawner.readthedocs.io/en/latest/spawner.html>`_.
For instance, when overriding the lifecycle
hooks in ``kubespawner_override``, the configuration is for ``lifecycle_hooks`` (snake_case) rather than ``lifecycleHooks`` (camelCase) which is
how it is used directly under the ``singleuser`` configuration section.
`A further explanation for this can be found in this github issue. <https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/1242#issuecomment-484895216>`_

.. note::

You can also **control the HTML used for the profile selection page** by
Expand Down

0 comments on commit 9a210af

Please sign in to comment.