Skip to content

Commit

Permalink
Ensure static routes on submariner_router point to the cluster CIDR (s…
Browse files Browse the repository at this point in the history
…ubmariner-io#1998)

Currently we program Logical Static Routes on the submariner_router.
The routes are programmed for both ingress as well as egress direction.
However, for ingress, it was seen that when using Globalnet, it was using
the globalCIDR and not the local clusterCIDR which was creating issues in
datapath connectivity. This PR fixes it and is backward compatible with
non-Globalnet deployments as well.

Fixes: submariner-io#1984
Signed-off-by: Sridhar Gaddam <[email protected]>

Signed-off-by: Sridhar Gaddam <[email protected]>
  • Loading branch information
sridhargaddam authored Sep 1, 2022
1 parent 7bf874d commit 039957e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/sbdb"
"github.com/pkg/errors"
"github.com/submariner-io/admiral/pkg/log"
"github.com/submariner-io/admiral/pkg/stringset"
"k8s.io/klog/v2"
)

Expand Down Expand Up @@ -221,10 +222,12 @@ func (ovn *SyncHandler) updateSubmarinerRouterRemoteRoutes() error {
}

func (ovn *SyncHandler) updateSubmarinerRouterLocalRoutes() error {
localSubnets := ovn.localEndpointSubnetSet()
localSubnets := stringset.New(ovn.localClusterCIDR...)

klog.V(log.DEBUG).Infof("reconciling south static routes on %q for subnets %v", submarinerLogicalRouter,
klog.Infof("reconciling south static routes on %q for subnets %v", submarinerLogicalRouter,
localSubnets)

// For the incoming traffic from remote cluster destined to the local cluster CIDR, configure the next hop
// as the ovn_cluster_router port.
return ovn.reconcileSubOvnLogicalRouterStaticRoutes(submarinerDownstreamRPort, ovnClusterSubmarinerIP, localSubnets)
}

0 comments on commit 039957e

Please sign in to comment.