Add support for more connection tunables in [haprpoxy_amphora]

This change adds support for the following tunable parameters in
the haproxy_amphora section.

 - active_connection_max_retries
 - active_connection_retry_interval
 - faiolver_connection_max_retries
 - faiolver_connection_retry_interval

Change-Id: I6a2686a4e33c75d863ae146a3af37d416e01a655
This commit is contained in:
Takashi Kajinami 2022-01-10 16:58:11 +09:00
parent ccf6792238
commit ca3c4cc1c1
3 changed files with 163 additions and 115 deletions

View File

@ -100,6 +100,24 @@
# (optional) Number of seconds to wait between connection attempts to amphora.
# Defaults to $::os_service_default
#
# [*active_connection_max_retries*]
# (optional) Retry threshold for connecting to active amphorae.
# Defaults to $::os_service_default
#
# [*active_connection_retry_interval*]
# (optional) Retry timeout between connection attempts in seconds for active
# amphora.
# Defaults to $::os_service_default
#
# [*failover_connection_max_retries*]
# (optional) Retry threshold for connecting to an amphora in failover.
# Defaults to $::os_service_default
#
# [*failover_connection_retry_interval*]
# (optional) Retry timeout between connection attempts in seconds for amphora
# in failover.
# Defaults to $::os_service_default
#
# [*connection_logging*]
# (optional) When false, disables logging of tenant connection flows. This
# includes storing them locally and sending them to the tenant syslog
@ -185,47 +203,51 @@
# Defaults to undef
#
class octavia::controller (
$amp_active_retries = $::os_service_default,
$amp_active_wait_sec = $::os_service_default,
$amp_flavor_id = '65',
$amp_image_tag = $::os_service_default,
$amp_image_owner_id = $::os_service_default,
$amp_secgroup_list = $::os_service_default,
$amp_boot_network_list = $::os_service_default,
$loadbalancer_topology = $::os_service_default,
$amphora_driver = $::os_service_default,
$compute_driver = $::os_service_default,
$network_driver = $::os_service_default,
$volume_driver = $::os_service_default,
$image_driver = $::os_service_default,
$enable_ssh_access = true,
$amp_ssh_key_name = 'octavia-ssh-key',
$timeout_client_data = $::os_service_default,
$timeout_member_connect = $::os_service_default,
$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,
$connection_logging = $::os_service_default,
$build_rate_limit = $::os_service_default,
$build_active_retries = $::os_service_default,
$build_retry_interval = $::os_service_default,
$admin_log_targets = $::os_service_default,
$administrative_log_facility = $::os_service_default,
$forward_all_logs = $::os_service_default,
$tenant_log_targets = $::os_service_default,
$user_log_facility = $::os_service_default,
$user_log_format = $::os_service_default,
$disable_local_log_storage = $::os_service_default,
$vrrp_advert_int = $::os_service_default,
$vrrp_check_interval = $::os_service_default,
$vrrp_fail_count = $::os_service_default,
$vrrp_success_count = $::os_service_default,
$vrrp_garp_refresh_interval = $::os_service_default,
$vrrp_garp_refresh_count = $::os_service_default,
$amp_active_retries = $::os_service_default,
$amp_active_wait_sec = $::os_service_default,
$amp_flavor_id = '65',
$amp_image_tag = $::os_service_default,
$amp_image_owner_id = $::os_service_default,
$amp_secgroup_list = $::os_service_default,
$amp_boot_network_list = $::os_service_default,
$loadbalancer_topology = $::os_service_default,
$amphora_driver = $::os_service_default,
$compute_driver = $::os_service_default,
$network_driver = $::os_service_default,
$volume_driver = $::os_service_default,
$image_driver = $::os_service_default,
$enable_ssh_access = true,
$amp_ssh_key_name = 'octavia-ssh-key',
$timeout_client_data = $::os_service_default,
$timeout_member_connect = $::os_service_default,
$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,
$connection_logging = $::os_service_default,
$active_connection_max_retries = $::os_service_default,
$active_connection_retry_interval = $::os_service_default,
$failover_connection_max_retries = $::os_service_default,
$failover_connection_retry_interval = $::os_service_default,
$build_rate_limit = $::os_service_default,
$build_active_retries = $::os_service_default,
$build_retry_interval = $::os_service_default,
$admin_log_targets = $::os_service_default,
$administrative_log_facility = $::os_service_default,
$forward_all_logs = $::os_service_default,
$tenant_log_targets = $::os_service_default,
$user_log_facility = $::os_service_default,
$user_log_format = $::os_service_default,
$disable_local_log_storage = $::os_service_default,
$vrrp_advert_int = $::os_service_default,
$vrrp_check_interval = $::os_service_default,
$vrrp_fail_count = $::os_service_default,
$vrrp_success_count = $::os_service_default,
$vrrp_garp_refresh_interval = $::os_service_default,
$vrrp_garp_refresh_count = $::os_service_default,
# DEPRECATED PARAMETERS
$port_detach_timeout = undef,
$port_detach_timeout = undef,
) inherits octavia::params {
include octavia::deps
@ -250,42 +272,46 @@ Use the octavia::networking class instead')
}
octavia_config {
'controller_worker/amp_active_retries' : value => $amp_active_retries;
'controller_worker/amp_active_wait_sec' : value => $amp_active_wait_sec;
'controller_worker/amp_flavor_id' : value => $amp_flavor_id;
'controller_worker/amp_image_tag' : value => $amp_image_tag;
'controller_worker/amp_image_owner_id' : value => $amp_image_owner_id;
'controller_worker/amp_secgroup_list' : value => join(any2array($amp_secgroup_list), ',');
'controller_worker/amp_boot_network_list' : value => join(any2array($amp_boot_network_list), ',');
'controller_worker/loadbalancer_topology' : value => $loadbalancer_topology;
'controller_worker/amphora_driver' : value => $amphora_driver;
'controller_worker/compute_driver' : value => $compute_driver;
'controller_worker/network_driver' : value => $network_driver;
'controller_worker/volume_driver' : value => $volume_driver;
'controller_worker/image_driver' : value => $image_driver;
'haproxy_amphora/timeout_client_data' : value => $timeout_client_data;
'haproxy_amphora/timeout_member_connect' : value => $timeout_member_connect;
'haproxy_amphora/timeout_member_data' : value => $timeout_member_data;
'haproxy_amphora/timeout_tcp_inspect' : value => $timeout_tcp_inspect;
'health_manager/controller_ip_port_list' : value => join(any2array($controller_ip_port_list), ',');
'haproxy_amphora/connection_max_retries' : value => $connection_max_retries;
'haproxy_amphora/connection_retry_interval' : value => $connection_retry_interval;
'haproxy_amphora/connection_logging' : value => $connection_logging;
'haproxy_amphora/build_rate_limit' : value => $build_rate_limit;
'haproxy_amphora/build_active_retries' : value => $build_active_retries;
'haproxy_amphora/build_retry_interval' : value => $build_retry_interval;
'amphora_agent/admin_log_targets' : value => join(any2array($admin_log_targets), ',');
'amphora_agent/administrative_log_facility' : value => $administrative_log_facility;
'amphora_agent/forward_all_logs' : value => $forward_all_logs;
'amphora_agent/tenant_log_targets' : value => join(any2array($tenant_log_targets), ',');
'amphora_agent/user_log_facility' : value => $user_log_facility;
'haproxy_amphora/user_log_format' : value => $user_log_format;
'amphora_agent/disable_local_log_storage' : value => $disable_local_log_storage;
'keepalived_vrrp/vrrp_advert_int' : value => $vrrp_advert_int;
'keepalived_vrrp/vrrp_check_interval' : value => $vrrp_check_interval;
'keepalived_vrrp/vrrp_fail_count' : value => $vrrp_fail_count;
'keepalived_vrrp/vrrp_success_count' : value => $vrrp_success_count;
'keepalived_vrrp/vrrp_garp_refresh_interval' : value => $vrrp_garp_refresh_interval;
'keepalived_vrrp/vrrp_garp_refresh_count' : value => $vrrp_garp_refresh_count;
'controller_worker/amp_active_retries' : value => $amp_active_retries;
'controller_worker/amp_active_wait_sec' : value => $amp_active_wait_sec;
'controller_worker/amp_flavor_id' : value => $amp_flavor_id;
'controller_worker/amp_image_tag' : value => $amp_image_tag;
'controller_worker/amp_image_owner_id' : value => $amp_image_owner_id;
'controller_worker/amp_secgroup_list' : value => join(any2array($amp_secgroup_list), ',');
'controller_worker/amp_boot_network_list' : value => join(any2array($amp_boot_network_list), ',');
'controller_worker/loadbalancer_topology' : value => $loadbalancer_topology;
'controller_worker/amphora_driver' : value => $amphora_driver;
'controller_worker/compute_driver' : value => $compute_driver;
'controller_worker/network_driver' : value => $network_driver;
'controller_worker/volume_driver' : value => $volume_driver;
'controller_worker/image_driver' : value => $image_driver;
'haproxy_amphora/timeout_client_data' : value => $timeout_client_data;
'haproxy_amphora/timeout_member_connect' : value => $timeout_member_connect;
'haproxy_amphora/timeout_member_data' : value => $timeout_member_data;
'haproxy_amphora/timeout_tcp_inspect' : value => $timeout_tcp_inspect;
'health_manager/controller_ip_port_list' : value => join(any2array($controller_ip_port_list), ',');
'haproxy_amphora/connection_max_retries' : value => $connection_max_retries;
'haproxy_amphora/connection_retry_interval' : value => $connection_retry_interval;
'haproxy_amphora/connection_logging' : value => $connection_logging;
'haproxy_amphora/active_connection_max_retries' : value => $active_connection_max_retries;
'haproxy_amphora/active_connection_retry_interval' : value => $active_connection_retry_interval;
'haproxy_amphora/failover_connection_max_retries' : value => $failover_connection_max_retries;
'haproxy_amphora/failover_connection_retry_interval' : value => $failover_connection_retry_interval;
'haproxy_amphora/build_rate_limit' : value => $build_rate_limit;
'haproxy_amphora/build_active_retries' : value => $build_active_retries;
'haproxy_amphora/build_retry_interval' : value => $build_retry_interval;
'amphora_agent/admin_log_targets' : value => join(any2array($admin_log_targets), ',');
'amphora_agent/administrative_log_facility' : value => $administrative_log_facility;
'amphora_agent/forward_all_logs' : value => $forward_all_logs;
'amphora_agent/tenant_log_targets' : value => join(any2array($tenant_log_targets), ',');
'amphora_agent/user_log_facility' : value => $user_log_facility;
'haproxy_amphora/user_log_format' : value => $user_log_format;
'amphora_agent/disable_local_log_storage' : value => $disable_local_log_storage;
'keepalived_vrrp/vrrp_advert_int' : value => $vrrp_advert_int;
'keepalived_vrrp/vrrp_check_interval' : value => $vrrp_check_interval;
'keepalived_vrrp/vrrp_fail_count' : value => $vrrp_fail_count;
'keepalived_vrrp/vrrp_success_count' : value => $vrrp_success_count;
'keepalived_vrrp/vrrp_garp_refresh_interval' : value => $vrrp_garp_refresh_interval;
'keepalived_vrrp/vrrp_garp_refresh_count' : value => $vrrp_garp_refresh_count;
}
}

