Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Template values files #97

Closed
sstarcher opened this issue Apr 7, 2018 · 7 comments
Closed

Proposal: Template values files #97

sstarcher opened this issue Apr 7, 2018 · 7 comments

Comments

@sstarcher
Copy link
Contributor

To limit the need to duplicate values it would be helpful to be able to template the values files.

@osterman
Copy link
Contributor

Also, just want to throw this out there: https://github.com/hairyhenderson/gomplate

gomplate > sprig

richer library of functions. pretty much everything sprig can do, but more! =)

@mumoshu
Copy link
Collaborator

mumoshu commented Apr 26, 2018

@osterman Thx for the info! gomplate looks promising :)

Just to sync up with you, it looks like there is a momentum to let helmfile be close to helm's spec/behavior.
sprig sounded a good idea at the time we introduced it in that regard, but practically saying there can be more options.

That being said, I'm eager to providing options to use an alternative template engine like gomplate as long as it doesn't lock helmfile to single template engine, and the implementation is not so hard.

Actually, I prefer jsonnet as suggested in #92 here but it is attracted to no one 🤣

WDYT? Any input is welcomed!

@sstarcher
Copy link
Contributor Author

Overall I would tend to stick with sprig unless we supported both.

@mumoshu
Copy link
Collaborator

mumoshu commented Apr 26, 2018

@sstarcher I was considering to support this simply like:

releases:
- name: myrelease
   values:
   - myvalues.yaml

This configuration would just instruct helmfile to render a temporary yaml file from ./myvalues.yaml. The extension can be anything. So, even if it is .yaml, it's considered a sprig template. To be extra clear, it can be a standard yaml if the yaml doesn't include any golang text/template expressions in it.

Alternatives to the above is:

releases:
- name: myrelease
   values:
   - template: myvalues.yaml.tmpl
releases:
- name: myrelease
   valuesTemplates:
   - myvalues.yaml.tmpl

This looks more explicit which I personally prefer, but I guess the momentum in helmfile community is not make it too explicit like that, similar to helm's own template(no .tmpl extension, no distinction between template vs regular yaml file). In short, keeping it simple at glance seems like the way to go.

WDYT?

@sstarcher
Copy link
Contributor Author

I would transparently support it s in your first example. Run the templates across all values files.

@mumoshu
Copy link
Collaborator

mumoshu commented Apr 27, 2018

@sstarcher Thx. Sounds good. I've posted an enhanced example in #119 (comment).

mumoshu added a commit to mumoshu/helmfile that referenced this issue Aug 22, 2018
@mumoshu
Copy link
Collaborator

mumoshu commented Aug 22, 2018

Just submitted #216 for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants