From 2f3ffcc652c12b5c8b07b7c3e19fdd85be5c5fe9 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Thu, 4 Oct 2018 10:55:55 +0200 Subject: [PATCH] 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 Change-Id: I93943efefa22b9107c85f9f5e0bd4c3c1ab867ed (cherry picked from commit e26ef65e5093f4f342b888d51dee925605931909) --- docker/services/haproxy.yaml | 5 ++++- docker/services/pacemaker/haproxy.yaml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/services/haproxy.yaml b/docker/services/haproxy.yaml index eb79632c06..c7faf7b25c 100644 --- a/docker/services/haproxy.yaml +++ b/docker/services/haproxy.yaml @@ -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: "/" diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml index 38c92e263e..b1d793db10 100644 --- a/docker/services/pacemaker/haproxy.yaml +++ b/docker/services/pacemaker/haproxy.yaml @@ -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: "/"