Skip to content

jupyter-web-app's PodDefault configurations are keyed by their label selector's key, not their name #121

Open
@ca-scribner

Description

@ca-scribner

/kind bug

What steps did you take and what happened:
The Notebook spawner page is configured using the spawner_ui_config.yaml input file.
The configurations section lets an admin define which PodDefaults should be selected by default. spawner_ui_config.yaml's comments state:

the list of PodDefault names that are selected by default

If I create a PodDefault named example:

apiVersion: kubeflow.org/v1alpha1
kind: PodDefault
metadata:
 name: example
spec:
 desc: Example PodDefault
 env:
 - name: SOMETHING
   value: stuff
 selector:
   matchLabels:
     example-match-selector: "true"

then set the spawner_ui_config.yaml's configurations to:

  configurations:
    readOnly: false

    # the list of PodDefault names that are selected by default
    # (take care to ensure these PodDefaults exist in Profile Namespaces)
    value:
    - example

I do not see it selected in the spawner UI by default:

image

What did you expect to happen:

When specifying PodDefaults by name in the spawner_ui_config.yaml, I expect them to be selected by default on the spawner page:

image

Anything else you would like to add:

I think this is a bug in the jwa backend's get_poddefaults(). get_poddefaults() returns a result where the label field is set as the key of the 0th matchLabels selector:

https://github.com/kubeflow/kubeflow/blob/bd7f250df22e144b114177536309d28651b4ddbb/components/crud-web-apps/jupyter/backend/apps/common/routes/get.py#L29-L49

This can be confirmed by setting

  configurations:
    readOnly: false

    # the list of PodDefault names that are selected by default
    # (take care to ensure these PodDefaults exist in Profile Namespaces)
    value:
    - example-match-selector

And reloading/refreshing the spawner page:

image

I think this should probably instead be:

        label = pd["metadata"]["name"]  # haven't compiled this - might have typo'd something

Environment:

  • Kubeflow version: (version number can be found at the bottom left corner of the Kubeflow dashboard): 1.8
  • kfctl version: (use kfctl version):
  • Kubernetes platform: (e.g. minikube)
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Status

    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions