Browse Source

Transitioning to HAProxy 1.8

Haproxy 1.8 brings in a specific change that breaks us:
It removes the haproxy-systemd-wrapper which
we use in order to be able to reload the config file without
restarting the whole container (important in TLS scenarios).

We fix this by calling the haproxy binary directly and
using the master-worker mode (-Ws) which allows to receive
a SIGUSR2 command which will then reload the config for
all the workers. It should also not background.

This commit keeps backward compatibility with current HAProxy
to ease the transition to new HAProxy.

Co-Authored-By: Damien Ciabrini <dciabrin@redhat.com>

Change-Id: I93943efefa22b9107c85f9f5e0bd4c3c1ab867ed
(cherry picked from commit e26ef65e50)
changes/02/736502/1
Michele Baldessari 1 year ago
parent
commit
2f3ffcc652
2 changed files with 8 additions and 2 deletions
  1. +4
    -1
      docker/services/haproxy.yaml
  2. +4
    -1
      docker/services/pacemaker/haproxy.yaml

+ 4
- 1
docker/services/haproxy.yaml View File

@@ -174,7 +174,10 @@ outputs:
- null
kolla_config:
/var/lib/kolla/config_files/haproxy.json:
command: /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg
# HAProxy 1.8 doesn't ship haproxy-systemd-wrapper, we have
# to use a new dedicated option for live config reload.
# Note: we can't use quotes in kolla command, hence the workaround
command: bash -c $* -- eval if [ -f /usr/sbin/haproxy-systemd-wrapper ]; then exec /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg; else exec /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -Ws; fi
config_files:
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"


+ 4
- 1
docker/services/pacemaker/haproxy.yaml View File

@@ -177,7 +177,10 @@ outputs:
data: *tls_mapping
kolla_config:
/var/lib/kolla/config_files/haproxy.json:
command: /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg
# HAProxy 1.8 doesn't ship haproxy-systemd-wrapper, we have
# to use a new dedicated option for live config reload.
# Note: we can't use quotes in kolla command, hence the workaround
command: bash -c $* -- eval if [ -f /usr/sbin/haproxy-systemd-wrapper ]; then exec /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg; else exec /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -Ws; fi
config_files:
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"


Loading…
Cancel
Save