Browse Source

Add keepalived-healthcheck-interval config option

Defaults to 30s (i.e. enabled) but also allows disabling
healthchecks by setting to 0.

Change-Id: I49603c22d8085aabd6085058e4d4eb9c74e84a20
Closes-Bug: #1890900
changes/41/745441/4
Edward Hope-Morley 8 months ago
parent
commit
8d71c41481
7 changed files with 22 additions and 8 deletions
  1. +8
    -0
      config.yaml
  2. +2
    -0
      hooks/neutron_contexts.py
  3. +2
    -2
      templates/newton/l3_agent.ini
  4. +2
    -2
      templates/queens/l3_agent.ini
  5. +2
    -2
      templates/rocky/l3_agent.ini
  6. +2
    -2
      templates/stein/l3_agent.ini
  7. +4
    -0
      unit_tests/test_neutron_contexts.py

+ 8
- 0
config.yaml View File

@ -362,3 +362,11 @@ options:
description: |
Manually disable lbaas services. Set this option to True if Octavia
is used with neutron. This option is ignored for Train+ OpenStack.
keepalived-healthcheck-interval:
type: int
default: 30
description: |
By default all HA routers will check their external network gateway
by sending a ping and if that fails they trigger a vrrp transition. This
option defines how frequently this check is performed. Setting this value
to 0 will disable the healthchecks.

+ 2
- 0
hooks/neutron_contexts.py View File

@ -175,6 +175,8 @@ class NeutronGatewayContext(NeutronAPIContext):
'availability_zone': get_availability_zone(),
'enable_nfg_logging': api_settings['enable_nfg_logging'],
'ovsdb_timeout': config('ovsdb-timeout'),
'keepalived_healthcheck_interval':
config('keepalived-healthcheck-interval')
}
ctxt['local_ip'] = get_local_ip()


+ 2
- 2
templates/newton/l3_agent.ini View File

@ -30,8 +30,8 @@ gateway_external_network_id = {{ ext_net_id }}
external_network_bridge = br-ex
{% endif -%}
agent_mode = {{ agent_mode }}
{% if use_l3ha -%}
ha_vrrp_health_check_interval = 30
{% if use_l3ha and keepalived_healthcheck_interval -%}
ha_vrrp_health_check_interval = {{ keepalived_healthcheck_interval }}
{% endif -%}
[AGENT]


+ 2
- 2
templates/queens/l3_agent.ini View File

@ -25,8 +25,8 @@ gateway_external_network_id = {{ ext_net_id }}
external_network_bridge = br-ex
{% endif -%}
agent_mode = {{ agent_mode }}
{% if use_l3ha -%}
ha_vrrp_health_check_interval = 30
{% if use_l3ha and keepalived_healthcheck_interval -%}
ha_vrrp_health_check_interval = {{ keepalived_healthcheck_interval }}
{% endif -%}
[AGENT]


+ 2
- 2
templates/rocky/l3_agent.ini View File

@ -25,8 +25,8 @@ gateway_external_network_id = {{ ext_net_id }}
external_network_bridge = br-ex
{% endif -%}
agent_mode = {{ agent_mode }}
{% if use_l3ha -%}
ha_vrrp_health_check_interval = 30
{% if use_l3ha and keepalived_healthcheck_interval -%}
ha_vrrp_health_check_interval = {{ keepalived_healthcheck_interval }}
{% endif -%}
[AGENT]


+ 2
- 2
templates/stein/l3_agent.ini View File

@ -25,8 +25,8 @@ gateway_external_network_id = {{ ext_net_id }}
external_network_bridge = br-ex
{% endif -%}
agent_mode = {{ agent_mode }}
{% if use_l3ha -%}
ha_vrrp_health_check_interval = 30
{% if use_l3ha and keepalived_healthcheck_interval -%}
ha_vrrp_health_check_interval = {{ keepalived_healthcheck_interval }}
{% endif -%}
[AGENT]


+ 4
- 0
unit_tests/test_neutron_contexts.py View File

@ -204,6 +204,8 @@ class TestNeutronGatewayContext(CharmTestCase):
self.test_config.set('ovsdb-timeout', 10)
self.test_config.set('keepalived-healthcheck-interval', 0)
self.network_get_primary_address.side_effect = NotImplementedError
self.unit_get.return_value = '10.5.0.1'
# Provided by neutron-api relation
@ -237,6 +239,7 @@ class TestNeutronGatewayContext(CharmTestCase):
'nfg_log_output_base': '/var/log/firewall-logs',
'nfg_log_rate_limit': 100,
'ovsdb_timeout': 10,
'keepalived_healthcheck_interval': 0,
})
@patch.object(neutron_contexts, 'validate_nfg_log_path', lambda x: x)
@ -299,6 +302,7 @@ class TestNeutronGatewayContext(CharmTestCase):
'nfg_log_output_base': None,
'nfg_log_rate_limit': None,
'ovsdb_timeout': 60,
'keepalived_healthcheck_interval': 30,
})
@patch('os.environ.get')


Loading…
Cancel
Save