When using helm charts, The dependencies of the helm chart are not available if they are in a custom repository.
Maybe related to fluxcd/flux#1278?
Reported by @tmestdagh
Why did you try, what did you expect, and what actually happened?
I think I can fill in the gaps (based on earlier user reports).
At the moment when users define their own dependencies in their chart's requirements.yaml:
dependencies:
- name: chartdep
version: 1.0.0
repository: https://some.custom.repository.com
they need to add the https://some.custom.repository.com repository to the repositories.yaml Helm uses (by creating their own and mounting it at the expected path), as we only ship the stable chart repo with our Docker image.
This was already concluded by yourself in fluxcd/flux#1450 (but probably never made it to an issue):
We will need to figure out how to allow other repos to be specified; it is not quite good enough to mount your own file, since it lives in a directory helm wants to write to (and the mount would mean it's read-only).
I think users expect the requirements.yaml in their chart to be sufficient.
If you were using helm, would you expect to have to add the repository, or would the mention in requirements.yaml be enough?
You would have to add the repository with helm repo add.
$ cat requirements.yaml
dependencies:
- name: helmdep
version: 1.0.0
repository: https://some.custom.repo.com
$ helm dependency build
Error: no repository definition for https://some.custom.repo.com. Please add them via 'helm repo add'
I see, OK -- thanks Hidde.
I'm not sure we can do anything in code to remedy this misunderstanding. I don't like falling back on "explain better in docs", but since we're not doing anything that diverges from normal use of helm, perhaps that's what is needed here.
Thanks @hiddeco , thats exactly the problem I was facing. Yeah, I was wondering if the solution for the missing Helm repositories is to mount a custom version of repostiories.yaml. Thanks for the clarification.
I see, OK -- thanks Hidde.
I'm not sure we can do anything in code to remedy this misunderstanding. I don't like falling back on "explain better in docs", but since we're not doing anything that diverges from normal use of
helm, perhaps that's what is needed here.
In normal use of helm, afaik one would add the repositories listed in the requirements.yaml to Helm before updating the dependencies.
Maybe we can improve the support for custom repos in the Helm chart? I.e. providing a list of repos in the values.yaml (helmOperator.configureRepositories.repositories[].url) which will then be converted to the appropriate repositories.yaml, saved in a secret and mounted.
@srueg That's not a bad idea -- @stefanprodan @hiddeco wdyt?
There's variations on that too, I think: the operator itself could build a repositories.yaml based on the URLs it sees, for example (in fact it might be a good idea to sandbox each release).
Most helpful comment
I think I can fill in the gaps (based on earlier user reports).
At the moment when users define their own dependencies in their chart's
requirements.yaml:they need to add the
https://some.custom.repository.comrepository to therepositories.yamlHelm uses (by creating their own and mounting it at the expected path), as we only ship the stable chart repo with our Docker image.This was already concluded by yourself in fluxcd/flux#1450 (but probably never made it to an issue):
I think users expect the
requirements.yamlin their chart to be sufficient.