-
Notifications
You must be signed in to change notification settings - Fork 260
fix: Pass host gateway to CNI in swift mode #695
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #695 +/- ##
==========================================
- Coverage 38.56% 38.52% -0.05%
==========================================
Files 79 79
Lines 10446 10460 +14
==========================================
+ Hits 4029 4030 +1
- Misses 5925 5938 +13
Partials 492 492 |
| if client.nwInfo.IPAMType == AzureCNS { | ||
|
|
||
| // Add snat Rules | ||
| gwIP := client.nwInfo.Options[SNATIPKey] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HostGWKey ? instead of SNATIPKey
| nlRoute := &netlink.Route{ | ||
| Family: family, | ||
| Dst: &client.nwInfo.PodSubnet.Prefix, | ||
| Gw: Ipv4DefaultRouteDstPrefix.IP, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like instead of adding a rule we're replacing a rule. Also what is the podsubnet here is it actually the node subnet (what I would think of in aks-rp as vnetsubnetid given to aks?)
| return fmt.Errorf("Invalid host gateway IP: %+v", gwIP) | ||
| } | ||
|
|
||
| // add pod subnet to host |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the comment?
| func (client *LinuxBridgeClient) AddRoutes(nwInfo *NetworkInfo, interfaceName string) error { | ||
| if client.nwInfo.IPAMType == AzureCNS { | ||
|
|
||
| // Add snat Rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the comment, we are adding a ip route with VM nic's gateway address
* fix: pass host gateway to cni in swift mode * hostgwkey * update comments
Reason for Change:
In swift mode the route for host to pod on other host needs to go via the default gateway, so we add a route to the bridge for the pod subnet to use the host default gateway
Issue Fixed:
Requirements:
Notes: