Jupyterhub with Kubespawner: Redirect loop detected

57 Views Asked by At

I am trying to create Jupyterhub from python libraries. After providing the configuration, when i am logging in i am getting Redirect Loop Detected error.

Jupyterhub Image content: Dockerfile:

FROM xxxxx/openjdk11

RUN microdnf update -y
RUN microdnf install -y python3 python3-pip python3-setuptools python3-wheel nodejs pam

RUN npm install -g configurable-http-proxy

RUN pip3 install --upgrade pip
RUN pip3 install jupyterhub jupyterlab jupyterhub-kubespawner

RUN jupyterhub --generate-config
COPY files/jupyterhub_config_custom.py .

RUN cat jupyterhub_config_custom.py >> jupyterhub_config.py

EXPOSE 8080
ENTRYPOINT ["jupyterhub"]

jupyterhub_config_custom.py:

c.Authenticator.admin_users = {'admin'}
c.DummyAuthenticator.password = 'pass'
c.Authenticator.allowed_users = {'admin'}
c.NotebookApp.allow_root = True
c.Spawner.port = 8080
c.Spawner.default_url = '/lab'
c.JupyterHub.authenticator_class = 'dummy'
c.NotebookApp.allow_origin = '*'

c.JupyterHub.spawner_class = 'kubespawner.KubeSpawner'
c.KubeSpawner.image = 'sigleuser-image'
c.KubeSpawner.start_timeout = 600

c.KubeSpawner.port = 8000
c.JupyterHub.base_url = '/'

sigleuser-image content: Dockerfile:

FROM xxxx/openjdk11

RUN microdnf update -y
RUN microdnf install -y python3 python3-pip python3-setuptools python3-wheel nodejs pam

RUN npm install -g configurable-http-proxy
RUN pip3 install --upgrade pip
RUN pip3 install jupyterhub jupyterlab

RUN jupyterhub --generate-config
COPY files/jupyterhub_config_custom.py .
RUN cat jupyterhub_config_custom.py >> jupyterhub_config.py

EXPOSE 8080
ENTRYPOINT ["jupyterhub"]

jupyterhub_config_custom.py:

c.Authenticator.admin_users = {'admin'}
c.DummyAuthenticator.password = 'pass'
c.Authenticator.allowed_users = {'admin'}
c.NotebookApp.allow_root = True
c.Spawner.port = 8080
c.JupyterHub.authenticator_class = 'dummy'
c.NotebookApp.allow_origin = '*'
c.JupyterHub.base_url = '/'
c.KubeSpawner.start_timeout = 600

After login is am getting 500 Internal Error. Redirect Loop Detected. Really need help with this. Logs: Jupyterhub Pod:

[I 2024-02-02 10:29:08.391 JupyterHub proxy:691] Starting proxy @ http://:8000
10:29:08.887 [ConfigProxy] info: Proxying http://*:8000 to (no default)
10:29:08.890 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
10:29:08.964 [ConfigProxy] info: [!dt dt.trace_id=add566297805777fd91d1314df5a6a28,dt.span_id=7a50cda15a4ffa17,dt.trace_sampled=true] 200 GET /api/routes
[I 2024-02-02 10:29:08.964 JupyterHub app:3089] Hub API listening on http://127.0.0.1:8081/hub/
10:29:08.967 [ConfigProxy] info: [!dt dt.trace_id=51e6b4fd355c00e3d0f9390766147ba8,dt.span_id=1ca737cc5822743e,dt.trace_sampled=true] 200 GET /api/routes
[I 2024-02-02 10:29:08.967 JupyterHub proxy:431] Adding route for Hub: / => http://127.0.0.1:8081
10:29:08.970 [ConfigProxy] info: [!dt dt.trace_id=51d730467b1611b0a6c50b5623866051,dt.span_id=89d907ed5c01fa6e,dt.trace_sampled=true] Adding route / -> http://127.0.0.1:8081
10:29:08.971 [ConfigProxy] info: [!dt dt.trace_id=51d730467b1611b0a6c50b5623866051,dt.span_id=89d907ed5c01fa6e,dt.trace_sampled=true] Route added / -> http://127.0.0.1:8081
10:29:08.972 [ConfigProxy] info: [!dt dt.trace_id=51d730467b1611b0a6c50b5623866051,dt.span_id=89d907ed5c01fa6e,dt.trace_sampled=true] 201 POST /api/routes/
[I 2024-02-02 10:29:08.972 JupyterHub app:3156] JupyterHub is now running at http://:8000
[I 2024-02-02 10:29:14.959 JupyterHub log:189] 302 GET / -> /hub/ (@10.169.10.1) 1.45ms

User pod :

[I 2024-02-02 10:30:13.737 JupyterHub proxy:691] Starting proxy @ http://:8000
10:30:14.224 [ConfigProxy] info: Proxying http://*:8000 to (no default)
10:30:14.227 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
10:30:14.272 [ConfigProxy] info: [!dt dt.trace_id=c2fd74c6583ce17a54a3ff17415de505,dt.span_id=f243c39bfe3b8d88,dt.trace_sampled=true] 200 GET /api/routes
[I 2024-02-02 10:30:14.272 JupyterHub app:3089] Hub API listening on http://127.0.0.1:8081/hub/
10:30:14.276 [ConfigProxy] info: [!dt dt.trace_id=bfb609718e079f399caccda61155df07,dt.span_id=caf9c678dee8bed2,dt.trace_sampled=true] 200 GET /api/routes
[I 2024-02-02 10:30:14.276 JupyterHub proxy:431] Adding route for Hub: / => http://127.0.0.1:8081
10:30:14.279 [ConfigProxy] info: [!dt dt.trace_id=ae6b17730cbdbe3859726e8acbb652ba,dt.span_id=c840308ba5af3f03,dt.trace_sampled=true] Adding route / -> http://127.0.0.1:8081
10:30:14.279 [ConfigProxy] info: [!dt dt.trace_id=ae6b17730cbdbe3859726e8acbb652ba,dt.span_id=c840308ba5af3f03,dt.trace_sampled=true] Route added / -> http://127.0.0.1:8081
10:30:14.280 [ConfigProxy] info: [!dt dt.trace_id=ae6b17730cbdbe3859726e8acbb652ba,dt.span_id=c840308ba5af3f03,dt.trace_sampled=true] 201 POST /api/routes/
[I 2024-02-02 10:30:14.280 JupyterHub app:3156] JupyterHub is now running at http://:8000

Thanks

I have created Images for both single user and multi user.

0

There are 0 best solutions below