-
Notifications
You must be signed in to change notification settings - Fork 792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dedicated .py file instead of snippets in extraConfig #1580
Comments
I think you can actually sub class kubespawner from the extraConfig. Consider it as a python file that will run. You can define the sub class and then assign it. Something like... hub:
extraConfig:
customSpawner: |
import kubespawner
class MySpawner(kubespawner.KubeSpawner):
pass
c.JupyterHub.spawner_class = 'MySpawner' If you really want to replace everything, then hmm... Perhaps override the command to start jupyterhub to use the specified configuration that you build with the image could accomplish it? |
Your right that I certainly could sub class KubeSpawner in As for overriding the command, how would you do that? The command is not part of the |
Ah, no I actually think you would be good to go even though c.KubeSpawner.config_options are set and you wont need to reset these. Regarding the hub command, woops... Okay so it is hardcoded, and then it is hard to change. We could certainly make this not hardcoded. It would make sense to me. |
If it wasn't hardcoded, then this would be a path forward. Maybe that is the best that can be done right now. That should be a pretty minor change, right? However, what would be really great is if we could somehow override the entire I did find a reference to the idea of using library charts in Helm 3 to do something similar to this, but to be honest, my understanding of helm is too limited to have fully parsed what was going on. |
Hi again @albertmichaelj, I think it is quite unique to want to override the entire jupyterhub_config.py, because you would need to know a lot and abandon the entire configuration system of the Helm chart pretty much. If you make a good case for wanting to replace the entire jupyterhub_config.py file, then let's add the option to configure the hub command or similarly. If so, the approach would be exactly like in #1813, I just confirmed that JupyterHub would also replace the earlier flags with the latter flags. |
@consideRatio Thanks for following up! My use case was because I wanted to include significant amount of code in the JupyterHub config file. Specifically, I had intended to write a custom authenticator in the JuptyerHub config file that would have been a large amount of code. Trying to maintain this code as part of the helm chart configuration file would have been a nightmare. To be clear, my use case would have involved modifying the existing configuration file instead of starting from scratch (which I completely agree is unrealistic in any situation I can think of). My solution to this was to instead create my own hub image and a package for my authenticator that I could just install in the hub image. I honestly believe that for my use case, creating my own hub image was probably the correct approach. However, when I opened this issue, I think I was in a bit of an uncanny valley of competency with kubernetes, so I believed that editing the configuration file would be a simpler solution. So, I do not believe that my use case requires an editable configuration file. However, I still am inclined to think that having an option to swap out the config file is still a better approach than hardcoding it. It's hard to anticipate how someone might want to modify the configuration (while I won't go into it now, I am doing things with JupyterHub on Kubernetes that were clearly not the intention of this chart). However, I understand that additional configurability implies an on-going maintenance burden, so this may not be worth the effort. Feel free to close this if you think that is appropriate. |
@albertmichaelj thank you for your thorough follow up to this! It sounds to me like you wanted to avoid the |
My issue was exactly that |
@albertmichaelj - I had the same exact issue on upgrading I settled on this as a workaround in the end:
The original |
I'm closing this in favor of the issue I mentioned this issue from (see reference just above this comment). It includes some thoughts on how to go about it and such. |
I'm opening this issue primarily for advice, but I also think that there may have been an unintentional side effect of a recent change to helm chart. #1407 moved the config files for the hub image to the helm chart
files/
directory. Overall, this seems to be a good thing, but there seems to be a problem with trying to use a custom hub image with a custom configuration with this helm chart as a sub-chart. Maybe I'm just misunderstanding something.Before this change, if I wanted to change
jupyterhub_config.py
, all I needed to do was build a custom hub image with my newjupyterhub_config.py
file and then point the hub image in the helm chart to my custom image. Now though, even with a custom docker image for the hub, the helm chart version ofjupyterhub_config.py
gets mounted and run. Moreover, if I'm using this helm chart as a sub-chart in a larger helm app, I can't figure out a way I could overwrite thejupyterhub_config.py
file without just forking this chart entirely and modifying thejupyterhub_config.py
file directly.Am I missing something? Did the hub customization become harder when using this chart as a sub-chart?
I'm very open to ideas, and just to be clear, using the
extra_config
is not enough because I want to sub-class KubeSpawner.The text was updated successfully, but these errors were encountered: