This document describes the integration of PrimeHub and JupyterHub.


The whole magic happens in jupyterhub_profiles.py, which customizes the kubespawner. Here is the brief spawner logic

  1. A user logs in to keycloak and postback the user profile to jupyterhub. (by OIDC flow)

  2. Store the authentication data in the cookie.

  3. Use the authentication data to query graphql to get the groups, instance types, images, datasets of the logged in user

  4. The spawner renders the options in the spawner page

  5. The user selects the options they would like to spawn and submits.

  6. By kubespawner mechanism, assemble the jupyter pod's spec and spawn this pod.

Main Classes

We customize the authenticator and spawner described in the jupyterhub document



Implement GenericOAuthenticator with OIDC integration. It also provides spawner the authentication data of logged in users (in pre_spawn_start()).


Implementation Kubespawner with PrimeHub pod spawning logic.


Last updated