Building Containers stops HAProxy to redirect correctly

Hi!!! :smiley:

It’s the first time writing onto this site.

I have an Openshift istance, and 2 namespaces:

First-layer
Second-layer

the “default” namespace is occupied by HAProxy.

I have configured HAProxy to balance and backup these two Flask Images i deployed over the first and second layer namespaces.

haproxy config file:


global
log stdout format raw local0
maxconn 1024

defaults
log global
timeout client 20s
timeout connect 20s
timeout server 10s

frontend fe_main
bind *:3000
default_backend be_main

backend be_main
server web1 flaskapp-flaskapp-chart.first-layer:8000 check resolvers dnsresolvers
server web2 flaskapp-flaskapp-chart.second-layer:8000 check backup resolvers dnsresolvers

resolvers dnsresolvers
nameserver dns1 dns-default.openshift-dns:53
nameserver dns2 10.217.4.10:53
resolve_retries 3
timeout retry 1s
hold nx 10s
hold valid 10s
resolve_retries 3
timeout resolve 1s
hold other 10s
hold refused 5s

This actually works very good with my structure!
But when i try to destroy and rebuild my pods HAProxy can’t take me to the Flask Application anymore…

I need to restart HAProxy pod and everything goes well. :slight_smile:

Is there something i forgot to use in the config file?
How can i make it find the new pod without having to restart the HAProxy Service?

Thanks!!! :smiley: