Make Neutron LBaaS Activation Timeout configurable

This changes _ACTIVATION_TIMEOUT of LBaaS driver from constant to
configurable value in order to make it flexible to production
environment.

This commit also increases the timeout value in DevStack plugin to make
sure Octavia has time to run Amphorae in the gate.

Co-Authored-By: Michał Dulko <mdulko@redhat.com>
Change-Id: I895d3e5af71ccc7219be422b9ca9e9f8833bad8f
Related-Bug: 1753653
Signed-off-by: Eunsoo Park <esevan.park@gmail.com>
This commit is contained in:
Eunsoo Park 2018-03-06 15:02:48 +09:00 committed by Michał Dulko
parent ffc19f0df2
commit 32cd153791
5 changed files with 24 additions and 2 deletions

View File

@ -838,7 +838,7 @@ function create_load_balancer_listener {
port="$3"
lb="$4"
max_timeout=600
max_timeout=1200
# Octavia needs the LB to be active for the listener
wait_for_lb $lb $max_timeout

View File

@ -332,6 +332,14 @@ function configure_neutron_defaults {
fi
iniset "$KURYR_CONFIG" neutron_defaults external_svc_net "$ext_svc_net_id"
iniset "$KURYR_CONFIG" octavia_defaults member_mode "$KURYR_K8S_OCTAVIA_MEMBER_MODE"
if [[ "$use_octavia" == "True" ]]; then
# Octavia takes a very long time to start the LB in the gate. We need
# to tweak the timeout for the LB creation. Let's be generous and give
# it up to 20 minutes.
# FIXME(dulek): This might be removed when bug 1753653 is fixed and
# Kuryr restarts waiting for LB on timeouts.
iniset "$KURYR_CONFIG" neutron_defaults lbaas_activation_timeout 1200
fi
}
function configure_k8s_pod_sg_rules {

View File

@ -177,6 +177,10 @@ neutron_defaults = [
cfg.IntOpt('network_device_mtu',
help='Default MTU setting for network interface.',
default=1500,),
cfg.IntOpt('lbaas_activation_timeout',
help=_("Time (in seconds) that kuryr controller waits for "
"neutron LBaaS to be activated"),
default=300),
]
octavia_defaults = [

View File

@ -19,6 +19,7 @@ import time
import requests
from neutronclient.common import exceptions as n_exc
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import timeutils
@ -29,8 +30,10 @@ from kuryr_kubernetes.controller.drivers import base
from kuryr_kubernetes import exceptions as k_exc
from kuryr_kubernetes.objects import lbaas as obj_lbaas
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
_ACTIVATION_TIMEOUT = 300
_ACTIVATION_TIMEOUT = CONF.neutron_defaults.lbaas_activation_timeout
_SUPPORTED_LISTENER_PROT = ('HTTP', 'HTTPS', 'TCP')

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
As the openstack performance differs in production environments,
fixed timeout of LBaaS activation might create the kuryr-kubernetes error.
In order to adapt to the environment, a new option
``[neutron_defaults]lbaas_activation_timeout`` was added.