2018-05-16 05:01:13 -04:00
|
|
|
rbac:
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
hub:
|
|
|
|
extraEnv:
|
|
|
|
JUPYTER_ENABLE_LAB: 1
|
2018-07-19 08:09:32 -04:00
|
|
|
SINGLEUSER_IMAGE: 'registry.gitlab.com/gitlab-org/jupyterhub-user-image:latest'
|
2018-05-16 05:01:13 -04:00
|
|
|
extraConfig: |
|
|
|
|
c.KubeSpawner.cmd = ['jupyter-labhub']
|
|
|
|
|
2019-05-22 16:16:17 -04:00
|
|
|
async def add_auth_env(spawner):
|
|
|
|
'''
|
|
|
|
We set user's id, login and access token on single user image to
|
|
|
|
enable repository integration for JupyterHub.
|
|
|
|
See: https://gitlab.com/gitlab-org/gitlab-ce/issues/47138#note_154294790
|
|
|
|
'''
|
|
|
|
auth_state = await spawner.user.get_auth_state()
|
|
|
|
|
|
|
|
if not auth_state:
|
|
|
|
spawner.log.warning("No auth state for %s", spawner.user)
|
|
|
|
return
|
|
|
|
|
|
|
|
spawner.environment['GITLAB_ACCESS_TOKEN'] = auth_state['access_token']
|
|
|
|
spawner.environment['GITLAB_USER_LOGIN'] = auth_state['gitlab_user']['username']
|
|
|
|
spawner.environment['GITLAB_USER_ID'] = str(auth_state['gitlab_user']['id'])
|
|
|
|
|
|
|
|
c.KubeSpawner.pre_spawn_hook = add_auth_env
|
|
|
|
|
2018-05-24 11:11:30 -04:00
|
|
|
auth:
|
|
|
|
type: gitlab
|
2019-05-22 16:16:17 -04:00
|
|
|
state:
|
|
|
|
enabled: true
|
2018-05-24 11:11:30 -04:00
|
|
|
|
2018-05-16 05:01:13 -04:00
|
|
|
singleuser:
|
|
|
|
defaultUrl: "/lab"
|
2018-10-04 08:59:21 -04:00
|
|
|
lifecycleHooks:
|
|
|
|
postStart:
|
|
|
|
exec:
|
2018-10-29 16:50:07 -04:00
|
|
|
command: ["sh", "-c", "git clone https://gitlab.com/gitlab-org/nurtch-demo.git DevOps-Runbook-Demo || true"]
|
2018-05-16 05:01:13 -04:00
|
|
|
|
|
|
|
ingress:
|
|
|
|
enabled: true
|
|
|
|
annotations:
|
|
|
|
kubernetes.io/ingress.class: "nginx"
|
2018-12-03 05:16:38 -05:00
|
|
|
kubernetes.io/tls-acme: "true"
|