Add support for connection retry variables

Adds support for connection_max_retries and connection_retry_interval
configuration.

Change-Id: I8be48a7bd07e0a00972b4bef268c4bd2badc6711
Closes-Bug: #1838410
This commit is contained in:
Brent Eagles 2019-07-30 09:04:02 -04:00
parent 9e62de27cd
commit 36ca9c36cb
3 changed files with 58 additions and 35 deletions

View File

@ -70,6 +70,14 @@
# when it connects back to the controllers to report its health.
# Defaults to $::os_service_default
#
# [*connection_max_retries*]
# (optional) Maximum number of retries when contacting amphora.
# Defaults to $::os_service_default
#
# [*connection_retry_interval*]
# (optional) Number of seconds to wait between connection attempts to amphora.
# Defaults to $::os_service_default
#
class octavia::controller (
$amp_flavor_id = '65',
$amp_image_tag = $::os_service_default,
@ -86,6 +94,8 @@ class octavia::controller (
$timeout_member_data = $::os_service_default,
$timeout_tcp_inspect = $::os_service_default,
$controller_ip_port_list = $::os_service_default,
$connection_max_retries = $::os_service_default,
$connection_retry_interval = $::os_service_default,
) inherits octavia::params {
include ::octavia::deps
@ -133,5 +143,7 @@ class octavia::controller (
'haproxy_amphora/timeout_member_data' : value => $timeout_member_data_real;
'haproxy_amphora/timeout_tcp_inspect' : value => $timeout_tcp_inspect_real;
'health_manager/controller_ip_port_list' : value => $controller_ip_port_list;
'haproxy_amphora/connection_max_retries' : value => $connection_max_retries;
'haproxy_amphora/connection_retry_interval' : value => $connection_retry_interval;
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds connection_max_retries and connection_retry_interval to control retry
behavior when the contacting the amphora.

View File

@ -20,6 +20,8 @@ describe 'octavia::controller' do
:loadbalancer_topology => 'SINGLE',
:amp_ssh_key_name => 'custom-amphora-key',
:controller_ip_port_list => '1.2.3.4:5555,4.3.2.1:5555',
:connection_max_retries => 240,
:connection_retry_interval => 10
}
end
@ -30,6 +32,8 @@ describe 'octavia::controller' do
it { is_expected.to contain_octavia_config('controller_worker/loadbalancer_topology').with_value('SINGLE') }
it { is_expected.to contain_octavia_config('controller_worker/amp_ssh_key_name').with_value('custom-amphora-key') }
it { is_expected.to contain_octavia_config('health_manager/controller_ip_port_list').with_value('1.2.3.4:5555,4.3.2.1:5555') }
it { is_expected.to contain_octavia_config('haproxy_amphora/connection_max_retries').with_value(240) }
it { is_expected.to contain_octavia_config('haproxy_amphora/connection_retry_interval').with_value(10) }
end
it 'configures worker parameters' do
@ -42,6 +46,8 @@ describe 'octavia::controller' do
is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_connect').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/timeout_member_data').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/timeout_tcp_inspect').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/connection_max_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/connection_retry_interval').with_value('<SERVICE DEFAULT>')
end
context 'with ssh key access disabled' do