If you are using the jupyterhub helm
chart https://github.com/jupyterhub/zero-to-jupyterhub-k8s , you can
specify it in the helm values yml like so:
hub:
extraConfig: |
c.KubeSpawner.options_form = """
<label for='image'>Image</label>
<input name='image' placeholder='repo/image:tag'></input>
<br/><br/>
<label for='cpu_guarantee'>CPU</label>
<input name='cpu_guarantee' placeholder='200m, 1.0, 2.5, etc'></input>
<br/><br/>
<label
for='mem_guarantee'>Memory</label>
<input name='mem_guarantee' placeholder='100Mi, 1.5Gi'></input>
<br/><br/>
<label for='extra_resource_limits'>Extra Resource
Limits</label>
<input name='extra_resource_limits' placeholder='{'nvidia.com/gpu':
'3'}'></input>
<br/><br/>
"""
On Wednesday, September 19, 2018 at 8:58:55 AM UTC-6, daniel davis wrote:
>
> Hello all,
>
> I followed the jupyterhub-quickstart
> <https://github.com/jupyter-on-openshift/jupyterhub-quickstart> examples
> on GitHub and have a working jupyterhub instance in OpenShift that spawns
> instances of a custom notebook. Works great!
>
> Now I am trying to add an input form to the jupyterhub spawner to capture
> an API token for use in the notebook instances. I have seen examples
> <https://github.com/kubeflow/kubeflow/blob/30f913986607bb8414d51ef6a23fe60fec9afe3c/kubeflow/core/jupyterhub_spawner.py>
>
> of using forms, but they all involve defining a new spawner class rather
> than passing parameters to the kubespawner instance. Attempts to create a
> custom spawner by overriding jupyterhub_spawner.py succeed in displaying a
> form, but break the rest of the deployment. So I am looking for advice on
> how to approach this problem. I was hoping to pass a form variable or html
> to the c.KubeSpawner object, but all the examples I have seen require
> creating a new spawner class and defining functions to handle the form data.
>
> Is there a way to use an input form with the existing KubeSpawner class?
> I'm a Jupyter novice, so it is possible I am missing something obvious.
> Appreciate any advice.
>
--
You received this message because you are subscribed to the Google Groups
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jupyter/0ab1a302-cf1f-4976-8afc-936530fc679d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.