Skip to content

Commit 27033e3

Browse files
martinkennellyjcaamano
authored andcommitted
EIP no reroute: allow multiple entries for pod to pod and pod to join
Pod to node isn't required because its match is based on address sets and not cluster networks. Signed-off-by: Martin Kennelly <[email protected]>
1 parent f76582f commit 27033e3

File tree

2 files changed

+245
-10
lines changed

2 files changed

+245
-10
lines changed

go-controller/pkg/ovn/egressip.go

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,7 @@ func createDefaultNoRerouteServicePolicies(nbClient libovsdbclient.Client, netwo
31213121
}
31223122
dbIDs := getEgressIPLRPNoReRoutePodToJoinDbIDs(IPFamilyValueV4, network, controller)
31233123
match := fmt.Sprintf("ip4.src == %s && ip4.dst == %s", v4Subnet.String(), v4JoinSubnet.String())
3124-
if err := createLogicalRouterPolicy(nbClient, clusterRouter, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
3124+
if err := createEgressIPLogicalRouterPolicy(nbClient, clusterRouter, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
31253125
return fmt.Errorf("unable to create IPv4 no-reroute service policies, err: %v", err)
31263126
}
31273127
}
@@ -3132,7 +3132,7 @@ func createDefaultNoRerouteServicePolicies(nbClient libovsdbclient.Client, netwo
31323132
}
31333133
dbIDs := getEgressIPLRPNoReRoutePodToJoinDbIDs(IPFamilyValueV6, network, controller)
31343134
match := fmt.Sprintf("ip6.src == %s && ip6.dst == %s", v6Subnet.String(), v6JoinSubnet.String())
3135-
if err := createLogicalRouterPolicy(nbClient, clusterRouter, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
3135+
if err := createEgressIPLogicalRouterPolicy(nbClient, clusterRouter, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
31363136
return fmt.Errorf("unable to create IPv6 no-reroute service policies, err: %v", err)
31373137
}
31383138
}
@@ -3191,7 +3191,7 @@ func (e *EgressIPController) ensureSwitchPoliciesForNode(ni util.NetInfo, nodeNa
31913191
func createDefaultNoRerouteReplyTrafficPolicy(nbClient libovsdbclient.Client, network, controller, routerName string) error {
31923192
match := fmt.Sprintf("pkt.mark == %d", types.EgressIPReplyTrafficConnectionMark)
31933193
dbIDs := getEgressIPLRPNoReRouteDbIDs(types.DefaultNoRereoutePriority, ReplyTrafficNoReroute, IPFamilyValue, network, controller)
3194-
if err := createLogicalRouterPolicy(nbClient, routerName, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
3194+
if err := createEgressIPLogicalRouterPolicy(nbClient, routerName, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
31953195
return fmt.Errorf("unable to create no-reroute reply traffic policies, err: %v", err)
31963196
}
31973197
return nil
@@ -3203,14 +3203,14 @@ func createDefaultNoReroutePodPolicies(nbClient libovsdbclient.Client, network,
32033203
for _, v4Subnet := range v4ClusterSubnet {
32043204
match := fmt.Sprintf("ip4.src == %s && ip4.dst == %s", v4Subnet.String(), v4Subnet.String())
32053205
dbIDs := getEgressIPLRPNoReRoutePodToPodDbIDs(IPFamilyValueV4, network, controller)
3206-
if err := createLogicalRouterPolicy(nbClient, routerName, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
3206+
if err := createEgressIPLogicalRouterPolicy(nbClient, routerName, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
32073207
return fmt.Errorf("unable to create IPv4 no-reroute pod policies, err: %v", err)
32083208
}
32093209
}
32103210
for _, v6Subnet := range v6ClusterSubnet {
32113211
match := fmt.Sprintf("ip6.src == %s && ip6.dst == %s", v6Subnet.String(), v6Subnet.String())
32123212
dbIDs := getEgressIPLRPNoReRoutePodToPodDbIDs(IPFamilyValueV6, network, controller)
3213-
if err := createLogicalRouterPolicy(nbClient, routerName, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
3213+
if err := createEgressIPLogicalRouterPolicy(nbClient, routerName, match, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
32143214
return fmt.Errorf("unable to create IPv6 no-reroute pod policies, err: %v", err)
32153215
}
32163216
}
@@ -3477,14 +3477,14 @@ func ensureDefaultNoRerouteNodePolicies(nbClient libovsdbclient.Client, addressS
34773477
// Create global allow policy for node traffic
34783478
if matchV4 != "" {
34793479
dbIDs = getEgressIPLRPNoReRoutePodToNodeDbIDs(IPFamilyValueV4, network, controller)
3480-
if err := createLogicalRouterPolicy(nbClient, router, matchV4, types.DefaultNoRereoutePriority, options, dbIDs); err != nil {
3480+
if err := createEgressIPLogicalRouterPolicy(nbClient, router, matchV4, types.DefaultNoRereoutePriority, options, dbIDs); err != nil {
34813481
return fmt.Errorf("unable to create IPv4 no-reroute node policies, err: %v", err)
34823482
}
34833483
}
34843484

34853485
if matchV6 != "" {
34863486
dbIDs = getEgressIPLRPNoReRoutePodToNodeDbIDs(IPFamilyValueV6, network, controller)
3487-
if err := createLogicalRouterPolicy(nbClient, router, matchV6, types.DefaultNoRereoutePriority, options, dbIDs); err != nil {
3487+
if err := createEgressIPLogicalRouterPolicy(nbClient, router, matchV6, types.DefaultNoRereoutePriority, options, dbIDs); err != nil {
34883488
return fmt.Errorf("unable to create IPv6 no-reroute node policies, err: %v", err)
34893489
}
34903490
}
@@ -3544,7 +3544,7 @@ func (e *EgressIPController) getPodIPs(ni util.NetInfo, pod *corev1.Pod, nadName
35443544
return podIPs, nil
35453545
}
35463546

3547-
func createLogicalRouterPolicy(nbClient libovsdbclient.Client, clusterRouter, match string, priority int, options map[string]string, dbIDs *libovsdbops.DbObjectIDs) error {
3547+
func createEgressIPLogicalRouterPolicy(nbClient libovsdbclient.Client, clusterRouter, match string, priority int, options map[string]string, dbIDs *libovsdbops.DbObjectIDs) error {
35483548
lrp := nbdb.LogicalRouterPolicy{
35493549
Priority: priority,
35503550
Action: nbdb.LogicalRouterPolicyActionAllow,
@@ -3553,6 +3553,19 @@ func createLogicalRouterPolicy(nbClient libovsdbclient.Client, clusterRouter, ma
35533553
Options: options,
35543554
}
35553555
p := libovsdbops.GetPredicate[*nbdb.LogicalRouterPolicy](dbIDs, nil)
3556+
externalIDs := dbIDs.GetExternalIDs()
3557+
objectType, ok := externalIDs[libovsdbops.ObjectNameKey.String()]
3558+
if !ok {
3559+
return fmt.Errorf("failed to find Name key for DB ID (%q)", dbIDs.String())
3560+
}
3561+
// if multiple cluster subnets, we will retrieve multiple LRPs if using a predicate generated from DB IDs alone,
3562+
// therefore filter by match and options also only for pod to pod and pod to join LRPs.
3563+
if objectType == string(NoReRoutePodToJoin) || objectType == string(NoReRoutePodToPod) {
3564+
p = libovsdbops.GetPredicate[*nbdb.LogicalRouterPolicy](dbIDs, func(item *nbdb.LogicalRouterPolicy) bool {
3565+
return item.Match == match
3566+
})
3567+
}
3568+
35563569
err := libovsdbops.CreateOrUpdateLogicalRouterPolicyWithPredicate(nbClient, clusterRouter, &lrp, p)
35573570
if err != nil {
35583571
return fmt.Errorf("error creating logical router policy %+v on router %s: %v", lrp, clusterRouter, err)
@@ -3691,14 +3704,14 @@ func ensureDefaultNoRerouteUDNEnabledSvcPolicies(nbClient libovsdbclient.Client,
36913704
// Create global allow policy for UDN enabled service traffic
36923705
if v4 && matchV4 != "" {
36933706
dbIDs = getEgressIPLRPNoReRouteDbIDs(types.DefaultNoRereoutePriority, NoReRouteUDNPodToCDNSvc, IPFamilyValueV4, ni.GetNetworkName(), controllerName)
3694-
if err := createLogicalRouterPolicy(nbClient, routerName, matchV4, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
3707+
if err := createEgressIPLogicalRouterPolicy(nbClient, routerName, matchV4, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
36953708
return fmt.Errorf("unable to create IPv4 no-rerouteUDN pod to CDN svc, err: %v", err)
36963709
}
36973710
}
36983711

36993712
if v6 && matchV6 != "" {
37003713
dbIDs = getEgressIPLRPNoReRouteDbIDs(types.DefaultNoRereoutePriority, NoReRouteUDNPodToCDNSvc, IPFamilyValueV6, ni.GetNetworkName(), controllerName)
3701-
if err := createLogicalRouterPolicy(nbClient, routerName, matchV6, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
3714+
if err := createEgressIPLogicalRouterPolicy(nbClient, routerName, matchV6, types.DefaultNoRereoutePriority, nil, dbIDs); err != nil {
37023715
return fmt.Errorf("unable to create IPv6 no-reroute UDN pod to CDN svc policies, err: %v", err)
37033716
}
37043717
}

go-controller/pkg/ovn/egressip_test.go

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11813,6 +11813,228 @@ var _ = ginkgo.Describe("OVN master EgressIP Operations cluster default network"
1181311813
gomega.Expect(err).NotTo(gomega.HaveOccurred())
1181411814
})
1181511815

11816+
ginkgo.It("creates pod to pod and pod to join LRPs for multiple default network subnets of the same IP family", func() {
11817+
// test creates two IPv4 cluster subnets and two IPv6 cluster subnets and ensures the appropriate pod to pod and
11818+
// pod to join LRPs are created.
11819+
app.Action = func(*cli.Context) error {
11820+
config.IPv4Mode = true
11821+
config.IPv6Mode = true
11822+
clusterSubnetIPv41 := ovntest.MustParseIPNet("10.128.0.0/14")
11823+
clusterSubnetIPv42 := ovntest.MustParseIPNet("10.132.0.0/14")
11824+
clusterSubnetIPv61 := ovntest.MustParseIPNet("fd69::1/64")
11825+
clusterSubnetIPv62 := ovntest.MustParseIPNet("fd70::1/64")
11826+
config.Default.ClusterSubnets = []config.CIDRNetworkEntry{
11827+
{
11828+
CIDR: clusterSubnetIPv41,
11829+
HostSubnetLength: 23,
11830+
},
11831+
{
11832+
CIDR: clusterSubnetIPv42,
11833+
HostSubnetLength: 23,
11834+
},
11835+
{
11836+
CIDR: clusterSubnetIPv61,
11837+
HostSubnetLength: 120,
11838+
},
11839+
{
11840+
CIDR: clusterSubnetIPv62,
11841+
HostSubnetLength: 120,
11842+
},
11843+
}
11844+
node1IPv4 := "192.168.126.12"
11845+
node1IPv4CIDR := node1IPv4 + "/24"
11846+
node1IPv6 := "::feff:c0a8:8e0c"
11847+
node1IPv6CIDR := node1IPv6 + "/64"
11848+
egressNamespace := newNamespace(eipNamespace)
11849+
annotations := map[string]string{
11850+
"k8s.ovn.org/node-primary-ifaddr": fmt.Sprintf("{\"ipv4\": \"%s\", \"ipv6\": \"%s\"}", node1IPv4CIDR, node1IPv6CIDR),
11851+
"k8s.ovn.org/node-subnets": "{\"default\":[\"10.128.0.0/23\", \"10.132.0.0/23\", \"fd69::1/120\"]}",
11852+
util.OVNNodeHostCIDRs: fmt.Sprintf("[\"%s\",\"%s\"]", node1IPv4CIDR, node1IPv6CIDR),
11853+
}
11854+
node1 := getNodeObj(node1Name, annotations, nil)
11855+
11856+
node1Switch := &nbdb.LogicalSwitch{
11857+
UUID: node1.Name + "-UUID",
11858+
Name: node1.Name,
11859+
}
11860+
11861+
fakeOvn.startWithDBSetup(
11862+
libovsdbtest.TestSetup{
11863+
NBData: []libovsdbtest.TestData{
11864+
&nbdb.LogicalRouterPort{
11865+
UUID: types.GWRouterToJoinSwitchPrefix + types.GWRouterPrefix + node1.Name + "-UUID",
11866+
Name: types.GWRouterToJoinSwitchPrefix + types.GWRouterPrefix + node1.Name,
11867+
Networks: []string{nodeLogicalRouterIfAddrV4, nodeLogicalRouterIfAddrV6},
11868+
},
11869+
&nbdb.LogicalRouter{
11870+
Name: types.OVNClusterRouter,
11871+
UUID: types.OVNClusterRouter + "-UUID",
11872+
},
11873+
&nbdb.LogicalRouter{
11874+
Name: types.GWRouterPrefix + node1.Name,
11875+
UUID: types.GWRouterPrefix + node1.Name + "-UUID",
11876+
Ports: []string{types.GWRouterToJoinSwitchPrefix + types.GWRouterPrefix + node1.Name + "-UUID"},
11877+
},
11878+
&nbdb.LogicalSwitchPort{
11879+
UUID: types.EXTSwitchToGWRouterPrefix + types.GWRouterPrefix + node1Name + "-UUID",
11880+
Name: types.EXTSwitchToGWRouterPrefix + types.GWRouterPrefix + node1Name,
11881+
Type: "router",
11882+
Options: map[string]string{
11883+
"nat-addresses": "router",
11884+
"exclude-lb-vips-from-garp": "true",
11885+
"router-port": types.GWRouterToExtSwitchPrefix + "GR_" + node1Name,
11886+
},
11887+
},
11888+
&nbdb.LogicalSwitch{
11889+
UUID: types.ExternalSwitchPrefix + node1Name + "-UUID",
11890+
Name: types.ExternalSwitchPrefix + node1Name,
11891+
Ports: []string{types.EXTSwitchToGWRouterPrefix + types.GWRouterPrefix + node1Name + "-UUID"},
11892+
},
11893+
node1Switch,
11894+
},
11895+
},
11896+
&corev1.NodeList{
11897+
Items: []corev1.Node{node1},
11898+
},
11899+
&corev1.NamespaceList{
11900+
Items: []corev1.Namespace{*egressNamespace},
11901+
},
11902+
)
11903+
err := fakeOvn.controller.WatchEgressIPNamespaces()
11904+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
11905+
err = fakeOvn.controller.WatchEgressIPPods()
11906+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
11907+
err = fakeOvn.controller.WatchEgressNodes()
11908+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
11909+
err = fakeOvn.controller.WatchEgressIP()
11910+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
11911+
11912+
egressSVCServedPodsASv4, egressSVCServedPodsASv6 := buildEgressServiceAddressSets(nil)
11913+
egressIPServedPodsASv4, egressIPServedPodsASv6 := buildEgressIPServedPodsAddressSets([]string{}, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName)
11914+
egressNodeIPsASv4, egressNodeIPsASv6 := buildEgressIPNodeAddressSets([]string{node1IPv4, node1IPv6})
11915+
11916+
node1Switch.QOSRules = []string{"default-QoS-UUID", "default-QoSv6-UUID"}
11917+
expectedDatabaseState := []libovsdbtest.TestData{
11918+
getNoReRouteReplyTrafficPolicy(types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName),
11919+
&nbdb.LogicalRouterPolicy{
11920+
Priority: types.DefaultNoRereoutePriority,
11921+
Match: fmt.Sprintf("(ip4.src == $%s || ip4.src == $%s) && ip4.dst == $%s",
11922+
egressIPServedPodsASv4.Name, egressSVCServedPodsASv4.Name, egressNodeIPsASv4.Name),
11923+
Action: nbdb.LogicalRouterPolicyActionAllow,
11924+
UUID: "default-v4-no-reroute-node-UUID",
11925+
Options: map[string]string{"pkt_mark": types.EgressIPNodeConnectionMark},
11926+
ExternalIDs: getEgressIPLRPNoReRoutePodToNodeDbIDs(IPFamilyValueV4, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11927+
},
11928+
&nbdb.LogicalRouterPolicy{
11929+
Priority: types.DefaultNoRereoutePriority,
11930+
Match: fmt.Sprintf("(ip6.src == $%s || ip6.src == $%s) && ip6.dst == $%s",
11931+
egressIPServedPodsASv6.Name, egressSVCServedPodsASv6.Name, egressNodeIPsASv6.Name),
11932+
Action: nbdb.LogicalRouterPolicyActionAllow,
11933+
UUID: "default-v6-no-reroute-node-UUID",
11934+
Options: map[string]string{"pkt_mark": types.EgressIPNodeConnectionMark},
11935+
ExternalIDs: getEgressIPLRPNoReRoutePodToNodeDbIDs(IPFamilyValueV6, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11936+
},
11937+
11938+
&nbdb.LogicalRouterPort{
11939+
UUID: types.GWRouterToJoinSwitchPrefix + types.GWRouterPrefix + node1.Name + "-UUID",
11940+
Name: types.GWRouterToJoinSwitchPrefix + types.GWRouterPrefix + node1.Name,
11941+
Networks: []string{nodeLogicalRouterIfAddrV4, nodeLogicalRouterIfAddrV6},
11942+
},
11943+
&nbdb.LogicalRouterPolicy{
11944+
Priority: types.DefaultNoRereoutePriority,
11945+
Match: "ip4.src == 10.128.0.0/14 && ip4.dst == 10.128.0.0/14",
11946+
Action: nbdb.LogicalRouterPolicyActionAllow,
11947+
UUID: "no-reroute-ipv4-1-UUID",
11948+
ExternalIDs: getEgressIPLRPNoReRoutePodToPodDbIDs(IPFamilyValueV4, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11949+
},
11950+
&nbdb.LogicalRouterPolicy{
11951+
Priority: types.DefaultNoRereoutePriority,
11952+
Match: "ip4.src == 10.132.0.0/14 && ip4.dst == 10.132.0.0/14",
11953+
Action: nbdb.LogicalRouterPolicyActionAllow,
11954+
UUID: "no-reroute-ipv4-2-UUID",
11955+
ExternalIDs: getEgressIPLRPNoReRoutePodToPodDbIDs(IPFamilyValueV4, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11956+
},
11957+
&nbdb.LogicalRouterPolicy{
11958+
Priority: types.DefaultNoRereoutePriority,
11959+
Match: "ip6.src == fd69::1/64 && ip6.dst == fd69::1/64",
11960+
Action: nbdb.LogicalRouterPolicyActionAllow,
11961+
UUID: "no-reroute-ipv6-1-UUID",
11962+
ExternalIDs: getEgressIPLRPNoReRoutePodToPodDbIDs(IPFamilyValueV6, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11963+
},
11964+
&nbdb.LogicalRouterPolicy{
11965+
Priority: types.DefaultNoRereoutePriority,
11966+
Match: "ip6.src == fd70::1/64 && ip6.dst == fd70::1/64",
11967+
Action: nbdb.LogicalRouterPolicyActionAllow,
11968+
UUID: "no-reroute-ipv6-2-UUID",
11969+
ExternalIDs: getEgressIPLRPNoReRoutePodToPodDbIDs(IPFamilyValueV6, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11970+
},
11971+
&nbdb.LogicalRouterPolicy{
11972+
Priority: types.DefaultNoRereoutePriority,
11973+
Match: fmt.Sprintf("ip4.src == 10.128.0.0/14 && ip4.dst == %s", config.Gateway.V4JoinSubnet),
11974+
Action: nbdb.LogicalRouterPolicyActionAllow,
11975+
UUID: "no-reroute-service-ipv4-1-UUID",
11976+
ExternalIDs: getEgressIPLRPNoReRoutePodToJoinDbIDs(IPFamilyValueV4, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11977+
},
11978+
&nbdb.LogicalRouterPolicy{
11979+
Priority: types.DefaultNoRereoutePriority,
11980+
Match: fmt.Sprintf("ip4.src == 10.132.0.0/14 && ip4.dst == %s", config.Gateway.V4JoinSubnet),
11981+
Action: nbdb.LogicalRouterPolicyActionAllow,
11982+
UUID: "no-reroute-service-ipv4-2-UUID",
11983+
ExternalIDs: getEgressIPLRPNoReRoutePodToJoinDbIDs(IPFamilyValueV4, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11984+
},
11985+
&nbdb.LogicalRouterPolicy{
11986+
Priority: types.DefaultNoRereoutePriority,
11987+
Match: fmt.Sprintf("ip6.src == fd69::1/64 && ip6.dst == %s", config.Gateway.V6JoinSubnet),
11988+
Action: nbdb.LogicalRouterPolicyActionAllow,
11989+
UUID: "no-reroute-service-ipv6-1-UUID",
11990+
ExternalIDs: getEgressIPLRPNoReRoutePodToJoinDbIDs(IPFamilyValueV6, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11991+
},
11992+
&nbdb.LogicalRouterPolicy{
11993+
Priority: types.DefaultNoRereoutePriority,
11994+
Match: fmt.Sprintf("ip6.src == fd70::1/64 && ip6.dst == %s", config.Gateway.V6JoinSubnet),
11995+
Action: nbdb.LogicalRouterPolicyActionAllow,
11996+
UUID: "no-reroute-service-ipv6-2-UUID",
11997+
ExternalIDs: getEgressIPLRPNoReRoutePodToJoinDbIDs(IPFamilyValueV6, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName).GetExternalIDs(),
11998+
},
11999+
&nbdb.LogicalRouter{
12000+
Name: types.OVNClusterRouter,
12001+
UUID: types.OVNClusterRouter + "-UUID",
12002+
Policies: []string{"no-reroute-ipv4-1-UUID", "no-reroute-ipv4-2-UUID", "no-reroute-service-ipv4-1-UUID",
12003+
"no-reroute-ipv6-1-UUID", "no-reroute-ipv6-2-UUID", "no-reroute-service-ipv4-2-UUID", "no-reroute-service-ipv6-1-UUID",
12004+
"no-reroute-service-ipv6-2-UUID", "default-v4-no-reroute-node-UUID", "default-v6-no-reroute-node-UUID", "default-no-reroute-reply-traffic"},
12005+
},
12006+
&nbdb.LogicalRouter{
12007+
Name: types.GWRouterPrefix + node1.Name,
12008+
UUID: types.GWRouterPrefix + node1.Name + "-UUID",
12009+
Ports: []string{types.GWRouterToJoinSwitchPrefix + types.GWRouterPrefix + node1.Name + "-UUID"},
12010+
},
12011+
&nbdb.LogicalSwitchPort{
12012+
UUID: types.EXTSwitchToGWRouterPrefix + types.GWRouterPrefix + node1Name + "-UUID",
12013+
Name: types.EXTSwitchToGWRouterPrefix + types.GWRouterPrefix + node1Name,
12014+
Type: "router",
12015+
Options: map[string]string{
12016+
"router-port": types.GWRouterToExtSwitchPrefix + "GR_" + node1Name,
12017+
"nat-addresses": "router",
12018+
"exclude-lb-vips-from-garp": "true",
12019+
},
12020+
},
12021+
&nbdb.LogicalSwitch{
12022+
UUID: types.ExternalSwitchPrefix + node1Name + "-UUID",
12023+
Name: types.ExternalSwitchPrefix + node1Name,
12024+
Ports: []string{types.EXTSwitchToGWRouterPrefix + types.GWRouterPrefix + node1Name + "-UUID"},
12025+
},
12026+
node1Switch,
12027+
getDefaultQoSRule(false, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName),
12028+
getDefaultQoSRule(true, types.DefaultNetworkName, fakeOvn.controller.eIPC.controllerName),
12029+
egressSVCServedPodsASv4, egressSVCServedPodsASv6, egressIPServedPodsASv4, egressIPServedPodsASv6, egressNodeIPsASv4, egressNodeIPsASv6,
12030+
}
12031+
gomega.Eventually(fakeOvn.nbClient).Should(libovsdbtest.HaveData(expectedDatabaseState))
12032+
return nil
12033+
}
12034+
err := app.Run([]string{app.Name})
12035+
gomega.Expect(err).NotTo(gomega.HaveOccurred())
12036+
})
12037+
1181612038
ginkgo.It("should re-balance EgressIPs when their node is removed", func() {
1181712039
app.Action = func(*cli.Context) error {
1181812040
config.IPv4Mode = true

0 commit comments

Comments
 (0)