Open Rudd-O opened 7 years ago
Have you seen #495 ? Also note: #79 #229 #344
495 is unrelated to what I have asked for here.
Actually, none of those issues track any leg of this feature request. This request is about having confd write its own configuration files, not to have confd expand environment variables in existing configuration files.
I agree it would be quite nice if confd could expand env vars in its config files. It still wouldn't solve the problem I'm looking to solve, which is to dynamically configure confd based on the environment. I don't want to have to write confd config files — I want them to appear as specified by my application's specification.
Running a tool similar to envplate (https://github.com/kreuzwerker/envplate) prior to confd can accomplish what you want.
Thanks. envplate can't reload a service when confd rewrites a config file, and it seems like the way it sets up config files is more complex than confd-sidecar. It seems to me like at least the second feature should be built into confd. Thanks nonetheless.
100% agree this would be a super convenient feature for confd. Our environment has slight changes to the installation directory of a program based on the environment. It would be great if we could use the same TOML file and just reference the already existing environment variable that tells us where the installation is
[template]
src="mytemplate.tmpl"
dest="$MYAPP_HOME/configuration/configuration.conf"
Seems the issue should be: TOML configuration should also support (at least partially) template? So it can be written as
[template]
src="mytemplate.tmpl"
dest="{{ getenv "MYAPP_HOME" }}/configuration/configuration.conf"
Currently the check command already has a little support in templating. We can support templating on most of the fields, and evaluate them when they are used.
That would be an amazing feature to have access to in our TOML configuration files
The only thing that makes sense, in my opinion, is to reference the environment variables from the templates definitions, as well as the use of environment variables instead of CLI options.
I've had to write a custom program to configure confd prior to starting it in my containers:
https://github.com/teralytics/confd-sidecar
It would be great if the feature I wrote (using variables in the environment to configure confd) could be incorporated into confd.
Thanks for such a wonderful piece of software!