-
Notifications
You must be signed in to change notification settings - Fork 367
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
Why traffic noEncap/hybrid only support with Antrea-Proxy enabled #2600
Comments
When AntreaProxy is not enabled, pod-to-service traffic is handled by iptables/ipvs in root netns, if the endpoint is not local the DNATed traffic will be output to physical network directly without going back to OVS for Egress NetworkPolicy enforcement, which breaks basic security functionality. If it's just a warning, many users won't notice it and their Pods won't be secured as expected. As it is about security, the validation is made mandatory. |
Thanks for reply, I got it @tnqn |
How about adding a parameter named ”force_hybrid_without_proxy“, and the default value is "false". When it's set to "true", we can use hybrid mode without antrea-proxy, which will improve network performance in some environments,even communicate with other CNI(such as flannel DR mode) in one cluster. Also, the log will show a warning "The Egress NetworkPolicy won't work correctly when force_hybrid_without_proxy is true, please use Ingress NetworkPolicy to manage the security access” |
@lionstack out-of-curiosity in which situation do you see better performance with kube-proxy than with AntreaProxy? If anything we are looking to invest more into AntreaProxy in the future, with the possible addition of features that only work with AntreaProxy. |
@antoninbas Hi, thx for your reply. I mean if the two nodes are in one subnet, in the hybrid mode the pods on the nodes can communicate with each other by host route like: 10.224.1.0/24 via 192.168.10.10 dev eth0, which won't use network tunnel. And the performance of route is better than network tunnel. |
this seems like a legitimate request, but it would be hard for us to assist users if they run into issues with this mode, so they basically would be on their own. Features beyond NetworkPolicies (e.g. Traceflow) may break and additional features may break unexpectedly in the future. I suppose one way for us to enable you to do what you want and force "AntreaProxy" to be disabled even in hybrid mode, would be to introduce an environment variable which would disable the check in the Agent. You can then manually edit your Antrea YAML manifest to set this environment variable. It's a bit more hidden than a config parameter in that case. @jianjuns @tnqn what do you think? But moving forward, I want to emphasize that this is not a configuration we would be validating in CI or providing guarantees for. |
If we are sure it works, I am fine to add the flag. I do not remember if we made any code changes when disallowing noEncap/hybrid/policyOnly with kube-proxy. I can check. |
I did some tests and see at least noEncap and hybrid modes do work with kube-proxy (Pod -> Service traffic can still go through). So, I am fine to add a ConfigMap parameter or environment variable to allow noEncap/hybrid/networkPolicyOnly modes with kube-proxy (and say it is not a guaranteed configuration). @antoninbas @tnqn |
An environment variable sounds good to me. |
@Jexf : wonder if you like to make the change as discussed above :) If not, I can take it. |
@jianjuns Thank you for reminding me, I would like to take it. |
For performance, NoEncap mode can make the traffic output to physical network directly without going back to OVS for Egress NetworkPolicy enforcement.Although this destroys the basic security function, we can force support NoEncap with TrafficDirectRouting environment for performance. Signed-off-by: Wenze Gao <wenze.gao@transwarp.io>
NoEncap mode can make the traffic output to physical network directly. When antrea proxy is disable, traffic won't go back to OVS for Egress NetworkPolicy enforcement, it breaks the basic security function, we can force support NoEncap with TrafficDirectRouting environment parameter for performance. Signed-off-by: Wenze Gao <wenze.gao@transwarp.io>
NoEncap mode can make the traffic output to physical network directly. When antrea proxy is disable, traffic won't go back to OVS for Egress NetworkPolicy enforcement, it breaks the basic security function, we can force support NoEncap with TrafficDirectRouting environment parameter for performance. Signed-off-by: Wenze Gao <wenze.gao@transwarp.io>
NoEncap mode can make the traffic output to physical network directly. When antrea proxy is disable, traffic won't go back to OVS for Egress NetworkPolicy enforcement, it breaks the basic security function, we can force support NoEncap with TrafficDirectRouting environment parameter for performance. Signed-off-by: Wenze Gao <wenze.gao@transwarp.io>
NoEncap mode can make the traffic output to physical network directly. When antrea proxy is disable, traffic won't go back to OVS for Egress NetworkPolicy enforcement, it breaks the basic security function, we can force support NoEncap without antrea proxy by using ALLOW_NO_ENCAP_WITHOUT_ANTREA_PROXY environment parameter for performance. Signed-off-by: Wenze Gao <wenze.gao@transwarp.io> Signed-off-by: Wu zhengdong <zhengdong.wu@transwarp.io>
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days |
Why traffic noEncap/hybrid only support with Antrea-Proxy enabled
By the way, maybe it would be better to give a warning log instead of carsh directly.
The text was updated successfully, but these errors were encountered: