-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update chart dependencies before installing #1450
Conversation
We want to be able to update the dependencies of a Helm chart. Helm (whether the client library or the command-line tool) makes it difficult to do this without also having other equipment, notably the repositories.yaml file which records aliases and possibly credentials for Helm repos (e.g., "stable"). This commit adds a default repositories.yaml file to the image, containing just the conventional location of "stable".
This makes trouble-shooting a bit easier, since you can exec into the container and have a look around with `helm`.
The easiest thing to do is use the Helm binary; since there's no communication with Tiller involved, there are fewer compatibility pitfalls (possibly none).
I need to make sure this can cover a couple of scenarios aside from the bare basics: Can you set it up to use a repo other than stable?This will probably mean mounting a repositories.yaml file; but,
How do you provide credentials for the repo?Credentials get put in the repositories.yaml file; so again, if you want to supply credentials, you'd have to mount that file from a secret, with the problems as above. |
I've tried both of these things (in one go). You can mount a repositories.yaml file into the expected location
On that second thing: Helm seems to expect a specific value in the cache field, that is |
I could do the dependency update in code to try and work around the oddnesses, but it would be a drastic step, because the helm go library also assumes the repositories.yaml, index files, and cache are inextricably tied (they all get calculated relative to a value |
Apparently 2.8.2 didn't support authentication for chart repos; 2.9.1 does.
39ce0e3
to
4f2fbd0
Compare
I've pushed the image quay.io/squaremo/helm-operator:pr-1450 for anyone who wants to try this out. |
I've try your image and requirements are correctly installed 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM tested with public repos
This addresses #1278, for the "alpha" series (i.e., not for #1382). It simply calls
helm dep build
in the chart directory, when installing or upgrading a release.Note that it bakes in a
repositories.yaml
file (which specifies the repo URLs, and is necessary for thehelm
commands to function). This file specifies only the conventional "stable" repo. 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).