Are there any health checks for tcp or udp?
I have not founded on the documentation only for http.
Is this a new feature request, no one has posted this before, as I searched in 3 pages on web searches and this forum and got nothing.
Hi @ricardo-rod
There does not appear to be any. A quick file provider test shows the router will Round Robin around all defined addresses in the service.
Using a different provider like docker you could expect the container healthcheck to remove a backend from the service.
You already found the github issue but linking it here for any other searchers.
opened 01:01PM - 08 Oct 19 UTC
area/healthcheck
area/tcp
kind/enhancement
priority/P2
Traefik forward connections even if there is no open TCP port.
In general there… are a lot of cases when you may export more then one TCP port from single container or when container is up but specific port is still (or already) unavailable.
### What did you expect to see?
Some kind of TCP health check or `traefik.tcp.middlewares.test-retry.retry.attempts` or anything other that will provide more reliable service.
### What did you see instead?
A lot of errors...
### Output of `traefik version`: (_What version of Traefik are you using?_)
```
traefik version
Version: 2.0.1
Codename: montdor
Go version: go1.13.1
Built: 2019-09-26T16:18:03Z
OS/Arch: linux/amd64
```
### What is your environment & configuration (arguments, toml, provider, platform, ...)?
docker-compose.yml with 1 load balancer and 3 nodes.
Configuration of nodes is absolutely the same except name.
```
version: '3.0' services:
lb:
hostname: lb
image: traefik:latest
command:
- --api.insecure=true
- --providers.docker
- --entryPoints.http.address=:80
- --entryPoints.kubeapi.address=:6443
- --log.level=DEBUG
ports:
- "6443:6443"
- "8080:8080"
- "80:80"
labels:
- "traefik.enable=false"
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
node1:
build:
context: ./config
hostname: node1
image: kube
labels:
- traefik.tcp.routers.kube-apiserver.entrypoints=kubeapi
- traefik.tcp.routers.kube-apiserver.rule=HostSNI(`*`)
- traefik.tcp.routers.kube-apiserver.service=kube-apiserver
- traefik.tcp.routers.kube-apiserver.tls.passthrough=true
- traefik.tcp.services.kube-apiserver.loadbalancer.server.port=6443
privileged: true
tty: true
restart: always
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- ./config:/config
node2:
...
```
No other configurations.
### If applicable, please paste the log output in DEBUG level (`--log.level=DEBUG` switch)
```
lb_1 | time="2019-10-08T12:25:36Z" level=debug msg="Handling connection from 172.25.0.4:54836"
lb_1 | time="2019-10-08T12:25:36Z" level=error msg="Error while connection to backend: dial tcp 172.25.0.3:6443: connect: connection refused"
lb_1 | time="2019-10-08T12:25:36Z" level=debug msg="Handling connection from 172.25.0.4:54846"
lb_1 | time="2019-10-08T12:25:36Z" level=error msg="Error while connection to backend: dial tcp 172.25.0.5:6443: connect: connection refused"
lb_1 | time="2019-10-08T12:25:36Z" level=debug msg="Handling connection from 172.25.0.4:54850"
lb_1 | time="2019-10-08T12:25:36Z" level=debug msg="Error while terminating connection: close tcp 172.25.0.2:6443->172.25.0.4:54850: shutdown:
transport endpoint is not connected"
```