-
Notifications
You must be signed in to change notification settings - Fork 563
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
Reference other variables in values.yaml.gotmpl #2078
Comments
Try to use the recommendation from this document: https://github.com/roboll/helmfile/blob/master/docs/writing-helmfile.md#layering-state-template-files - something like this: customer: xxxxx
---
domain: {{ .Values.customer }}.example.com |
I would like to add my question here, I hope that's fine. Is this also possible with environment values? Can I use Go templating and the state layering there? What I'm trying to do is something like:
But it does not work. I get something like:
Any help would be very appreciated. Thank you! |
Hi, helmfile.yaml releases:
- name: myservice
namespace: test
chart: chart/parent
values:
- values.yaml.gotmpl values.yaml.gotmpl customer: xxxxx
---
domain: {{ .Values.customer }}.example.com this leads to the following errors @MurzNN helmfile write-values
> ... in ./helmfile.yaml: failed to render values files "values.yaml.gotmpl": failed to render [values.yaml.gotmpl], because of template: stringTemplate:3:18:
executing "stringTemplate" at <.Values.customer>: map has no entry for key "customer" Thanks for your support. |
@pathob @Ro-Fo Hey! As far as I remember, I don't think You could also try combining |
Same issue here. I'm trying to migrate an existing chart over to helmfile. The original chart used named templates and did a bunch of stuff that can be simplified by templating out a values file w/ helmfile. So I thought I'd be able to do something like this: # helmfile
releases:
- name: mychart
namespace: test
chart: mychart
values:
- values.yaml
- custom-thing.gotmpl # values.yaml
trueThing: true # custom-thing.gotmpl
{{- if .Values.trueThing }}
do it
{{- else }}
don't do it
{{- end }} How can I achieve this? |
Did u figure this out? |
Hi,
I would like to achieve something like the below.
values.yaml.gotmpl
This obviously does not work. Is there another way to reference a previous variable in
values.yaml.gotmpl
that I'm missing?Thanks!
The text was updated successfully, but these errors were encountered: