Skip to content
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

Install flows to skip SNAT for k8s nodes (#2708) #2762

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

leonstack
Copy link
Contributor

If destination IP is nodeIPs, we must skip SNAT if egress is enabled,
no need to forward such packets to the egressIP node

Signed-off-by: Yang Li [email protected]

@leonstack
Copy link
Contributor Author

/test-e2e

@leonstack
Copy link
Contributor Author

/test-all

pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
@leonstack
Copy link
Contributor Author

/test-all

@jianjuns jianjuns requested a review from wenyingd September 15, 2021 18:36
jianjuns
jianjuns previously approved these changes Sep 15, 2021
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the commit message:

If destination IP is nodeIPs, we must skip SNAT if egress is enabled, no need to forward such packets to the egressIP node

When egress is enabled, we should skip SNAT for traffic to a remote Node's transport IP, as no need to forward such packets through an egress Node.

pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
tnqn
tnqn previously approved these changes Sep 16, 2021
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnqn
Copy link
Member

tnqn commented Sep 16, 2021

/test-all

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2021

Codecov Report

Merging #2762 (fbb91b3) into main (cf22420) will increase coverage by 5.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2762      +/-   ##
==========================================
+ Coverage   60.72%   65.74%   +5.02%     
==========================================
  Files         283      284       +1     
  Lines       22839    26946    +4107     
==========================================
+ Hits        13868    17715    +3847     
- Misses       7498     7552      +54     
- Partials     1473     1679     +206     
Flag Coverage Δ
e2e-tests 56.12% <100.00%> (?)
kind-e2e-tests 48.95% <81.81%> (+0.50%) ⬆️
unit-tests 41.07% <18.18%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/openflow/client.go 68.91% <100.00%> (+10.61%) ⬆️
pkg/agent/openflow/pipeline.go 82.38% <100.00%> (+7.22%) ⬆️
pkg/controller/egress/ipallocator/allocator.go 65.00% <0.00%> (-15.42%) ⬇️
pkg/controller/networkpolicy/endpoint_querier.go 77.64% <0.00%> (-13.79%) ⬇️
pkg/legacyapis/core/v1alpha2/register.go 69.23% <0.00%> (-10.77%) ⬇️
pkg/apis/stats/register.go 71.42% <0.00%> (-10.39%) ⬇️
pkg/legacyapis/stats/register.go 71.42% <0.00%> (-10.39%) ⬇️
pkg/ovs/openflow/ofctrl_meter.go 33.84% <0.00%> (-10.16%) ⬇️
pkg/legacyapis/security/v1alpha1/register.go 73.33% <0.00%> (-10.00%) ⬇️
.../registry/networkpolicy/clustergroupmember/rest.go 78.26% <0.00%> (-9.98%) ⬇️
... and 271 more

@tnqn
Copy link
Member

tnqn commented Sep 17, 2021

@leonstack "Go / Golangci-lint" check failed. Could you fix it so we can merge it?

@leonstack
Copy link
Contributor Author

@leonstack "Go / Golangci-lint" check failed. Could you fix it so we can merge it?

OK, I will fix it later.

When egress is enabled, we should skip SNAT for traffic to a remote
Node's transport IP, as no need to forward such packets through an
egress Node.

Signed-off-by: Yang Li <[email protected]>
@leonstack
Copy link
Contributor Author

/test-all

@leonstack
Copy link
Contributor Author

@tnqn hi, seems everything is OK, can you help review this PR again :-)

@leonstack
Copy link
Contributor Author

/test-ipv6

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnqn tnqn requested a review from jianjuns September 22, 2021 17:00
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm - it wont affect the default masquerade behavior right?

@leonstack
Copy link
Contributor Author

Just to confirm - it wont affect the default masquerade behavior right?

It wont affect the default masquerade behavior, and the pod will use the default masquerade to communicate with other NodeIPs.

@tnqn tnqn merged commit 357fce3 into antrea-io:main Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants