Helm install multiple jupyterhub instances into different namespaces on the same cluster

Hello,

not sure if this is a bug or a misconfiguration on my side. I would like to deploy two (or more) instances of jupyterhub into the same cluster. The two jupyterhub deployments would operate in separate namespaces and are created using helm. This works well, as long as I do not install into a second (pre-created) namespace.
On helm install into the second namespace I get the following error:

Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole “jupyterhub-user-scheduler” in namespace “” exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key “meta.helm.sh/release-namespace” must equal “namespace-1”: current value is “namespace2”

In this case, I 'helm installe’d into namespace namespace1 first, and afterwards (additionally) into namespace2.

Removing ClusterRole and ClusterRoleBinding would enable me to helm install into namespace2. Unfortunately, it seems only a single namespace can be catered by that at any time. Is there a configuration option to get around this problem?

Kind regards, Micha

I think this is due to the user-scheduler:
https://zero-to-jupyterhub.readthedocs.io/en/stable/administrator/optimization.html?highlight=userScheduler
this exists to improve the performance of an autoscaling K8S cluster. Obviously this means it has to run at the cluster level instead of within a namespace.

If you’ve got multiple JupyterHub it might be best to disable it on all deployments. Let us know if that works, if so I think it’s worth adding to the zero-to-jupyterhub docs.

1 Like

Hello manics,

awesome. That seems to do the trick. It is exactly as you suggest:
I added the following in the root-Level of config.yaml and it deploys just fine.

scheduling:
  userScheduler:
    enabled: false

Thank you very much,
Michael Jahn