Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4760

HAProxy won't connect resolving with Kubernetes DNS HAProxy 1.8.4

$
0
0

@mbaquer6 wrote:

Hi there!
I’ve been trying to configure HAProxy to balance a Redis cluster asking who is the master and connecting to it. When I use IP addresses, all works fine, but Kubernetes is very dynamic and I need to set it with DNS.
I tried using Kubernetes Service Discovery with a segmentation fault from HAProxy in response, here is the config:

global
log /dev/log daemon

defaults REDIS
mode tcp
timeout connect 3s
timeout server 6s
timeout client 6s

resolvers kube
nameserver dns1 100.64.0.10:53
resolve_retries 3
timeout resolve 1s
timeout retry 1s
hold valid 10s
hold obsolete 30s

frontend ft_redis
bind *:6378 name redis
default_backend bk_redis

backend bk_redis
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK

server-template redis-cluster- 0-5 _redis-cluster._TCP.redis-cluster.default.svc.cluster.local check inter 1s resolvers kube

and when trying using DNS, I got the message:

[WARNING] 045/173656 (19) : Server bk_redis/s0 is DOWN, reason: Layer4 connection problem, info: “Connection refused at step 1 of tcp-check (connect)”, check duration: 0ms. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 045/173657 (19) : Server bk_redis/s1 is DOWN, reason: Layer4 connection problem, info: “Connection refused at step 1 of tcp-check (connect)”, check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 045/173657 (19) : Server bk_redis/s2 is DOWN, reason: Layer4 connection problem, info: “Connection refused at step 1 of tcp-check (connect)”, check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.

Here is the backend config using DNS:
server s0 redis-cluster-0.redis-cluster:6379 resolvers kube check inter 1s resolve-prefer ipv4
server s1 redis-cluster-1.redis-cluster:6379 resolvers kube check inter 1s resolve-prefer ipv4
server s2 redis-cluster-2.redis-cluster:6379 resolvers kube check inter 1s resolve-prefer ipv4

I tried resolving these servers inside the HAProxy container and it does it fine.

Can you please give me a hand with this?

Thanks!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>