Extend List of JWA Preselected Configurations

This guide will walk you through extending the list of the Jupyter Web App (JWA) preselected configurations and enabling JWA to create notebooks that automatically mount them.

Configurations in JWA correspond to PodDefault custom resources in Kubernetes. For the rest of the document we will be referring to them as “PodDefaults”, but the two terms can be used interchangeably.

What You’ll Need


  1. Go to the GitOps repository inside your rok-tools management environment:

    root@rok-tools:~# cd ~/ops/deployments
  2. List the PodDefaults applied in the user namespaces:

    root@rok-tools:~/ops/deployments# kubectl -n kubeflow-skel get poddefaults NAME AGE example-poddefault 5d ...
  3. Get the YAML definition of the PodDefault you want to have enabled by default, here example-poddefault:

    root@rok-tools:~/ops/deployments# kubectl -n kubeflow-skel get poddefaults example-poddefault -oyaml apiVersion: kubeflow.org/v1alpha1 kind: PodDefault metadata: ... name: example-poddefault namespace: kubeflow-skel ... spec: desc: Example PodDefault resource env: - name: EXAMPLE_ENVVAR value: example selector: matchLabels: example-poddefault: "true"
  4. Get the label key of the PodDefault selector.

    The selector of the PodDefault is the label example-poddefault: "true". In this case, the key is example-poddefault.


    PodDefaults use selectors similar to the above, that is, a label with a value of "true".

  5. Edit the Jupyter Web App config at kubeflow/manifests/apps/jupyter/jupyter-web-app/upstream/overlays/deploy/patches/config-map.yaml and add your custom PodDefault to the Jupyter Web App configuration:

    data: spawner_ui_config.yaml: | ... configurations: # List of labels to be selected, these are the labels from PodDefaults # value: # - add-gcp-secret # - default-editor value: - access-rok - access-ml-pipeline - example-poddefault # <-- Add your PodDefault label key in this list readOnly: false
  6. Commit your changes:

    root@rok-tools:~/ops/deployments# git commit -am "kubeflow: Extend list of JWA preselected Configurations"
  7. Reapply the kustomization:

    root@rok-tools:~/ops/deployments# rok-deploy --apply kubeflow/manifests/apps/jupyter/jupyter-web-app/upstream/overlays/deploy

What’s Next

Check out the rest of the settings you can configure for JWA.