Add support for HAProxy L7 checks

This change add several configuration options to enable HTTP checks
to the HAProxy configuration, instead of the default TCP connection
checks.

Closes-Bug: #1880610
Change-Id: I4a947c5b52eb3283c08a0d39cc9bf14695a63eab
This commit is contained in:
Gabriel Cocenza 2023-02-23 21:17:56 -03:00
parent 83b866eaac
commit 468d648655
2 changed files with 13 additions and 1 deletions

View File

@ -239,10 +239,22 @@ class HAProxyContext(ch_context.HAProxyContext):
del listen_ports['placement_listen_port']
del port_mapping['nova-placement-api']
healthcheck = [{
'option': 'httpchk GET /',
'http-check': 'expect status 200',
}]
backend_options = {
'nova-api-os-compute': healthcheck,
'nova-api-metadata': healthcheck,
}
# for haproxy.conf
ctxt['service_ports'] = port_mapping
# for nova.conf
ctxt['listen_ports'] = listen_ports
ctxt['backend_options'] = backend_options
ctxt['https'] = ch_cluster.https()
return ctxt

View File

@ -25,7 +25,7 @@ setenv = VIRTUAL_ENV={envdir}
commands = stestr run --slowest {posargs}
allowlist_externals =
charmcraft
rename.sh
{toxinidir}/rename.sh
passenv =
HOME
TERM