Hi there,
I have a question or rather maybe a feature request.
I would like to run jupyterhub in subdirectory, for example: devops.company.com/jupyterhub.
If the user then opens a browser on devops.company.com/jupyterhub, (s)he would be redirected to devops.company.com/jupyterhub/hub.
In the the chart, jupyterhub-0.9-4300ff5 | Mon, 30 Sep 2019 17:40:20 +0000 I see there is
pathSuffix
pathSuffix:
type: string
description: |
Suffix added to Ingress's routing path pattern.
Specify `*` if your ingress matches path by glob pattern.
If I set its value to /jupyterhub like here for example below, I get devops.company.com/hub/jupyterhub which would be also kind of expected.
ingress:
enabled: true
pathSuffix:
annotations:
kubernetes.io/ingress.class: traefik
hosts:
- ""
I have also already tried working with c.JupyterHub.base_url = '/jupyterhub/' in the hub-extraConfig but in that case, jupyterhub does not even start..
My ultimate goal would be to have in Traefik (my current proxy running in cluster) - for the jupyterhub frondend - this
PathPrefixStrip:/jupyterhub
Would it be possible to add path which would act as location from which jupyterhub should be run?
Thank you for any help.
When c.JupyterHub.base_url = '/jupyterhub/' is added to extraconfig, then Hub seems to work to some degree as its API is listening on http://0.0.0.0:8081/jupyterhub/hub/
Adding default route for Hub: /jupyterhub/ => http://10.x.x.x:8081
Proxy: Fetching POST http://10.x.x.x:8001/api/routes/jupyterhub
302 GET /hub/api/users -> /jupyterhub/hub/hub/api/users ([email protected]) 7.01ms
Try setting hub.baseUrl instead:
https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/50e5599ce99b8b7ee8f21564d7a49accc5222541/jupyterhub/values.yaml#L10
If that doesn't work can you share your whole config?
Thank you @manics ! I just got it work. Would a documentation PR for baseUrl in schema.yaml be accepted/approved?
For anyone looking for correct configuration:
hub:
baseUrl: /jupyterhub/
.......
extraConfig:
myConfig.py: |
c.JupyterHub.base_url = '/jupyterhub/'
extraConfig shouldn't be needed, if it is it's a bug! Is baseUrl correctly indented in your real config? It should be
hub:
baseUrl: /jupyterhub
Note I'm not sure if the trailing / makes a difference
Indeed, you are right. / should not be there. Extra config is not needed either
Additionally I have added traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip which made it more complex and was wrong anyway.
Most helpful comment
Try setting
hub.baseUrlinstead:https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/50e5599ce99b8b7ee8f21564d7a49accc5222541/jupyterhub/values.yaml#L10
If that doesn't work can you share your whole config?