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

Add env parameter to support noEncap without AntreaProxy #3116

Merged
merged 1 commit into from
Jan 6, 2022

Conversation

Jexf
Copy link
Member

@Jexf Jexf commented Dec 10, 2021

When using NoEncap traffic mode without AntreaProxy, Pod-to-Service
traffic is handled by kube-proxy (iptables/ipvs) in the root netns.
If the Endpoint is not local the DNATed traffic will be output to
the physical network directly without going back to OVS for Egress
NetworkPolicy enforcement, which breaks basic security functionality.
Therefore, we usually do not allow the NoEncap traffic mode without
AntreaProxy. But one can bypass this check and force this feature
combination to be allowed, by defining the ALLOW_NO_ENCAP_WITHOUT_ANTREA_PROXY
environment variable and setting it to true. This may lead to better
performance when using NoEncap if Egress NetworkPolicy enforcement is
not required.

Signed-off-by: Wenze Gao wenze.gao@transwarp.io
Signed-off-by: Wu zhengdong zhengdong.wu@transwarp.io

@Jexf Jexf changed the title Add env parameter to support noEncap without AntreaProxy(#2600) Add env parameter to support noEncap without AntreaProxy Dec 10, 2021
@Jexf
Copy link
Member Author

Jexf commented Dec 10, 2021

/test-all

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2021

Codecov Report

Merging #3116 (7e679f1) into main (b87b76c) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3116      +/-   ##
==========================================
- Coverage   60.83%   60.82%   -0.01%     
==========================================
  Files         295      295              
  Lines       24892    24908      +16     
==========================================
+ Hits        15142    15151       +9     
- Misses       8095     8102       +7     
  Partials     1655     1655              
Flag Coverage Δ
kind-e2e-tests 47.74% <0.00%> (-0.01%) ⬇️
unit-tests 40.35% <0.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
pkg/util/env/env.go 40.47% <0.00%> (-0.99%) ⬇️
pkg/agent/openflow/pipeline.go 73.96% <0.00%> (-0.34%) ⬇️
pkg/controller/networkpolicy/validate.go 20.96% <0.00%> (-0.31%) ⬇️
pkg/agent/route/route_linux.go 46.38% <0.00%> (-0.30%) ⬇️
pkg/agent/controller/networkpolicy/reconciler.go 77.19% <0.00%> (ø)
pkg/controller/externalippool/controller.go 85.54% <0.00%> (+1.73%) ⬆️
pkg/agent/controller/networkpolicy/fqdn.go 78.59% <0.00%> (+2.61%) ⬆️
...agent/flowexporter/connections/deny_connections.go 86.15% <0.00%> (+3.07%) ⬆️
.../listers/security/v1alpha1/clusternetworkpolicy.go 9.09% <0.00%> (+9.09%) ⬆️

@antoninbas
Copy link
Contributor

@Jexf is this a duplicate of #2796? should that other PR be closed?

@Jexf
Copy link
Member Author

Jexf commented Dec 13, 2021

@antoninbas Yes, #2796 already has been closed.

@Jexf
Copy link
Member Author

Jexf commented Dec 13, 2021

/test-integration

cmd/antrea-agent/options.go Outdated Show resolved Hide resolved
docs/noencap-hybrid-modes.md Outdated Show resolved Hide resolved
docs/noencap-hybrid-modes.md Outdated Show resolved Hide resolved
pkg/util/env/env.go Outdated Show resolved Hide resolved
@Jexf
Copy link
Member Author

Jexf commented Dec 14, 2021

/test-all

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

one more comment, otherwise lgtm

cmd/antrea-agent/options.go Outdated Show resolved Hide resolved
When using NoEncap traffic mode without AntreaProxy, Pod-to-Service
traffic is handled by kube-proxy (iptables/ipvs) in the root netns.
If the Endpoint is not local the DNATed traffic will be output to
the physical network directly without going back to OVS for Egress
NetworkPolicy enforcement, which breaks basic security functionality.
Therefore, we usually do not allow the NoEncap traffic mode without
AntreaProxy. But one can bypass this check and force this feature
combination to be allowed, by defining the ALLOW_NO_ENCAP_WITHOUT_ANTREA_PROXY
environment variable and setting it to true. This may lead to better
performance when using NoEncap if Egress NetworkPolicy enforcement is
not required.

Signed-off-by: Wenze Gao <wenze.gao@transwarp.io>
Signed-off-by: Wu zhengdong <zhengdong.wu@transwarp.io>
@Jexf
Copy link
Member Author

Jexf commented Dec 15, 2021

/test-all

@Jexf Jexf requested a review from antoninbas December 15, 2021 02:50
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM

@Jexf Jexf requested a review from tnqn December 16, 2021 12:24
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 Jan 6, 2022

/skip-all I have ran the required checks manually.

@tnqn
Copy link
Member

tnqn commented Jan 6, 2022

/skip-all

1 similar comment
@tnqn
Copy link
Member

tnqn commented Jan 6, 2022

/skip-all

@tnqn tnqn merged commit 43d2ee9 into antrea-io:main Jan 6, 2022
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