Skip to content

Commit

Permalink
ovn-kubernetes: Use a single, short lived, IC NB connection.
Browse files Browse the repository at this point in the history
There's no need for a long lived one.  We use it to create the transit
switch, once.

Signed-off-by: Dumitru Ceara <[email protected]>
  • Loading branch information
dceara committed Mar 27, 2024
1 parent 334cf20 commit dd5657d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 9 additions & 3 deletions ovn-tester/cms/ovn_kubernetes/tests/base_cluster_bringup.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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:
Expand Down
10 changes: 3 additions & 7 deletions ovn-tester/ovn_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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')

Expand Down

0 comments on commit dd5657d

Please sign in to comment.