traefik-on-service-fabric icon indicating copy to clipboard operation
traefik-on-service-fabric copied to clipboard

Passing env specific config file

Open tanwarsatya opened this issue 6 years ago • 4 comments

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>

tanwarsatya avatar Jul 18 '18 20:07 tanwarsatya

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.

RamjotSingh avatar Jul 18 '18 20:07 RamjotSingh

I will try that, also what about specifying different url (http vs https).

tanwarsatya avatar Jul 18 '18 20:07 tanwarsatya

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 avatar Jul 18 '18 21:07 jjcollinge

@jjcollinge Thx for the update, I will wait for it.

tanwarsatya avatar Jul 19 '18 01:07 tanwarsatya