set haproxy balance algorithm to roundrobin for horizon

Currently kolla-ansible sets haproxy balance algorithm to source for
horizon. We can set it to round-robin if the cache backend is memcached
or using the database as the session storage backend. So we can
distribute http requests evenly to all available horizon instances.

Closes-Bug: #1990523
Change-Id: I0721cadcf53d59947bc0db6a193bfafe49c41ad3
This commit is contained in:
Serhat Rıfat Demircan 2022-09-22 15:36:58 +03:00
parent 1aac65de0c
commit 155ed969ae
2 changed files with 8 additions and 2 deletions

View File

@ -42,7 +42,7 @@ horizon_services:
frontend_http_extra:
- "use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }"
backend_http_extra:
- "balance source"
- "balance {{ 'roundrobin' if enable_memcached | bool or horizon_backend_database | bool else 'source' }}"
tls_backend: "{{ horizon_enable_tls_backend }}"
horizon_redirect:
enabled: "{{ enable_horizon | bool and kolla_enable_tls_internal | bool }}"
@ -59,7 +59,7 @@ horizon_services:
frontend_http_extra:
- "use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }"
backend_http_extra:
- "balance source"
- "balance {{ 'roundrobin' if enable_memcached | bool or horizon_backend_database | bool else 'source' }}"
tls_backend: "{{ horizon_enable_tls_backend }}"
horizon_external_redirect:
enabled: "{{ enable_horizon | bool and kolla_enable_tls_external | bool }}"

View File

@ -0,0 +1,6 @@
---
other:
- |
sets balancing algorithm to round-robin for horizon
if memcached is enabled
`LP#1990523 <https://launchpad.net/bugs/1990523>`__