Hello! I am trying to set up a healthcheck for cli (traefik healthcheck) but it fails for some reason with 404 error. I have the following global config:
I am running latest traefik:montdor (2.0.5) in docker with bind-mounted file config and no arguments.
Now, when I get into container with docker exec and try probe the health with
traefik healthcheck
I get this:
INFO[0000] Configuration loaded from file: /etc/traefik/traefik.toml
Bad healthcheck status: 404 Not Found
Of course I can manually wget localhost:8082/ping and it returns my 200 code, but why the cli command is failing? Am I doing something wrong?
@jpd what confuses me about traefik healthcheck is that it seems that it only works if you give the same configuration to the traefik you are checking and the traefik you are checking the first traefik with. So if your traefik instance runs with, say command line paramters that were supplied in docker-compose, you will need the same parameter with healthcheck? At this point curl works as well...
Thank you. Not directly related and very minor: the docs for healthcheck say healthcheck [command] but there is no commands healthcheck accepts, at least nothing obvious.
Oh, thank you! One more thing. I'm not sure I am getting this "dynamic/static" correctly. Am I right if I say that traefik.toml palced in /etc/traefik and loaded on traefik loading (with entrypoints and some basic config) is static and pluggable file (like dynamic.toml in my config above) is dynamic? So I should move all the [tls.options] block to that dynamic.toml file?
Yes, the traefik.toml will be used as default configuration and contains the static configuration. It will be loaded once at startup. And yes, you have to move the tls.options configuration to your dynamic.toml file or to any configuration file that is watched by the File Provider.
You can find more details in the documentation.