From dd5657d86ab18e55055cdceb096d678d62f5988b Mon Sep 17 00:00:00 2001 From: Dumitru Ceara Date: Wed, 27 Mar 2024 20:31:11 +0100 Subject: [PATCH] ovn-kubernetes: Use a single, short lived, IC NB connection. There's no need for a long lived one. We use it to create the transit switch, once. Signed-off-by: Dumitru Ceara --- .../cms/ovn_kubernetes/tests/base_cluster_bringup.py | 12 +++++++++--- ovn-tester/ovn_workload.py | 10 +++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ovn-tester/cms/ovn_kubernetes/tests/base_cluster_bringup.py b/ovn-tester/cms/ovn_kubernetes/tests/base_cluster_bringup.py index 310fbe59..4f794497 100644 --- a/ovn-tester/cms/ovn_kubernetes/tests/base_cluster_bringup.py +++ b/ovn-tester/cms/ovn_kubernetes/tests/base_cluster_bringup.py @@ -1,7 +1,7 @@ from collections import namedtuple from randmac import RandMac -from ovn_utils import LSwitch +from ovn_utils import LSwitch, OvnIcNbctl from ovn_context import Context from ovn_ext_cmd import ExtCmd @@ -18,8 +18,14 @@ def __init__(self, config, clusters, global_cfg): self.ic_cluster = clusters[0] if len(clusters) > 1 else None def create_transit_switch(self): - if self.ic_cluster: - self.ic_cluster.icnbctl.ts_add() + if self.ic_cluster is None: + return + + inactivity_probe = ( + self.ic_cluster.cluster_cfg.db_inactivity_probe // 1000 + ) + ic_remote = f'tcp:{self.ic_cluster.cluster_cfg.node_net.ip + 2}:6645' + OvnIcNbctl(None, ic_remote, inactivity_probe).ts_add() def connect_transit_switch(self, cluster): if self.ic_cluster is None: diff --git a/ovn-tester/ovn_workload.py b/ovn-tester/ovn_workload.py index 352e4002..d7c55215 100644 --- a/ovn-tester/ovn_workload.py +++ b/ovn-tester/ovn_workload.py @@ -303,7 +303,6 @@ def __init__( self.brex_cfg = brex_cfg self.nbctl: Optional[ovn_utils.OvnNbctl] = None self.sbctl: Optional[ovn_utils.OvnSbctl] = None - self.icnbctl: Optional[ovn_utils.OvnIcNbctl] = None self.az = az protocol = "ssl" if cluster_cfg.enable_ssl else "tcp" @@ -364,12 +363,9 @@ def start(self): self.central_nodes[0], sb_conn, inactivity_probe ) - # ovn-ic configuration - self.icnbctl = ovn_utils.OvnIcNbctl( - None, - f'tcp:{self.cluster_cfg.node_net.ip + 2}:6645', - inactivity_probe, - ) + # ovn-ic configuration: enable route learning/advertising to allow + # automatic pinging between cluster_net subnets in different AZs. + # This is allows IC connectivity checks. self.nbctl.set_global('ic-route-learn', 'true') self.nbctl.set_global('ic-route-adv', 'true')