From 501e54596ea1e694bd0aa1a98b12b157fb53d229 Mon Sep 17 00:00:00 2001 From: Gregory Thiemonge Date: Thu, 15 Sep 2022 17:09:57 +0200 Subject: [PATCH] Add health_manager::failover_threshold parameter This parameter was added in Zed as part of the Failover stop threshold feature [0] [0] https://review.opendev.org/c/openstack/octavia/+/656811 Change-Id: I637e89a794203c393c50728b42666a0d2a104849 --- manifests/health_manager.pp | 7 +++++++ .../notes/add_failover_threshold-913a4325e540f897.yaml | 5 +++++ spec/classes/octavia_health_manager_spec.rb | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/add_failover_threshold-913a4325e540f897.yaml diff --git a/manifests/health_manager.pp b/manifests/health_manager.pp index 96de65ee..40772644 100644 --- a/manifests/health_manager.pp +++ b/manifests/health_manager.pp @@ -46,6 +46,11 @@ # (optional) Sets the value of the heartbeat recv buffer # Defaults to $::os_service_default # +# [*failover_threshold*] +# (optional) Stop failovers if the count of simultaneously failed amphora +# reaches this number. +# Defaults to $::os_service_default +# # DEPRECATED PARAMETERS # # [*workers*] @@ -72,6 +77,7 @@ class octavia::health_manager ( $heartbeat_timeout = $::os_service_default, $health_check_interval = $::os_service_default, $sock_rlimit = $::os_service_default, + $failover_threshold = $::os_service_default, # DEPRECATED PARAMETERS $workers = undef, $heartbeat_key = undef, @@ -128,6 +134,7 @@ Use health_update_threads and stats_update_threads instead') 'health_manager/heartbeat_timeout' : value => $heartbeat_timeout; 'health_manager/health_check_interval' : value => $health_check_interval; 'health_manager/sock_rlimit' : value => $sock_rlimit; + 'health_manager/failover_threshold' : value => $failover_threshold; } if $::octavia::controller::heartbeat_key == undef { diff --git a/releasenotes/notes/add_failover_threshold-913a4325e540f897.yaml b/releasenotes/notes/add_failover_threshold-913a4325e540f897.yaml new file mode 100644 index 00000000..acde0082 --- /dev/null +++ b/releasenotes/notes/add_failover_threshold-913a4325e540f897.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add new parameter ``failover_threshold`` to the ``octavia::health_manager`` + class. diff --git a/spec/classes/octavia_health_manager_spec.rb b/spec/classes/octavia_health_manager_spec.rb index 2c519616..673a7ac3 100644 --- a/spec/classes/octavia_health_manager_spec.rb +++ b/spec/classes/octavia_health_manager_spec.rb @@ -40,6 +40,7 @@ describe 'octavia::health_manager' do it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value('') } it { is_expected.to contain_octavia_config('health_manager/heartbeat_interval').with_value('') } it { is_expected.to contain_octavia_config('health_manager/sock_rlimit').with_value('') } + it { is_expected.to contain_octavia_config('health_manager/failover_threshold').with_value('') } end it 'installs octavia-health-manager package' do @@ -107,6 +108,7 @@ describe 'octavia::health_manager' do :health_check_interval => 3, :heartbeat_interval => 42, :sock_rlimit => 1, + :failover_threshold => 2, }) end it { is_expected.to contain_octavia_config('health_manager/health_update_threads').with_value(8) } @@ -116,6 +118,7 @@ describe 'octavia::health_manager' do it { is_expected.to contain_octavia_config('health_manager/health_check_interval').with_value(3) } it { is_expected.to contain_octavia_config('health_manager/heartbeat_interval').with_value(42) } it { is_expected.to contain_octavia_config('health_manager/sock_rlimit').with_value(1) } + it { is_expected.to contain_octavia_config('health_manager/failover_threshold').with_value(2) } end end