-
Notifications
You must be signed in to change notification settings - Fork 564
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
Templating complex values.yaml files #700
Comments
@ChrisCooney Thanks for trying helmfile and bringing this up! I feel frustrated to this problem as well. Perhaps you may be interested in #658 for a possible longer-term solution. Have you tried making your all or part(s) of your values.yaml non-template file(Omit
If you've already tried that, and you still wanted to have a single file that has nice comments containing example template expressions and alertmanager configs - yeah we don't currently have an elegant way . Since #658 I've considered another delimiters for helmfile templates, like That's why I started to think that we eventually need a completely different "language" that doesn't conflict with go templates. There's a bunch of "embedded" languages used for generating dynamic configs - Skylark(See kubetest), Rego(See conftest), Lua(Helm v3, gofish), ECMAScript(jkcfg/jk), and so on. One of helmfile ways is that being consistent with helm. Fortunately helm v3 is introducing Lua support for chart libraries and hooks. So add Lua as an another language to describe dynamic helmfile values.yaml files? I'm okay with Lua but not sure if everyone is. WDYT? |
Can I drop the name of |
@aegershman Yeah I'm eager to add various templating options. The only consideration needed here is how to implement it without bloating the helmfile codebase 😄 Perhaps someone could propose a pluggable template engine system for helmfile so that helmfile is able to use any template engine without bloating code and sacrificing binary size. |
I'd say only go template and Lua can be the first-class citizens to make helmfile friendly for helm users. |
tried to configure prometheus alertmanager templates and faced with this issue. |
@StepanKuksenko Hey! Sorry but could you share what you've tried? This is already "solved" with the below syntax:
That's go text/template's native comment sytnax, so that you can literally render |
Faced same issue with vector helm chart. Mainly this part:
Even if i wrap
to
It still fails trying to treat file as a function: parse error at (vector-agent/templates/configmap.yaml:13): function "file" not defined It uses toYaml to generate resulting configmap |
Hi!
And it always renders the instruction to me but does not resolve it. Thanks |
@rlex This seems to be coming from your chart, not helmfile, right? Then almost certainly you're misusing the chart. Mind sharing the chart and the offending chart template, so that we can hopefully see what's going on? |
Everyone, please share the exact chart, helmfile.yaml, and all the values.yaml files if you need user support! |
Consider the following
values.yaml
file. This is an excerpt from the default values file for the prometheus helm chart:When we're attempting to use helmfile to template into this
values.yaml.gotpl
file, we are seeing errors. Obviously it is picking up on{{
and seeing it as a template. We can accept this for comments since they can simply be deleted, however the same thing is happening for nested values that are not in comments.To be completely honest, I don't really know what the answer to this question is. It is understandable that
helmfile
is detecting these interpolation tokens - however it introduces a lot of escaping and complexity. Given that prometheus is such a widely used chart, I felt it was worth raising to start a discussion.The text was updated successfully, but these errors were encountered: