Combining file and CLI configurations

I am using the Kubernetes CRD and Traefik version:

Version:      2.0.0
Codename:     montdor
Go version:   go1.13
Built:        2019-09-16T17:35:17Z
OS/Arch:      linux/amd64

In 1.7, I was allowed to combine the file and CLI configurations. I want to do this, so I can keep the majority of my configuration in a toml file, but dynamic configurations in the CLI. I cannot seem to do this with 2.0.

For example, my configuration file may look something like:

defaultEntryPoints = ["http","https"]

[providers.kubernetesCRD]

[file]
watch = true
filename = "/etc/traefik/traefik.toml"

[entryPoints]
    [entryPoints.http]
    address = ":80"
    [entryPoints.http.proxyProtocol]
        trustedIPs = ["10.10.0.0/16"]

    [entryPoints.https]
    address = ":443"
    [entryPoints.https.proxyProtocol]
        trustedIPs = ["10.10.0.0/16"]

And in my Traefik deployment, I would like to do this, so I can dynamically determine the host IP address to properly route Datadog metrics.

containers:
    - name: traefik
      image: traefik:v2.0
      args:
          - --metrics.datadog
          - --metrics.datadog.address=$(DOGSTATSD_HOST_IP):8125

However, the args in the deployment seem to be completely ignored. Or, vice versa, if I don't mount my volume that contains my toml file in the deployment, then the args are used.

Is the combination of both not yet allowed in 2.0?

Hello,

Yes, in v2, we chose to support only one static configuration source at the same time.

Also not you configuration is not v2 compliant, some elements are invalid.

args:
- --providers.kubernetesCRD=true
- --providers.file.watch=true
- --providers.file.filename="/etc/traefik/traefik.toml"
- --entryPoints.http.address=":80"
- --entryPoints.http.proxyProtocol.trustedIPs="10.10.0.0/16"
- --entryPoints.https.address = ":443"
- --entryPoints.https.proxyProtocol.trustedIPs="10.10.0.0/16"
- --metrics.datadog
- --metrics.datadog.address=$(DOGSTATSD_HOST_IP):8125

Thank you. I will submit an issue/PR to the docs to clarify.

Also, which elements are you stating are invalid?