Skip to content

Commit

Permalink
Fix NodeNetworkPolicy e2e test failure
Browse files Browse the repository at this point in the history
In NodeNetworkPolicy e2e tests, we have the following cases:

- Node to Node. We deploy two hostNetwork Pods on different Nodes.
- Node to Pods. We deploy a hostNetwork Pod on a Node and two
  non-hostNetwork Pods on different Nodes.

For the case of Node to Pods, after creating test Pods, a full mesh
probing is run to ensure that all Pods can be reachable from each
other. However, the UDP probing from a non-hostNetwork Pod, using the
Node external IP that is the hostNetwork Pod as destination IP, to
the hostNetwork Pod within on the same Node will get a failure. The
reason is that due to UDP's connectionless nature, the reply traffic
may use a source IP address determined by routing decisions or outgoing
interfaces, which means that the local Antrea gateway IPs will be chosen
as source IP address, rather than the destination IP address used in
request traffic. As a result, the probing will get a failure because the
source IP address of reply traffic is unexpected.

To resolve the issue, we ensure that the probing from non-hostNetwork Pod
to hostNetwork Pod deployed in the same Node uses the local Antrea gateway
IPs as the destination IP, rather than the hostNetwork Pod IP (the Node
external IP).

Signed-off-by: Hongliang Liu <[email protected]>
  • Loading branch information
hongliangl committed Apr 17, 2024
1 parent 1b46c0e commit 1b7d677
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/ti-mo/conntrack v0.5.0
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240410182734-f4e6e3d5d507
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240403135643-19057e85f569
github.com/vmware/go-ipfix v0.9.0
go.uber.org/mock v0.4.0
golang.org/x/crypto v0.22.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,8 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw=
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho=
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240410182734-f4e6e3d5d507 h1:bm/1ktLjnn0F9lq4xXsYs+dVCQtkVS8MRzshrzxzWmI=
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240410182734-f4e6e3d5d507/go.mod h1:whJevzBpTrid75eZy99s3DqCmy05NfibNaF2Ol5Ox5A=
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240403135643-19057e85f569 h1:Lvj5Y8jnwFad3kvPD8OCQo0FMxBrlIWfod7VDw4C7MU=
github.com/vishvananda/netlink v1.2.1-beta.2.0.20240403135643-19057e85f569/go.mod h1:whJevzBpTrid75eZy99s3DqCmy05NfibNaF2Ol5Ox5A=
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
Expand Down

0 comments on commit 1b7d677

Please sign in to comment.