traefik version: 2.2.5
I am working in a managed cloud kubernetes cluster and i have setup consul:
Here are the 3 consul servers
hashicorp-consul-server-0 1/1 Running 0 30d 10.244.2.12
hashicorp-consul-server-1 1/1 Running 0 30d 10.244.1.13
hashicorp-consul-server-2 1/1 Running 0 30d 10.244.0.10
Here are the services for consul
NAME TYPE CLUSTER-IP PORT(S) AGE
hashicorp-consul-dns ClusterIP 10.96.112.126 53/TCP,53/UDP
hashicorp-consul-server ClusterIP None 8500/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP
hashicorp-consul-ui ClusterIP 10.96.199.36 80/TCP
On my traefik ingress controller, I have enabled these consul provider configurations as per traefik's consul documentation (https://docs.traefik.io/providers/consul-catalog/) :
- "--providers.consulcatalog=true"
- "--providers.consulcatalog.prefix=traefik"
- "--providers.consulcatalog.endpoint.address=http:// 127.0.0.1:8500"
When i deployed traefik and looked at the logs, I am getting
Get "http://127.0.0.1:8500/v1/catalog/services": dial tcp 127.0.0.1:8500: connect: connection refused" providerName=consulcatalog
Provider connection error Get "http://127.0.0.1:8500/v1/catalog/services": dial tcp 127.0.0.1:8500: connect: connection refused, retrying in 535.639805ms"
When i tried to connect to one of my servers like
- "--providers.consulcatalog.endpoint.address=http://10.244.2.12 :8500", it had no errors
Interestingly, when i tried http://hashicorp-consul-server:8500 and use a curl witihn one of consul server, the curl works, but when i used
- "--providers.consulcatalog.endpoint.address=http://hashicorp-consul-server:8500"
time="2020-08-07T19:45:23Z" level=error msg="error get consul catalog data, Get "http://hashicorp-consul-server:8500/v1/catalog/services": dial tcp: lookup hashicorp-consul-server on 10.96.5.5:53: no such host" providerName=consulcatalog
time="2020-08-07T19:45:23Z" level=error msg="Provider connection error Get "http://hashicorp-consul-server:8500/v1/catalog/services": dial tcp: lookup hashicorp-consul-server on 10.96.5.5:53: no su
ch host, retrying in 406.49185ms" providerName=consulcatalog
that 10.96.5.5:53 is from the kube dns.
Is there a way to use one ip address or domain which can route to all 3 consul servers?
Thank you. Hoping to hear an answer