-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to the network configuration of Azure pod VMs require a NAT gateway in the subnet. Having that is desirable anyway, because default outbound access is deprecated and scheduled for removal in 2025.
- Loading branch information
Showing
3 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/by-name/cloud-api-adaptor/0001-netops-replace-routes-instead-of-adding-them.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Markus Rudy <[email protected]> | ||
Date: Tue, 19 Nov 2024 18:00:47 +0100 | ||
Subject: [PATCH] netops: replace routes instead of adding them | ||
|
||
Some systems create a route if an IP address with prefix mask is added | ||
to an interface. If this route is then also copied from the worker node, | ||
a conflict may occur. | ||
|
||
A simple fix is to replace the route instead of adding it. The behaviour | ||
is the same when the route does not exist. When it exists, we are either | ||
setting the same route again, or overriding a route that's not desirable | ||
in the first place. | ||
--- | ||
src/cloud-api-adaptor/pkg/util/netops/netops.go | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/cloud-api-adaptor/pkg/util/netops/netops.go b/src/cloud-api-adaptor/pkg/util/netops/netops.go | ||
index 6a761dfef10fcf127ab914ebf0b759e76add3435..f0eaea5713c4a92479eed6a4ca46ff7b4abfe3c5 100644 | ||
--- a/src/cloud-api-adaptor/pkg/util/netops/netops.go | ||
+++ b/src/cloud-api-adaptor/pkg/util/netops/netops.go | ||
@@ -623,7 +623,7 @@ func (ns *namespace) RouteAdd(route *Route) error { | ||
if !route.Gateway.IsValid() { | ||
nlRoute.Scope = netlink.SCOPE_LINK | ||
} | ||
- if err := ns.handle.RouteAdd(nlRoute); err != nil { | ||
+ if err := ns.handle.RouteReplace(nlRoute); err != nil { | ||
return fmt.Errorf("failed to create a route (table: %d, dest: %s, gw: %s) with flags %d: %w", nlRoute.Table, nlRoute.Dst.String(), nlRoute.Gw.String(), nlRoute.Flags, err) | ||
} | ||
return nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters