Merge "health_manager: support more tunable parameters"

This commit is contained in:
Zuul 2021-11-12 10:21:40 +00:00 committed by Gerrit Code Review
commit c04af1ffc9
3 changed files with 50 additions and 5 deletions

View File

@ -21,13 +21,28 @@
# (optional) The bind ip for the health manager
# Defaults to $::os_service_default
#
# [*port*]
# (optional) The bind port for the health manager
# Defaults to $::os_service_default
#
# [*workers*]
# (optional) The number of workers health_manager spawns
# Defaults to $::os_workers
#
# [*port*]
# (optional) The bind port for the health manager
# Defaults to $::os_service_default
# [*failover_threads*]
# (optional) The number of threads performing amphora failovers.
#
# [*heartbeat_timeout*]
# (optional) Interval, in seconds, to wait before failing over an amphora.
# Defaults to $::os_service_default
#
# [*health_check_interval*]
# (optional) Sleep time between health checks in seconds.
# Defaults to $::os_service_default
#
# [*sock_rlimit*]
# (optional) Sets the value of the heartbeat recv buffer
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
@ -43,6 +58,10 @@ class octavia::health_manager (
$ip = $::os_service_default,
$port = $::os_service_default,
$workers = $::os_workers,
$failover_threads = $::os_service_default,
$heartbeat_timeout = $::os_service_default,
$health_check_interval = $::os_service_default,
$sock_rlimit = $::os_service_default,
# DEPRECATED PARAMETERS
$event_streamer_driver = undef,
@ -85,5 +104,9 @@ class octavia::health_manager (
'health_manager/bind_port' : value => $port;
'health_manager/health_update_threads' : value => $workers;
'health_manager/stats_update_threads' : value => $workers;
'health_manager/failover_threads' : value => $failover_threads;
'health_manager/heartbeat_timeout' : value => $heartbeat_timeout;
'health_manager/health_check_interval' : value => $health_check_interval;
'health_manager/sock_rlimit' : value => $sock_rlimit;
}
}

View File

@ -0,0 +1,10 @@
---
features:
- |
The following parameters have been added to the ``octavia::health_manager``
class.
- ``failover_threads``
- ``hearteat_timeout``
- ``health_check_interval``
- ``sock_rlimit``

View File

@ -35,6 +35,10 @@ describe 'octavia::health_manager' do
it { is_expected.to contain_octavia_config('health_manager/heartbeat_key').with_value('abcdefghi') }
it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value('2') }
it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value('2') }
it { is_expected.to contain_octavia_config('health_manager/failover_threads').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('health_manager/heartbeat_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('health_manager/sock_rlimit').with_value('<SERVICE DEFAULT>') }
end
it 'installs octavia-health-manager package' do
@ -95,11 +99,19 @@ describe 'octavia::health_manager' do
context 'configured with specific parameters' do
before do
params.merge!({
:workers => 8,
})
:workers => 8,
:failover_threads => 10,
:heartbeat_timeout => 60,
:health_check_interval => 3,
:sock_rlimit => 1,
})
end
it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value(8) }
it { is_expected.to contain_octavia_config('health_manager/stats_update_threads').with_value(8) }
it { is_expected.to contain_octavia_config('health_manager/failover_threads').with_value(10) }
it { is_expected.to contain_octavia_config('health_manager/heartbeat_timeout').with_value(60) }
it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value(3) }
it { is_expected.to contain_octavia_config('health_manager/sock_rlimit').with_value(1) }
end
end