Add support for HAProxy L7 checks

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

Added pip.sh to fix blessings dependency.

Closes-Bug: #1880610
Change-Id: Id42370fe07a2bcbcf28993d44f943d2b5c142107
This commit is contained in:
Gabriel Cocenza 2022-10-26 16:29:24 -03:00
parent 34311a62e9
commit b2d379e6d9
3 changed files with 36 additions and 1 deletions

View File

@ -95,6 +95,23 @@ options:
description: |
Connect timeout configuration in ms for haproxy, used in HA
configurations. If not provided, default value of 9000ms is used.
haproxy-check-http:
type: boolean
default: False
description: |
If True uses HTTP (Layer 7) checks for backends in haproxy, used in
haproxy-check-http-config.
haproxy-check-http-config:
type: string
default: |
option httpchk GET /healthcheck\nhttp-check expect status 200
description: |
Enables HTTP protocol to check on the servers health and consider 200
as response status code. This config can be changed accordingly with
the charm need. There are specific checks for ldap, psql, mysql and etc
that can be customized in this field.
NOTE: This config is used when haproxy-check-http is enabled.
See https://www.haproxy.com/documentation/hapee/latest/onepage/ for more details
dns-ha:
type: boolean
default: False

18
pip.sh Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
#
# This file is managed centrally by release-tools and should not be modified
# within individual charm repos. See the 'global' dir contents for available
# choices of tox.ini for OpenStack Charms:
# https://github.com/openstack-charmers/release-tools
#
# setuptools 58.0 dropped the support for use_2to3=true which is needed to
# install blessings (an indirect dependency of charm-tools).
#
# More details on the beahvior of tox and virtualenv creation can be found at
# https://github.com/tox-dev/tox/issues/448
#
# This script is wrapper to force the use of the pinned versions early in the
# process when the virtualenv was created and upgraded before installing the
# depedencies declared in the target.
pip install 'pip<20.3' 'setuptools<50.0.0'
pip "$@"

View File

@ -14,7 +14,7 @@ setenv = VIRTUAL_ENV={envdir}
JUJU_REPOSITORY={envdir}/tmp/build
passenv = http_proxy https_proxy
install_command =
pip install {opts} {packages}
{toxinidir}/pip.sh install {opts} {packages}
deps =
-r{toxinidir}/requirements.txt
whitelist_externals = /bin/true /bin/echo /bin/mkdir /bin/ln