From 5e7845e20f6b9bb25692bf27502fc7a9ea608908 Mon Sep 17 00:00:00 2001 From: Joe Talerico Date: Thu, 20 Dec 2018 12:54:58 -0500 Subject: [PATCH] heatlh_manager default to os_workers health_manager has switched from spawning threads to processes. We should have it follow the os_worker calculation. Change-Id: I3abab863b210dcc6a75b70f9c14edb17e1713a97 --- manifests/health_manager.pp | 7 +++++++ ...ealth_manager-worker-default-6259b601e01db4f3.yaml | 4 ++++ spec/classes/octavia_health_manager_spec.rb | 11 +++++++++++ 3 files changed, 22 insertions(+) create mode 100644 releasenotes/notes/add-health_manager-worker-default-6259b601e01db4f3.yaml diff --git a/manifests/health_manager.pp b/manifests/health_manager.pp index 85b419fa..4cfa2620 100644 --- a/manifests/health_manager.pp +++ b/manifests/health_manager.pp @@ -25,6 +25,10 @@ # (optional) The bind ip 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 @@ -37,6 +41,7 @@ class octavia::health_manager ( $event_streamer_driver = $::os_service_default, $ip = $::os_service_default, $port = $::os_service_default, + $workers = $::os_workers, ) inherits octavia::params { include ::octavia::deps @@ -71,5 +76,7 @@ class octavia::health_manager ( 'health_manager/event_streamer_driver' : value => $event_streamer_driver; 'health_manager/bind_ip' : value => $ip; 'health_manager/bind_port' : value => $port; + 'health_manager/health_update_threads' : value => $workers; + 'health_manager/stats_update_threads' : value => $workers; } } diff --git a/releasenotes/notes/add-health_manager-worker-default-6259b601e01db4f3.yaml b/releasenotes/notes/add-health_manager-worker-default-6259b601e01db4f3.yaml new file mode 100644 index 00000000..3d8e7ebb --- /dev/null +++ b/releasenotes/notes/add-health_manager-worker-default-6259b601e01db4f3.yaml @@ -0,0 +1,4 @@ +--- +features: + - Add new parameter, "workers" to health_manager which + defaults to $::os_workers diff --git a/spec/classes/octavia_health_manager_spec.rb b/spec/classes/octavia_health_manager_spec.rb index 4e640af9..e592c5bf 100644 --- a/spec/classes/octavia_health_manager_spec.rb +++ b/spec/classes/octavia_health_manager_spec.rb @@ -33,6 +33,8 @@ describe 'octavia::health_manager' do }) end 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') } end it 'installs octavia-health-manager package' do @@ -97,6 +99,15 @@ describe 'octavia::health_manager' do it { is_expected.to contain_octavia_config('health_manager/bind_port').with_value('5555') } end + context 'configured with specific parameters' do + before do + params.merge!({ + :workers => 8, + }) + 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) } + end end on_supported_os({