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: Ie1f53d38c1c45ce3b2ddf5041eaa04a7f3139066
This commit is contained in:
parent
843fab27bd
commit
c29a1c7b8e
|
@ -22,6 +22,7 @@ from charmhelpers.contrib.openstack.context import (
|
||||||
from charmhelpers.contrib.hahelpers.cluster import (
|
from charmhelpers.contrib.hahelpers.cluster import (
|
||||||
determine_api_port,
|
determine_api_port,
|
||||||
determine_apache_port,
|
determine_apache_port,
|
||||||
|
https,
|
||||||
)
|
)
|
||||||
from charmhelpers.contrib.network.ip import (
|
from charmhelpers.contrib.network.ip import (
|
||||||
format_ipv6_addr,
|
format_ipv6_addr,
|
||||||
|
@ -54,8 +55,17 @@ class HAProxyContext(OSContextGenerator):
|
||||||
api_port = determine_apache_port(config('bind-port'),
|
api_port = determine_apache_port(config('bind-port'),
|
||||||
singlenode_mode=True)
|
singlenode_mode=True)
|
||||||
|
|
||||||
|
healthcheck = [{
|
||||||
|
'option': 'httpchk GET /healthcheck',
|
||||||
|
'http-check': 'expect status 200',
|
||||||
|
}]
|
||||||
|
|
||||||
|
backend_options = {'swift_api': healthcheck}
|
||||||
|
|
||||||
ctxt = {
|
ctxt = {
|
||||||
'service_ports': {'swift_api': [haproxy_port, api_port]},
|
'service_ports': {'swift_api': [haproxy_port, api_port]},
|
||||||
|
'backend_options': backend_options,
|
||||||
|
'https': https()
|
||||||
}
|
}
|
||||||
return ctxt
|
return ctxt
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ dev_bundles:
|
||||||
|
|
||||||
smoke_bundles:
|
smoke_bundles:
|
||||||
# Use no s3api test for smoke
|
# Use no s3api test for smoke
|
||||||
- focal-yoga
|
- jammy-yoga
|
||||||
|
|
||||||
configure:
|
configure:
|
||||||
- swift_gr_region1:
|
- swift_gr_region1:
|
||||||
|
|
Loading…
Reference in New Issue