# Nesting levels in config.yml file

**URL:** <https://discourse.jupyter.org/t/nesting-levels-in-config-yml-file/1037>\
**Category:** JupyterHub\
**Created:** [May 9, 2019, 8:50am UTC](https://discourse.jupyter.org/t/nesting-levels-in-config-yml-file/1037 "2019-05-09T08:50:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![amn41](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/amn41/32/429_2.png) [@amn41](https://discourse.jupyter.org/u/amn41)\
**Post date:** [May 9, 2019, 8:50am UTC](https://discourse.jupyter.org/t/nesting-levels-in-config-yml-file/1037/1 "2019-05-09T08:50:20Z")

</div>

I’m a little stuck working with the config.yaml from the (excellent!) zero-to-jupyterhub repo.

When I read this in the docs [https://zero-to-jupyterhub.readthedocs.io/en/latest/security.html#set-up-automatic-https](https://zero-to-jupyterhub.readthedocs.io/en/latest/security.html#set-up-automatic-https) I’m never clear where in my config this goes.

If I place this at the root level and run `helm upgrade ...`, the values never show up inside the config maps on GKE where I’m running jupyterhub.

Currently doing a bit of trial-and-error nesting it at different levels and seeing where it shows up:

```auto
binderhub:
  [here]

```

or

```auto
binderhub:
  jupyterhub:
    [here]

```

or

```auto
binderhub:
  jupyterhub:
    hub:
      [here]

```

can anyone give a hint as to how this file gets parsed?

---

<div class="post-metadata">

**Author:** ![minrk](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/minrk/32/13_2.png) [@minrk](https://discourse.jupyter.org/u/minrk)\
**Post date:** [May 10, 2019, 11:48am UTC](https://discourse.jupyter.org/t/nesting-levels-in-config-yml-file/1037/2 "2019-05-10T11:48:44Z")

</div>

First, the structure of values.yaml is dictated by the chart being configured. You can see the default jupyterhub values.yaml [here](https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/eaf87a217fca1834e299a0567a1ef87d813369b7/jupyterhub/values.yaml) which shows you the structure. The documentation for individual values is [here](https://zero-to-jupyterhub.readthedocs.io/en/latest/reference.html).

So if you are deploying just jupyterhub and want to configure the hub, you would have top-level keys such as ‘hub’, ‘singleuser’, ‘auth’, etc., e.g.:

```auto
auth:
  type: 'github'

hub:
  resources:
    memory:
      limit: '1G'

```

Second, when one chart includes another, as is the case with binderhub including the jupyterhub chart, then the included chart’s values.yaml are loaded from a key with the chart’s name, within the parent values:

```auto
# binderhub chart config is top-level
registry:
  username: 'minrk'
  password: 'xxx'

# jupyterhub chart config is now under a 'jupyterhub' key
# this key is dictated by the name of the included chart
jupyterhub:
  hub:
    resources:
      memory:
        limit: '1G'

```

You can see the binderhub values.yaml contains some [default overrides](https://github.com/jupyterhub/binderhub/blob/0b8f99af0a23a7828810b03f010edcefc9a46195/helm-chart/binderhub/values.yaml#L56) for config in the jupyterhub chart.

Finally, if you deploy binderhub itself as a dependency of a local chart, as is done [for mybinder.org](https://github.com/jupyterhub/mybinder.org-deploy), you would [have](https://github.com/jupyterhub/mybinder.org-deploy/blob/b34c7980caddb4e422136bf3e1d95c25cabcc078/mybinder/values.yaml#L24) binderhub as a top-level key and jupyterhub nested below binderhub:

```auto
binderhub:
  registry:
    ...
  jupyterhub:
    hub:
      ...

```

---

<div class="post-metadata">

**Author:** ![consideRatio](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/consideratio/32/1033_2.png) [@consideRatio](https://discourse.jupyter.org/u/consideRatio)\
**Post date:** [May 10, 2019, 4:13pm UTC](https://discourse.jupyter.org/t/nesting-levels-in-config-yml-file/1037/3 "2019-05-10T16:13:33Z")

</div>

> [@minrk](#):
>
> **Second, when one chart includes another** , as is the case with binderhub including the jupyterhub chart, then the included chart’s values.yaml are loaded from a key with the chart’s name, within the parent values:

> [@minrk](#):
>
> Finally, if you deploy binderhub itself **as a dependency of a local chart** , as is done [for mybinder.org](https://github.com/jupyterhub/mybinder.org-deploy), you would [have](https://github.com/jupyterhub/mybinder.org-deploy/blob/b34c7980caddb4e422136bf3e1d95c25cabcc078/mybinder/values.yaml#L24) binderhub as a top-level key and jupyterhub nested below binderhub:

I wanted to add some clarification to this. In Helm, nested chart dependencies are managed by using a special file named `requirements.yaml`. To learn more about using such files, see [the related Helm documentation](https://helm.sh/docs/developing_charts/#managing-dependencies-with-requirements-yaml).

To summarize, Helm chart are configured through provided values and have their own default values, but when you have a Helm chart that is utilizing another helm chart, the other helm chart’s values (the sub chart’s values) can be overridden by the parent chart’s values. Binderhub is a parent chart for the jupyterhub Helm chart, and the mybinder.org-deploy repo have made another helm chart that requires the BinderHub helm chart.

---

<div class="post-metadata">

**Author:** ![amn41](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/amn41/32/429_2.png) [@amn41](https://discourse.jupyter.org/u/amn41)\
**Post date:** [May 10, 2019, 4:27pm UTC](https://discourse.jupyter.org/t/nesting-levels-in-config-yml-file/1037/4 "2019-05-10T16:27:00Z")

</div>

thanks both ! that’s very helpful. So I should interpret the z2jh docs as telling me what to put inside the binderhub chart?

---

<div class="post-metadata">

**Author:** ![consideRatio](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/consideratio/32/1033_2.png) [@consideRatio](https://discourse.jupyter.org/u/consideRatio)\
**Post date:** [May 10, 2019, 5:14pm UTC](https://discourse.jupyter.org/t/nesting-levels-in-config-yml-file/1037/5 "2019-05-10T17:14:28Z")

</div>

Yepp has a dependency on the z2jh helm chart, so if you deploy a binderhub helm chart you get a z2jh helm chart along with it, and you can configure that in turn by writing to values under `jupyterhub`.
