-
Notifications
You must be signed in to change notification settings - Fork 370
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
Enable IP forwarding on the Windows bridge local interface #3137
Enable IP forwarding on the Windows bridge local interface #3137
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3137 +/- ##
===========================================
+ Coverage 40.35% 59.98% +19.63%
===========================================
Files 167 302 +135
Lines 20879 37135 +16256
===========================================
+ Hits 8426 22276 +13850
- Misses 11632 12994 +1362
- Partials 821 1865 +1044
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pkg/agent/agent_windows.go
Outdated
@@ -188,6 +188,13 @@ func (i *Initializer) prepareOVSBridge() error { | |||
err = nil | |||
klog.V(4).Infof("Address: %s already exists when configuring IP on interface %s", uplinkNetConfig.IP.String(), brName) | |||
} | |||
// Enable bridge local interface forwarding. Since now all traffic from uplink interface is output to bridge local interface | |||
// directly instead of being resubmitted to UplinkTable, for connection of Service LoadBalancer, when the client is from |
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.
This sentence is too long to read.
How about:
Traffic from the uplink interface will be output to the bridge local interface directly. If we do not enable IP forwarding on the bridge interface, when an external client connects to a LoadBalancer type Service and the selected backend Pod is on a remote Node, the connection will be discarded on the bridge local interface.
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.
Thanks, much better. I changed a little according your version
// Enable IP forwarding on the bridge local interface. Traffic from the uplink interface will be output to the bridge
// local interface directly. When an external client connects to a LoadBalancer type Service, and the packets of the
// connection is routed to the selected backend Pod via the bridge interface, if we do not enable IP forwarding on
// the bridge interface, the connection will be discarded on the bridge interface as the source of the connection
// is not the Node.
abe4c5b
to
69c4e47
Compare
69c4e47
to
1f4b9d0
Compare
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.
LGTM.
@@ -188,6 +188,14 @@ func (i *Initializer) prepareOVSBridge() error { | |||
err = nil | |||
klog.V(4).Infof("Address: %s already exists when configuring IP on interface %s", uplinkNetConfig.IP.String(), brName) | |||
} | |||
// Enable IP forwarding on the bridge local interface. Traffic from the uplink interface will be output to the bridge | |||
// local interface directly. When an external client connects to a LoadBalancer type Service, and the packets of the |
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.
I suggest to break it to two sentences:
When an external client connects to a LoadBalancer type Service, the packets of the connection are routed to the selected backend Pond via the bridge interface; if we do not enable...
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.
Thanks, done.
1f4b9d0
to
ee59bc9
Compare
pkg/agent/agent_windows.go
Outdated
// Enable IP forwarding on the bridge local interface. Traffic from the uplink interface will be output to the bridge | ||
// local interface directly. When an external client connects to a LoadBalancer type Service, and the packets of the | ||
// connection are routed to the selected backend Pod via the bridge interface; if we do not enable IP forwarding on | ||
// the bridge interface, the connection will be discarded on the bridge interface as the source of the connection is |
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.
the connection will be discarded on the bridge interface as the destination of the connection is not the Node/
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.
You are right. The reason is that the destination of the connection is not the Node, if IP forwarding is not enabled, the connection will be discarded.
ee59bc9
to
53fbae7
Compare
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.
I have few questions:
- Is this related to AntreaProxy's enablement?
- Does NodePort traffic work without the change?
- If we don't have tests to detect the issue, could we add one?
Yes, if IP forwarding is not enabled, the br-int interface will drop the packets whose destination is not the Node, as a result, LB connections (destination is external IP) from external network will be discarded on Nodes.
No, NodePort traffic doesn't need this as the destination IP of NodePort connections is the Node.
I think we can add one like egress e2e test. We can add such a case in PR #2950. |
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.
LGTM
/test-all-features-conformance |
Traffic from the uplink interface will be output to the bridge local interface directly. When an external client connects to a LoadBalancer type Service, and the packets of the connection are routed to the selected backend Pod via the bridge interface; if we do not enable IP forwarding on the bridge interface, the connection will be discarded on the bridge interface as the destination of the connection is not the Node. Signed-off-by: Hongliang Liu <[email protected]>
3f43b54
to
d1f6d96
Compare
/skip-all |
1 similar comment
/skip-all |
/test-windows-all |
1 similar comment
/test-windows-all |
/test-windows-networkpolicy |
1 similar comment
/test-windows-networkpolicy |
…#3137) Traffic from the uplink interface will be output to the bridge local interface directly. When an external client connects to a LoadBalancer type Service, and the packets of the connection are routed to the selected backend Pod via the bridge interface; if we do not enable IP forwarding on the bridge interface, the connection will be discarded on the bridge interface as the destination of the connection is not the Node. Signed-off-by: Hongliang Liu <[email protected]>
Signed-off-by: Hongliang Liu <[email protected]>
Traffic from the uplink interface will be output to the bridge local
interface directly. When an external client connects to a LoadBalancer
type Service, and the packets of the connection are routed to the
selected backend Pod via the bridge interface, if we do not enable IP
forwarding on the bridge interface, the connection will be discarded
on the bridge interface as the destination of the connection is not the
Node.
Signed-off-by: Hongliang Liu [email protected]