Can I use hub.initContainers or hub.extraContainers to add packages that would then be visible to JupyterHub?

I’m having trouble grasping how using the JupyterHub Helm chart I would add some packages needed by something I’d like to reference in extraConfig. There is a reference to hub.extraContainers in https://z2jh.jupyter.org/en/latest/advanced.html#arbitrary-extra-code-and-configuration-in-jupyterhub-config-py but I can’t find an example from anywhere exactly explaining how this would work and whether this would perhaps help me solve the problem 'd like to ultimately solve: use the JWT authenticator that is not installed in the image that’s referenced in the jupyterhub helm chart).

Am I on the right track, or is it necessary for me to fork the Helm chart for my purposes?

Another possibility looks to be initContainers?

Your best option is to build your own hub image, push it to a registry, and reference it in your config:
https://z2jh.jupyter.org/en/latest/reference.html#hub-image

You can see the Dockerfile for the default hub image here: https://github.com/jupyterhub/zero-to-jupyterhub-k8s/tree/master/images/hub

There’s no need to fork the chart.

1 Like

Thanks, this had gone past me in the docs, makes a lot of sense!

1 Like

I can confirm that setting a custom image worked like charm.

2 Likes