View File

@ -0,0 +1,10 @@
---
features:
- |
The following parameters have been added to the ``octavia::controller``
class.
- ``active_connection_max_retries``
- ``active_connection_retry_interval``
- ``failover_connection_max_retries``
- ``failover_connection_retry_interval``

View File

@ -13,44 +13,48 @@ describe 'octavia::controller' do
context 'configured with specific parameters' do
let :params do
{ :amp_active_retries => '30',
:amp_active_wait_sec => '10',
:amp_flavor_id => '42',
:amp_image_tag => 'amphorae1',
:amp_image_owner_id => 'customowner',
:amp_secgroup_list => ['lb-mgmt-sec-grp'],
:amp_boot_network_list => ['lbnet1', 'lbnet2'],
:loadbalancer_topology => 'SINGLE',
:amphora_driver => 'sample_amphora_driver',
:compute_driver => 'sample_compute_driver',
:network_driver => 'sample_network_driver',
:volume_driver => 'sample_volume_driver',
:image_driver => 'sample_image_driver',
:amp_ssh_key_name => 'custom-amphora-key',
:timeout_client_data => 60,
:timeout_member_connect => 5,
:timeout_member_data => 60,
:controller_ip_port_list => ['1.2.3.4:5555', '4.3.2.1:5555'],
:connection_max_retries => 240,
:connection_retry_interval => 10,
:connection_logging => false,
:build_rate_limit => 10,
:build_active_retries => 120,
:build_retry_interval => 5,
:port_detach_timeout => 15,
:admin_log_targets => ['192.0.2.1:10514', '2001:db8:1::10:10514'],
:administrative_log_facility => 2,
:forward_all_logs => true,
:tenant_log_targets => ['192.0.2.1:10514', '2001:db8:1::10:10514'],
:user_log_facility => 3,
:user_log_format => '{{ project_id }} {{ lb_id }}',
:disable_local_log_storage => true,
:vrrp_advert_int => 1,
:vrrp_check_interval => 5,
:vrrp_fail_count => 2,
:vrrp_success_count => 2,
:vrrp_garp_refresh_interval => 5,
:vrrp_garp_refresh_count => 2
{ :amp_active_retries => '30',
:amp_active_wait_sec => '10',
:amp_flavor_id => '42',
:amp_image_tag => 'amphorae1',
:amp_image_owner_id => 'customowner',
:amp_secgroup_list => ['lb-mgmt-sec-grp'],
:amp_boot_network_list => ['lbnet1', 'lbnet2'],
:loadbalancer_topology => 'SINGLE',
:amphora_driver => 'sample_amphora_driver',
:compute_driver => 'sample_compute_driver',
:network_driver => 'sample_network_driver',
:volume_driver => 'sample_volume_driver',
:image_driver => 'sample_image_driver',
:amp_ssh_key_name => 'custom-amphora-key',
:timeout_client_data => 60,
:timeout_member_connect => 5,
:timeout_member_data => 60,
:controller_ip_port_list => ['1.2.3.4:5555', '4.3.2.1:5555'],
:connection_max_retries => 240,
:connection_retry_interval => 10,
:active_connection_max_retries => 15,
:active_connection_retry_interval => 2,
:failover_connection_max_retries => 2,
:failover_connection_retry_interval => 5,
:connection_logging => false,
:build_rate_limit => 10,
:build_active_retries => 120,
:build_retry_interval => 5,
:port_detach_timeout => 15,
:admin_log_targets => ['192.0.2.1:10514', '2001:db8:1::10:10514'],
:administrative_log_facility => 2,
:forward_all_logs => true,
:tenant_log_targets => ['192.0.2.1:10514', '2001:db8:1::10:10514'],
:user_log_facility => 3,
:user_log_format => '{{ project_id }} {{ lb_id }}',
:disable_local_log_storage => true,
:vrrp_advert_int => 1,
:vrrp_check_interval => 5,
:vrrp_fail_count => 2,
:vrrp_success_count => 2,
:vrrp_garp_refresh_interval => 5,
:vrrp_garp_refresh_count => 2
}
end
@ -76,6 +80,10 @@ describe 'octavia::controller' do
is_expected.to contain_octavia_config('haproxy_amphora/connection_max_retries').with_value(240)
is_expected.to contain_octavia_config('haproxy_amphora/connection_retry_interval').with_value(10)
is_expected.to contain_octavia_config('haproxy_amphora/connection_logging').with_value(false)
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_max_retries').with_value(15)
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_retry_interval').with_value(2)
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_max_retries').with_value(2)
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_retry_interval').with_value(5)
is_expected.to contain_octavia_config('haproxy_amphora/build_rate_limit').with_value(10)
is_expected.to contain_octavia_config('haproxy_amphora/build_active_retries').with_value(120)
is_expected.to contain_octavia_config('haproxy_amphora/build_retry_interval').with_value(5)
@ -119,6 +127,10 @@ describe 'octavia::controller' do
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>')
is_expected.to contain_octavia_config('haproxy_amphora/connection_logging').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_max_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/active_connection_retry_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_max_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/failover_connection_retry_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/build_rate_limit').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/build_active_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('haproxy_amphora/build_retry_interval').with_value('<SERVICE DEFAULT>')