I want to use træfik outside the docker host, so I use
#endpoint: "unix:///var/run/docker.sock" # Listen to the UNIX Docker socket
endpoint: "tcp://192.168.77.14:2377" # Listen to docker vm
exposedByDefault: false # Only expose container that are explicitly enabled (using label traefik.enabled)
network: "dmz-net" # Default network to use for connections to all containers.
swarmmode: true # Activates the Swarm Mode (instead of standalone Docker).
swarmModeRefreshSeconds: 15 # Defines the polling interval (in seconds) in Swarm Mode.
watch: true # Watch Docker Swarm events
in the traefik log file:
time="2022-08-07T13:32:51Z" level=error msg="Failed to retrieve information of the docker client and server host: error during connect: Get \"http://192.168.77.14:2377/v1.24/version\": EOF" providerName=docker
time="2022-08-07T13:32:51Z" level=error msg="Provider connection error error during connect: Get \"http://192.168.77.14:2377/v1.24/version\": EOF, retrying in 8.918774665s" providerName=docker
It is possible to open tcp connection with telnet 192.168.77.14 2377
Why is there http in the log, but I had use tcp:// in the configuration ?
Thank you 4 helping a træfik beginner ...
inside a container ?
If you're running traefik on the same host as a manager then you usually need to use the ip of the docker0 interface.
I'm using proxmox. Docker is running as a kvm VM. Traefik is running as lxc in Proxmox. Also some other lxc, which I now using together with traefik as "webrouter".
May be I have to install the docker client or have traefik really implemented its own docker client inside?
Technically if the lxc container can reach the ip:port then it should be able to connect, I don't thing that will help you much though as using the docker provider traefik is expected to be running in the docker environment.
When traefik detects routers and services from the container/service labels traefik will try and connect to the container ip on the docker network(s).
If you want traefik external to the docker environment then you would configure a service that has the endpoint as the ip of the docker VM. You can use a different provider to define these routers/services. e.g. file, key/value.
is it possible to use traefik as provider.
I don't want to config all domains in the first traefik a second time, so the traefik into the docker node should be used as provider, isn't it?
I am currently in planning of doing a similar thing. Have you been able to run your traefik outside the docker host? Can you show me your traefik configuration?
In the moment I just using the file-provider.
I will test a ssh tunnel in the future, but this will be only a workaround.