I was using a loadbalancer service caught by and DNS A record and now I switched to ingress and ClusterIP service to resemble your setup.
Currently the singleuser starts successfully but, there is a redirect issue again. When I start the Server I get redirected to the user subdomain
https://test_20user.jupyterhub.test.run/user/test%20user/
404 page not found
logs from singeuser pod:
+ CMD=("$@")
+ exec /usr/bin/tini -s -- jupyterhub-singleuser
Non-spark-on-k8s command provided, proceeding in pass-through mode...
[W 2024-10-21 12:43:53.053 ServerApp] A `_jupyter_server_extension_points` function was not found in nbclassic. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2024-10-21 12:43:53.057 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-10-21 12:43:53.057 ServerApp] jupyter_resource_usage | extension was successfully linked.
[I 2024-10-21 12:43:53.062 ServerApp] jupyter_server_mathjax | extension was successfully linked.
[I 2024-10-21 12:43:53.062 ServerApp] jupyter_server_proxy | extension was successfully linked.
[I 2024-10-21 12:43:53.066 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-10-21 12:43:53.066 ServerApp] jupyter_vscode_proxy | extension was successfully linked.
[I 2024-10-21 12:43:53.066 JupyterHubSingleUser] Starting jupyterhub single-user server extension version 4.1.5
[I 2024-10-21 12:43:53.067 JupyterHubSingleUser] Using default url from server extension lab: /lab
[I 2024-10-21 12:43:53.070 ServerApp] jupyterhub | extension was successfully linked.
[W 2024-10-21 12:43:53.072 LabApp] 'extra_template_paths' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[I 2024-10-21 12:43:53.075 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-10-21 12:43:53.075 ServerApp] jupyterlab_git | extension was successfully linked.
[W 2024-10-21 12:43:53.077 NotebookApp] 'extra_template_paths' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[I 2024-10-21 12:43:53.079 ServerApp] nbclassic | extension was successfully linked.
[I 2024-10-21 12:43:53.079 ServerApp] nbdime | extension was successfully linked.
[W 2024-10-21 12:43:53.081 JupyterNotebookApp] 'extra_template_paths' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[I 2024-10-21 12:43:53.083 ServerApp] notebook | extension was successfully linked.
[I 2024-10-21 12:43:53.085 ServerApp] Writing Jupyter server cookie secret to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2024-10-21 12:43:53.439 ServerApp] notebook_shim | extension was successfully linked.
/opt/conda/lib/python3.11/site-packages/jupyter_server/serverapp.py:2236: JupyterServerAuthWarning: Core endpoints without @allow_unauthenticated, @ws_authenticated, nor @web.authenticated:
- GET of JupyterHubLogoutHandler registered for /user/test%20user/logout
- GET of JupyterHubOAuthCallbackHandler registered for /user/test%20user/oauth_callback
self.web_app = ServerWebApplication(
[I 2024-10-21 12:43:53.460 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-10-21 12:43:53.463 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-10-21 12:43:53.463 ServerApp] jupyter_resource_usage | extension was successfully loaded.
[I 2024-10-21 12:43:53.464 ServerApp] jupyter_server_mathjax | extension was successfully loaded.
[I 2024-10-21 12:43:53.481 ServerApp] jupyter_server_proxy | extension was successfully loaded.
[I 2024-10-21 12:43:53.482 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[W 2024-10-21 12:43:53.483 ServerApp] jupyter_vscode_proxy | extension failed loading with message: ExtensionLoadingError('_load_jupyter_server_extension function was not found.')
Traceback (most recent call last):
File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/manager.py", line 360, in load_extension
extension.load_all_points(self.serverapp)
File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/manager.py", line 232, in load_all_points
return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/manager.py", line 232, in <listcomp>
return [self.load_point(point_name, serverapp) for point_name in self.extension_points]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/manager.py", line 223, in load_point
return point.load(serverapp)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/manager.py", line 150, in load
loader = self._get_loader()
^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/manager.py", line 119, in _get_loader
loader = get_loader(loc)
^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/jupyter_server/extension/utils.py", line 40, in get_loader
raise ExtensionLoadingError(msg) from None
jupyter_server.extension.utils.ExtensionLoadingError: _load_jupyter_server_extension function was not found.
[I 2024-10-21 12:43:53.494 JupyterHubSingleUser] Updating Hub with activity every 300 seconds
[I 2024-10-21 12:43:53.495 ServerApp] jupyterhub | extension was successfully loaded.
[I 2024-10-21 12:43:53.506 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.11/site-packages/jupyterlab
[I 2024-10-21 12:43:53.506 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 2024-10-21 12:43:53.507 LabApp] Extension Manager is 'pypi'.
[I 2024-10-21 12:43:53.524 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-10-21 12:43:53.530 ServerApp] jupyterlab_git | extension was successfully loaded.
[I 2024-10-21 12:43:53.534 ServerApp] nbclassic | extension was successfully loaded.
[I 2024-10-21 12:43:53.599 ServerApp] nbdime | extension was successfully loaded.
[I 2024-10-21 12:43:53.603 ServerApp] notebook | extension was successfully loaded.
[I 2024-10-21 12:43:53.604 ServerApp] Serving notebooks from local directory: /home/jovyan
[I 2024-10-21 12:43:53.604 ServerApp] Jupyter Server 2.14.0 is running at:
[I 2024-10-21 12:43:53.604 ServerApp] http://jupyter-test-20user:8888/user/test%20user/lab?token=...
[I 2024-10-21 12:43:53.604 ServerApp] http://127.0.0.1:8888/user/test%20user/lab?token=...
[I 2024-10-21 12:43:53.604 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2024-10-21 12:43:54.009 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[I 2024-10-21 12:43:54.376 ServerApp] 302 GET /user/test%20user/ -> /user/test%20user/lab? (@100.64.4.44) 1.88ms
logs from hub:
[D 2024-10-21 12:47:33.464 JupyterHub log:192] 200 GET /hub/health (@10.250.0.236) 0.73ms
[I 2024-10-21 12:47:33.685 JupyterHub oauth2:99] OAuth redirect: https://jupyterhub.test.run/hub/oauth_callback
[D 2024-10-21 12:47:33.685 JupyterHub base:668] Setting cookie oauthenticator-state: {'httponly': True, 'expires_days': 1}
[I 2024-10-21 12:47:33.686 JupyterHub log:192] 302 GET /hub/oauth_login?next= -> https://login.microsoftonline.com/<secret>/oauth2/authorize?response_type=code&redirect_uri=https%3A%2F%2Fjupyterhub.test.run%2Fhub%2Foauth_callback&client_id=<secret>=[secret]
[D 2024-10-21 12:47:33.918 JupyterHub reflector:374] pods watcher timeout
[D 2024-10-21 12:47:33.918 JupyterHub reflector:289] Connecting pods watcher
[D 2024-10-21 12:47:34.056 JupyterHub reflector:374] pods watcher timeout
[D 2024-10-21 12:47:34.056 JupyterHub reflector:289] Connecting pods watcher
[D 2024-10-21 12:47:35.245 JupyterHub roles:282] Assigning default role to User test user
[D 2024-10-21 12:47:35.260 JupyterHub base:668] Setting cookie jupyterhub-session-id: {'httponly': True, 'path': '/', 'domain': 'jupyterhub.test.run'}
[D 2024-10-21 12:47:35.260 JupyterHub base:672] Setting cookie for test user: jupyterhub-hub-login
[D 2024-10-21 12:47:35.260 JupyterHub base:668] Setting cookie jupyterhub-hub-login: {'httponly': True, 'path': '/hub/'}
[I 2024-10-21 12:47:35.261 JupyterHub _xsrf_utils:125] Setting new xsrf cookie for b'cookie' {'path': '/hub/'}
[I 2024-10-21 12:47:35.261 JupyterHub base:937] User logged in: test user
[I 2024-10-21 12:47:35.262 JupyterHub log:192] 302 GET /hub/oauth_callback?code=[secret]&state=[secret]&session_state=[secret] -> https://test_20user.jupyterhub.test.run/user/test%20user/
[D 2024-10-21 12:47:35.464 JupyterHub log:192] 200 GET /hub/health (@10.250.0.236) 0.71ms
config:
hub:
config:
AzureAdOAuthenticator:
allow_all: true
username: unique_name
oauth_callback_url: https://jupyterhub.test.run/hub/oauth_callback
enable_auth_state: true
JupyterHub:
authenticator_class: azuread
hub_connect_url: "http://hub.jupyterhub.svc.cluster.local:8081"
extraConfig:
subdomain: |
c.JupyterHub.subdomain_host = "https://jupyterhub.test.run"
proxy:
https:
enabled: false
chp:
extraCommandLineFlags:
- --host-routing
service:
type: ClusterIP
https:
enabled: false
traefik:
hsts:
includeSubdomains: true
singleuser:
extraEnv:
JUPYTERHUB_BASE_URL: 'https://jupyterhub.test.run/'
cmd: jupyterhub-singleuser
defaultUrl: null
ingress:
enabled: true
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
ingressClassName: traefik
hosts:
- '*.jupyterhub.test.run'
- 'jupyterhub.test.run'
pathType: Prefix
tls:
- hosts:
- '*.jupyterhub.test.run'
- 'jupyterhub.test.run'
secretName: wildcard-jupyterhub-tls