[horizon] Move 'balance' HAProxy keyword

The "balance" keyword is not valid in a frontend section. From the
HAProxy documentation[1]:

balance <algorithm> [ <arguments> ]
balance url_param <param> [check_post [<max_wait>]]
  Define the load balancing algorithm to be used in a backend.
  May be used in sections :   defaults | frontend | listen | backend
                                 yes   |    no    |   yes  |   yes

When running HAProxy using the "split" template style, where a
frontend/backend pair are used instead of one listen section, HAProxy
will emit warnings for the Horizon config due to this.

[1]: https://www.haproxy.org/download/1.5/doc/configuration.txt

Closes-Bug: #1872540
Change-Id: I91cee275d91a51944298618493f4ea0cd80282cc
This commit is contained in:
Jason Anderson 2020-04-13 15:06:00 -05:00 committed by Radosław Piliszek
parent 969159cc17
commit 5c760df3d5
2 changed files with 7 additions and 2 deletions

View File

@ -45,7 +45,7 @@ horizon_services:
external: false external: false
port: "{% if kolla_enable_tls_internal|bool %}443{% else %}{{ horizon_port }}{% endif %}" port: "{% if kolla_enable_tls_internal|bool %}443{% else %}{{ horizon_port }}{% endif %}"
listen_port: "{{ horizon_listen_port }}" listen_port: "{{ horizon_listen_port }}"
frontend_http_extra: backend_http_extra:
- "balance source" - "balance source"
horizon_redirect: horizon_redirect:
enabled: "{{ enable_horizon|bool and kolla_enable_tls_internal|bool }}" enabled: "{{ enable_horizon|bool and kolla_enable_tls_internal|bool }}"
@ -59,7 +59,7 @@ horizon_services:
external: true external: true
port: "{% if kolla_enable_tls_external|bool %}443{% else %}{{ horizon_port }}{% endif %}" port: "{% if kolla_enable_tls_external|bool %}443{% else %}{{ horizon_port }}{% endif %}"
listen_port: "{{ horizon_listen_port }}" listen_port: "{{ horizon_listen_port }}"
frontend_http_extra: backend_http_extra:
- "balance source" - "balance source"
horizon_external_redirect: horizon_external_redirect:
enabled: "{{ enable_horizon|bool and kolla_enable_tls_external|bool }}" enabled: "{{ enable_horizon|bool and kolla_enable_tls_external|bool }}"

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes source-IP-based load balancing for Horizon when using the
"split" HAProxy service template.