ovn: Add more tunables related to OVN DB connection

Change-Id: I9542ca07f8fd7da442ce3d6aab0f88286db021ad
(cherry picked from commit 2a6d6b8b4d)
(cherry picked from commit d64492c34a)
This commit is contained in:
Takashi Kajinami 2021-11-10 00:32:31 +09:00
parent f2bb105bbd
commit 0c8f1c4dbf
3 changed files with 50 additions and 13 deletions

View File

@ -24,12 +24,28 @@
# verify certificates presented to it by SSL peers
# Defaults to $::os_service_default
#
# [*ovsdb_connection_timeout*]
# (optional) Timeout in seconds for the OVSDB connection transaction.
# Defaults to $::os_service_default
#
# [*ovsdb_retry_max_interval*]
# (optional) Max interval in seconds between each retry to get the OVN NB and
# SB IDLs.
# Defaults to $::os_service_default
#
# [*ovsdb_probe_interval*]
# (optional) The probe interval for the OVSDB session in milliseconds.
# Defaults to $::os_service_default
#
class octavia::provider::ovn (
$package_ensure = 'present',
$ovn_nb_connection = $::os_service_default,
$ovn_nb_private_key = $::os_service_default,
$ovn_nb_certificate = $::os_service_default,
$ovn_nb_ca_cert = $::os_service_default
$package_ensure = 'present',
$ovn_nb_connection = $::os_service_default,
$ovn_nb_private_key = $::os_service_default,
$ovn_nb_certificate = $::os_service_default,
$ovn_nb_ca_cert = $::os_service_default,
$ovsdb_connection_timeout = $::os_service_default,
$ovsdb_retry_max_interval = $::os_service_default,
$ovsdb_probe_interval = $::os_service_default,
) {
include octavia::deps
@ -52,9 +68,12 @@ class octavia::provider::ovn (
# For now, the config below uses octavia_config until we can figure out how to pass extra
# configuration files to the api running as wsgi process.
octavia_config {
'ovn/ovn_nb_connection': value => $ovn_nb_connection_real;
'ovn/ovn_nb_private_key': value => $ovn_nb_private_key;
'ovn/ovn_nb_certificate': value => $ovn_nb_certificate;
'ovn/ovn_nb_ca_cert': value => $ovn_nb_ca_cert;
'ovn/ovn_nb_connection': value => $ovn_nb_connection_real;
'ovn/ovn_nb_private_key': value => $ovn_nb_private_key;
'ovn/ovn_nb_certificate': value => $ovn_nb_certificate;
'ovn/ovn_nb_ca_cert': value => $ovn_nb_ca_cert;
'ovn/ovsdb_connection_timeout': value => $ovsdb_connection_timeout;
'ovn/ovsdb_retry_max_interval': value => $ovsdb_retry_max_interval;
'ovn/ovsdb_probe_interval': value => $ovsdb_probe_interval;
}
}

View File

@ -0,0 +1,9 @@
---
features:
- |
The following parameters have been added to the ``octavia::provider::ovn``
class.
- ``ovsdb_connection_timeout``
- ``ovsdb_retry_max_interval``
- ``ovsdb_probe_interval``

View File

@ -13,6 +13,9 @@ describe 'octavia::provider::ovn' do
it { is_expected.to contain_octavia_config('ovn/ovn_nb_private_key').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_certificate').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_ca_cert').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovsdb_connection_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovsdb_retry_max_interval').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovsdb_probe_interval').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_package('ovn-octavia-provider').with(
:ensure => 'present',
@ -24,10 +27,13 @@ describe 'octavia::provider::ovn' do
context 'with specific parameters' do
before do
params.merge!({
:ovn_nb_connection => 'tcp:127.0.0.1:6641',
:ovn_nb_private_key => '/foo.key',
:ovn_nb_certificate => '/foo.pem',
:ovn_nb_ca_cert => '/ca_foo.pem'
:ovn_nb_connection => 'tcp:127.0.0.1:6641',
:ovn_nb_private_key => '/foo.key',
:ovn_nb_certificate => '/foo.pem',
:ovn_nb_ca_cert => '/ca_foo.pem',
:ovsdb_connection_timeout => 180,
:ovsdb_retry_max_interval => 180,
:ovsdb_probe_interval => 60000,
})
end
@ -35,6 +41,9 @@ describe 'octavia::provider::ovn' do
it { is_expected.to contain_octavia_config('ovn/ovn_nb_private_key').with_value('/foo.key') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_certificate').with_value('/foo.pem') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_ca_cert').with_value('/ca_foo.pem') }
it { is_expected.to contain_octavia_config('ovn/ovsdb_connection_timeout').with_value(180) }
it { is_expected.to contain_octavia_config('ovn/ovsdb_retry_max_interval').with_value(180) }
it { is_expected.to contain_octavia_config('ovn/ovsdb_probe_interval').with_value(60000) }
end
end