jupyterhub / zero-to-jupyterhub-k8s

Helm Chart & Documentation for deploying JupyterHub on Kubernetes
https://zero-to-jupyterhub.readthedocs.io
Other
1.56k stars 801 forks source link

Error when hub.extraFiles added using --set-file following the docs #2895

Closed lucianolacurcia closed 2 years ago

lucianolacurcia commented 2 years ago

Bug description

When I try to helm upgrade current deployment now adding hub.extraFiles.stringData I get the following error:

$ helm upgrade jupyterhub-stable jupyterhub/jupyterhub -f values_test.yml --version=2.0.0 --set-file hub.extraFiles.mi_config.stringData=$(pwd)/pre_spawn_config.py
Error: UPGRADE FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
jupyterhub:
- hub.extraFiles.mi_config: mountPath is required

But my values.yml already has the required value:

hub:
  extraFiles:
    mi_config:
      mountPath: "/usr/local/etc/jupyterhub/jupyterhub_config.d/my_jupyterhub_config.py"

Expected behaviour

I would expect helm to not ask me for a value I already have.

Workaround

As a work around, I use the following command:

helm upgrade jupyterhub-stable jupyterhub/jupyterhub -f values_test.yml --version=2.0.0 --set-file hub.extraFiles.mi_config.stringData=$(pwd)/pre_spawn_config.py -
-set  hub.extraFiles.mi_config.mountPath="/usr/local/etc/jupyterhub/jupyterhub_config.d/my_jupyterhub_config.py"

and comment out the extraFile lines:

hub:
  # extraFiles:
  #   mi_config:
      # mountPath: "/usr/local/etc/jupyterhub/jupyterhub_config.d/my_jupyterhub_config.py"
welcome[bot] commented 2 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

consideRatio commented 2 years ago

If I'm using this config, saved into test.yaml.

hub:
  extraFiles:
    mi_config:
      mountPath: "/usr/local/etc/jupyterhub/jupyterhub_config.d/my_jupyterhub_config.py"

Then the error I get is the following, which makes sense to me given that config.

$ helm template --repo=https://jupyterhub.github.io/helm-chart jupyterhub --values test.yaml

Error: values don't meet the specifications of the schema(s) in the following chart(s):
jupyterhub:
- hub.extraFiles.mi_config: Must validate one and only one schema (oneOf)
- hub.extraFiles.mi_config: data is required

You have not provided something to put in the file via data, stringData, or binaryData. In the case of a .py file, you should go for stringData.

Using this configuration, there is no error and you should end up with a mounted file containing two print statements.

hub:
  extraFiles:
    mi_config:
      mountPath: "/usr/local/etc/jupyterhub/jupyterhub_config.d/my_jupyterhub_config.py"
      stringData: |
        print("hi")
        print("hi again")
github-actions[bot] commented 2 years ago

Hi there @lucianolacurcia :wave:!

I closed this issue because it was labelled as a support question.

Please help us organize discussion by posting this on the https://discourse.jupyter.org/ forum. If it's your first time posting please read https://discourse.jupyter.org/t/getting-good-answers-to-your-questions/1825. The more information you provide the more likely we can help you.

Our goal is to sustain a positive experience for both users and developers. We use GitHub issues for specific discussions related to changing a repository's content, and let the forum be where we can more generally help and inspire each other.

Thanks you for being an active member of our community! :heart: