traefik-on-service-fabric
traefik-on-service-fabric copied to clipboard
Passing env specific config file
How to specify different config file as command line argument when publishing to different environments. Currently only a verbatim string can be specified, This is critical for publishing the config file based on different environment as it have different certs and keys based on environment.
In the example below the config file is specified as hardcoded value, is it possible to supply a parameter or variable ?
<EntryPoint>
<ExeHost>
<Program>traefik.exe</Program>
<Arguments>--configfile=traefik.toml</Arguments>
<WorkingFolder>CodePackage</WorkingFolder>
<!-- Uncomment to log console output (both stdout and stderr) to one of the
service's working directories. -->
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048" />
</ExeHost>
</EntryPoint>
You can try out https://github.com/jjcollinge/traefik-on-service-fabric/pull/65. The code might need some cleanup but it is supposed to help in the scenarios you are talking about. It lets you fetch certs from machine or KeyVault and then drop them with a specific name.
I will try that, also what about specifying different url (http vs https).
We want to be able to define environment specific configuration to Traefik via env vars to enable greater flexibility and we have an outstanding here: https://github.com/containous/staert/pull/42 written by @serbrech to start this process but it is slow going!
@jjcollinge Thx for the update, I will wait for it.