You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Internally this is an alias of `environments.default.values`
values:
- myAPIEndpoint: https://dev.example.com/
mykey: myvalue
environments:
production:
values:
- myAPIEndpoint: https://prod.example.com/
When --environment production
{{ .Environment.Values.mykey }} fails(This preserves the existing behavior)
{{ .Values.mykey }} results in myvalue cuz .Values is environments.default.values + environments.production.values
It's .Values so the command-line args to set it from k-v pairs would naturally look like helmfile --set KEY=VALUE
The command-line args to set it from a file it looks like helmfile --values FILE
helmfile --environment NAME remains as-is. It set's the state's environment name.
helmfile --set-envvar NAME=VALUE, helmfile --envvar-set, or helmfile --envvar sets envvars from NAME=VALUE pairs.
helmfile --envvars-file FILE, or helmfile --envvars FILE sets environment variables from the FILE
For envvars, I personally prefer the combo of helmfile --envvars-file FILE and helmfile --envvar-set NAME=VALUE, as it seems user-friendly because (1)they naturally collocate in the flags list thati s alphabetically sorted (2) it's harder to confuse with --environment NAME.
This is a copy-paste of #361 (comment) for visibility.
We're going to introduce State Values, that should be the foundation for various useful features.
(Note that this isn't a breaking change)
We have a feature request that breaks
.Environment.Valuesif done straightforward #398 (comment)Alternatively, we can change the term to
State Values, and:Make it accessible in the template with
.Values(not.Environment.Values)Explicitly note in the documentation that
Environment Valuesis for overriding(State) ValuesDeprecate
.Environment.Valuesand recommend using.Values..Valuescan be overrode with command-line args and environment values files(Question: How to handle global variables across helmfiles #398 (comment))When
--environment production{{ .Environment.Values.mykey }}fails(This preserves the existing behavior){{ .Values.mykey }}results inmyvaluecuz.Valuesisenvironments.default.values + environments.production.valuesIt's
.Valuesso the command-line args to set it from k-v pairs would naturally look likehelmfile --set KEY=VALUEThe command-line args to set it from a file it looks like
helmfile --values FILEWe recently implemented feat: specify env values from the parent to the nested state #622 but it should be changed. Use
helmfiles[].valuesrather thanhelmfiles[].environment.valuesmake it similar to its command-line flag variant--values.helmfile --environment NAMEremains as-is. It set's the state's environment name.helmfile --set-envvar NAME=VALUE,helmfile --envvar-set, orhelmfile --envvarsets envvars from NAME=VALUE pairs.helmfile --envvars-file FILE, orhelmfile --envvars FILEsets environment variables from the FILEFor envvars, I personally prefer the combo of
helmfile --envvars-file FILEandhelmfile --envvar-set NAME=VALUE, as it seems user-friendly because (1)they naturally collocate in the flags list thati s alphabetically sorted (2) it's harder to confuse with--environment NAME.