Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDN: Prerequisite: Make OVN topology network aware. #4478

Merged
merged 31 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cf28abd
netInfo: Add wrapper for getting the K8s-mp0 interface name per network.
dceara Jun 26, 2024
34369a8
netInfo: Add wrapper for getting the cluster router name.
dceara Jun 26, 2024
f9252b3
netInfo: Add wrapper for getting the GW router name.
dceara Jun 26, 2024
6d052ce
netInfo: Add wrapper for getting the node switch name.
dceara Jun 27, 2024
a55b2f5
netInfo: Add wrapper for getting the join switch name.
dceara Jun 27, 2024
c17903d
netInfo: Add wrapper for getting the external switch name.
dceara Jun 27, 2024
d5cde95
hybrid: Use GetNetworkScopedK8sMgmtIntfName() wrapper.
dceara Jun 26, 2024
74cba7e
egressIP: Make the egressIPZoneController network aware.
dceara Jun 26, 2024
5a2ae84
ovn: Use GetNetworkScopedK8sMgmtIntfName() wrapper.
dceara Jun 26, 2024
c96cc9a
ovn: master: Use GetNetworkName() instead of hardcoding the name.
dceara Jun 26, 2024
0a0b91c
egressservice_zone: Make the controller network aware.
dceara Jun 26, 2024
b30980f
egressservice_zone: Use GetNetworkScopedClusterRouterName().
dceara Jun 26, 2024
7af9297
ovn: bnc: Use GetNetworkScopedClusterRouterName().
dceara Jun 26, 2024
c6e1313
ovn: Refactor CreateDefaultRouteToExternal() and pass the cluster rou…
dceara Jun 26, 2024
f5a8871
ovn: egress: Use GetNetworkScopedClusterRouterName().
dceara Jun 26, 2024
4f5cbb8
ovn: gateway: Use GetNetworkScopedClusterRouterName().
dceara Jun 26, 2024
d3149dc
ovn: gateway: Use GetNetworkScopedClusterRouterName().
dceara Jun 26, 2024
a4c9ef1
ovn: egress: Use GetNetworkScopedGWRouterName().
dceara Jun 26, 2024
4ff905f
ovn: Refactor CreateDefaultRouteToExternal() and pass the GW router n…
dceara Jun 26, 2024
130f5d1
ovn: gateway: Use GetNetworkScopedGWRouterName().
dceara Jun 26, 2024
970552b
ovn: hybrid: Use GetNetworkScopedGWRouterName().
dceara Jun 26, 2024
b07d48c
apbroute: Use util.GetGatewayRouterFromNode().
dceara Jun 26, 2024
bd872da
ovn: Use GetNetworkScopedGWRouterName() instead of GetGatewayRouterFr…
dceara Jun 26, 2024
f0395b8
ovn: pods: Use GetNetworkScopedSwitchName().
dceara Jun 27, 2024
d3bf6d9
ovn: secondary: Use GetNetworkScopedSwitchName().
dceara Jun 27, 2024
81d2249
ovn: egress: Use GetNetworkScopedSwitchName().
dceara Jun 27, 2024
c8de913
ovn: hybrid: Use GetNetworkScopedSwitchName().
dceara Jun 27, 2024
62a354d
ovn: master: Use GetNetworkScopedSwitchName().
dceara Jun 27, 2024
37fff8f
ovn: egressqos: Skip all join switches, from all networks.
dceara Jun 27, 2024
da111db
ovn: Use GetNetworkScopedJoinSwitchName().
dceara Jun 27, 2024
2b29179
ovn: gateway: Use GetNetworkScopedExtSwitchName().
dceara Jun 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go-controller/pkg/kubevirt/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func EnsureLocalZonePodAddressesToNodeRoute(watchFactory *factory.WatchFactory,
if config.OVNKubernetesFeature.EnableInterconnect {
// NOTE: EIP & ESVC use same route and if this is already present thanks to those features,
// this will be a no-op
if err := libovsdbutil.CreateDefaultRouteToExternal(nbClient, types.OVNClusterRouter, pod.Spec.NodeName); err != nil {
if err := libovsdbutil.CreateDefaultRouteToExternal(nbClient, types.OVNClusterRouter, types.GWRouterPrefix+pod.Spec.NodeName); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another instance of my previous comment in the same file. I think we should either make functions in kubevirt receivers of the controller, or pass the controller in here and use the correct function rather than fixing this behavior of string concat in some places by using functions, but here we still prepend the prefix.

return err
}
}
Expand Down
10 changes: 5 additions & 5 deletions go-controller/pkg/libovsdb/util/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ import (
// (TODO: FIXME): With this route, we are officially breaking support for IC with zones that have multiple-nodes
// NOTE: This route is exactly the same as what is added by pod-live-migration feature and we keep the route exactly
// same across the 3 features so that if the route already exists on the node, this is just a no-op
func CreateDefaultRouteToExternal(nbClient libovsdbclient.Client, clusterRouter, nodeName string) error {
gatewayIPs, err := GetLRPAddrs(nbClient, types.GWRouterToJoinSwitchPrefix+types.GWRouterPrefix+nodeName)
func CreateDefaultRouteToExternal(nbClient libovsdbclient.Client, clusterRouter, gwRouterName string) error {
gatewayIPs, err := GetLRPAddrs(nbClient, types.GWRouterToJoinSwitchPrefix+gwRouterName)
if err != nil {
return fmt.Errorf("attempt at finding node gateway router %s network information failed, err: %w", nodeName, err)
return fmt.Errorf("attempt at finding node gateway router %s network information failed, err: %w", gwRouterName, err)
}
clusterSubnets := util.GetAllClusterSubnets()
for _, subnet := range clusterSubnets {
gatewayIP, err := util.MatchFirstIPNetFamily(utilnet.IsIPv6String(subnet.IP.String()), gatewayIPs)
if err != nil {
return fmt.Errorf("could not find gateway IP for node %s with family %v: %v", nodeName, false, err)
return fmt.Errorf("could not find gateway IP for gateway router %s with family %v: %v", gwRouterName, false, err)
}
lrsr := nbdb.LogicalRouterStaticRoute{
IPPrefix: subnet.String(),
Expand All @@ -55,7 +55,7 @@ func CreateDefaultRouteToExternal(nbClient libovsdbclient.Client, clusterRouter,
lrsr.Policy != nil && *lrsr.Policy == nbdb.LogicalRouterStaticRoutePolicySrcIP
}
if err := libovsdbops.CreateOrReplaceLogicalRouterStaticRouteWithPredicate(nbClient, clusterRouter, &lrsr, p); err != nil {
return fmt.Errorf("unable to create pod to external catch-all reroute for node %s, err: %v", nodeName, err)
return fmt.Errorf("unable to create pod to external catch-all reroute for gateway router %s, err: %v", gwRouterName, err)
}
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type InitClusterEgressPoliciesFunc func(client libovsdbclient.Client, addressSet
type EnsureNoRerouteNodePoliciesFunc func(client libovsdbclient.Client, addressSetFactory addressset.AddressSetFactory,
controllerName, clusterRouter string, nodeLister corelisters.NodeLister) error
type DeleteLegacyDefaultNoRerouteNodePoliciesFunc func(nbClient libovsdbclient.Client, clusterRouter, nodeName string) error
type CreateDefaultRouteToExternalFunc func(nbClient libovsdbclient.Client, clusterRouter, nodeName string) error
type CreateDefaultRouteToExternalFunc func(nbClient libovsdbclient.Client, clusterRouter, gwRouterName string) error

type Controller struct {
// network information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (c *Controller) syncNode(key string) error {

// At this point the node exists and is ready
if config.OVNKubernetesFeature.EnableInterconnect && c.zone != types.OvnDefaultZone && c.isNodeInLocalZone(n) {
if err := c.createDefaultRouteToExternalForIC(c.nbClient, c.GetNetworkScopedClusterRouterName(), nodeName); err != nil {
if err := c.createDefaultRouteToExternalForIC(c.nbClient, c.GetNetworkScopedClusterRouterName(), c.GetNetworkScopedGWRouterName(nodeName)); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/ovn/egressip.go
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ func (oc *DefaultNetworkController) addEgressNode(node *v1.Node) error {
// NOTE3: When the node gets deleted we do not remove this route intentionally because
// on IC if the node is gone, then the ovn_cluster_router is also gone along with all
// the routes on it.
if err := libovsdbutil.CreateDefaultRouteToExternal(oc.nbClient, oc.GetNetworkScopedClusterRouterName(), node.Name); err != nil {
if err := libovsdbutil.CreateDefaultRouteToExternal(oc.nbClient, oc.GetNetworkScopedClusterRouterName(), oc.GetNetworkScopedGWRouterName(node.Name)); err != nil {
return err
}
}
Expand Down