Skip to content

Commit 4b56b63

Browse files
committed
fix u2o policy route generate too many flow tables cause oom
1 parent 935fa92 commit 4b56b63

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pkg/controller/subnet.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2212,13 +2212,13 @@ func (c *Controller) addPolicyRouteForU2OInterconn(subnet *kubeovnv1.Subnet) err
22122212
U2OexcludeIPAs = u2oExcludeIp6Ag
22132213
}
22142214

2215-
match1 := fmt.Sprintf("%s.dst == %s && %s.dst != $%s", ipSuffix, cidrBlock, ipSuffix, U2OexcludeIPAs)
2215+
match1 := fmt.Sprintf("%s.dst == %s", ipSuffix, cidrBlock)
22162216
match2 := fmt.Sprintf("%s.dst == $%s && %s.src == %s", ipSuffix, U2OexcludeIPAs, ipSuffix, cidrBlock)
22172217
match3 := fmt.Sprintf("%s.src == %s", ipSuffix, cidrBlock)
22182218

22192219
/*
22202220
policy1:
2221-
prio 31000 match: "ip4.dst == underlay subnet cidr && ip4.dst != node ips" action: allow
2221+
prio 29400 match: "ip4.dst == underlay subnet cidr" action: allow
22222222
22232223
policy2:
22242224
prio 31000 match: "ip4.dst == node ips && ip4.src == underlay subnet cidr" action: reroute physical gw
@@ -2233,7 +2233,7 @@ func (c *Controller) addPolicyRouteForU2OInterconn(subnet *kubeovnv1.Subnet) err
22332233

22342234
if subnet.Spec.Vpc == c.config.ClusterRouter {
22352235
klog.Infof("add u2o interconnection policy for router: %s, match %s, action %s", subnet.Spec.Vpc, match1, "allow")
2236-
if err := c.ovnLegacyClient.AddPolicyRoute(subnet.Spec.Vpc, util.SubnetRouterPolicyPriority, match1, "allow", "", externalIDs); err != nil {
2236+
if err := c.ovnLegacyClient.AddPolicyRoute(subnet.Spec.Vpc, util.U2OSubnetPolicyPriority, match1, "allow", "", externalIDs); err != nil {
22372237
klog.Errorf("failed to add u2o interconnection policy1 for subnet %s %v", subnet.Name, err)
22382238
return err
22392239
}

pkg/util/const.go

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ const (
161161
OvnFip = "ovn"
162162
IptablesFip = "iptables"
163163

164+
U2OSubnetPolicyPriority = 29400
164165
GatewayRouterPolicyPriority = 29000
165166
NodeRouterPolicyPriority = 30000
166167
SubnetRouterPolicyPriority = 31000

0 commit comments

Comments
 (0)