View Traefik config for a deployed Traefik instance

I’ve been trying to troubleshoot issues related to configuration which took a long time as I couldn’t find an example config that Traefik uses when one deploys the kube controller.
What is the best way to pull and view traefik.toml from a deployed Traefik kube controller?

It depends on how you deployed traefik to kubetnetes. The documented ways as far as I can see do not use traefik.toml. If your installation uses it, you can pull in standard kubernetes way, depening on how it was deployed. (E.g if it’s config map with kubectl get configmap if it’s inside the container by kubectl exec into container, etc. )

I’m looking for a way to pull the config that Traefik instance built when it started. Even if I don’t supply any config, there should be some sort of default configuration that it uses. I’d like to pull that default configuration from a running Traefik instances that is agnostic to used provider (i.e. not specific to Kube, Swarm or else). Is there some /api endpoint that I can call to fetch current in-memory configuration from a running Traefik instance?

If you run traefik with log level of debug it will dump the configuration to the log on start up, however be aware of dynamic vs static config.

that’s useful, thanks!
though, next question is there a way to pull dynamic config at any given moment? it can be necessary when troubleshooting issues.

Well, there is api.

Hello @ivan, routing configurations may be viewed as sensitive data, and are not accessible by default. You can enable the api provider as @zespri mentioned, which will allow you access to the currently loaded configuration.

However, note that the API will show you the loaded configuration, not the file recieved, but I assume that is what you are looking to do (to test for file formatting issues).