Skip to content

Conversation

@matmerr
Copy link
Member

@matmerr matmerr commented Oct 19, 2020

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:

@codecov
Copy link

codecov bot commented Oct 19, 2020

Codecov Report

Merging #695 into master will decrease coverage by 0.04%.
The diff coverage is 7.69%.

@@            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]
Copy link
Contributor

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,
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

neaggarwMS
neaggarwMS previously approved these changes Oct 20, 2020
@matmerr matmerr merged commit 223b5ba into Azure:master Oct 21, 2020
matmerr added a commit that referenced this pull request Nov 12, 2020
* fix: pass host gateway to cni in swift mode

* hostgwkey

* update comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants