HAProxy version 1.8.19-1
I have configured a backend with one server in it. When resolving of that server (nginx.default.svc.k8s.test.com) fails (according kubernetes service is deleted), the backend goes into L4-DOWN. So far so good.
But when the according kubernetes service is recreated, which means that the hostname is resolveable again, the backend goes into MAINT status and not UP.
If the backend server is resolveable again before the backend goes DOWN, it also comes back UP again, but if this takes longer, it just stays in MAINT.
I don’t understand this behavior. I want the backend server to be UP when it is resolved, regardless of how long it takes until its hostname is resolveable again. Is there a way to achieve this?
The following config parts are - in my opinion - enough for elaboration:
default-server init-addr libc,none resolvers dns
resolvers dns
nameserver dns01 10.254.205.31:53
nameserver dns02 10.254.205.32:53
resolve_retries 3
timeout retry 1s
hold valid 5s
backend test
mode http
option httpchk HEAD /
server testhost nginx.default.svc.k8s.test.com:80 check
Here are the logfiles showing the backend switching to MAINT:
Apr 30 14:19:46 load01 haproxy[26347]: Server test/testhost is DOWN, reason: Layer4 timeout, check duration: 2001ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Apr 30 14:19:46 load01 haproxy[26347]: Server test/testhost is DOWN, reason: Layer4 timeout, check duration: 2001ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Apr 30 14:19:46 load01 haproxy[26347]: backend test has no server available!
Apr 30 14:19:46 load01 haproxy[26347]: backend test has no server available!
Apr 30 14:20:04 load01 haproxy[26347]: Server test/testhost was DOWN and now enters maintenance (DNS NX status).
Apr 30 14:20:04 load01 haproxy[26347]: Server test/testhost was DOWN and now enters maintenance (DNS NX status).
edit: haproxy version added