-
Notifications
You must be signed in to change notification settings - Fork 386
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
Multicluster dataplane change for Service access #3603
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3603 +/- ##
==========================================
- Coverage 63.96% 56.79% -7.17%
==========================================
Files 288 406 +118
Lines 41252 57574 +16322
==========================================
+ Hits 26386 32699 +6313
- Misses 12733 22222 +9489
- Partials 2133 2653 +520
Flags with carried forward coverage won't be shown. Click here to find out more.
|
43ec8a1
to
14edcf7
Compare
/test-multicluster-dataplane-e2e |
5 similar comments
/test-multicluster-dataplane-e2e |
/test-multicluster-dataplane-e2e |
/test-multicluster-dataplane-e2e |
/test-multicluster-dataplane-e2e |
/test-multicluster-dataplane-e2e |
multicluster/apis/multicluster/v1alpha1/tunnelendpoint_types.go
Outdated
Show resolved
Hide resolved
f7ac8fd
to
1e29016
Compare
/test-multicluster-dataplane-e2e |
1e29016
to
a8b5d8b
Compare
/test-multicluster-dataplane-e2e |
/test-multicluster-dataplane-e2e |
1 similar comment
/test-multicluster-dataplane-e2e |
079c4e7
to
7542ec3
Compare
/test-multicluster-dataplane-e2e |
7542ec3
to
ee0dfbb
Compare
/test-multicluster-dataplane-e2e |
552846a
to
be8750e
Compare
/test-multicluster-dataplane-e2e |
be8750e
to
d918470
Compare
/test-multicluster-dataplane-e2e |
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 except one question
/test-multicluster-dataplane-e2e |
/test-all |
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-integration |
/test-integration |
@jianjuns smee service is broken, the jenkins doesn't respond to the comment now, I will check with @XinShuYang. |
Integration test failed due to the table rename, I will fix this. |
/test-integration |
/test-conformance |
* Add a new feature gate `Multicluster` and configs in antrea-agent.conf, and a few extra items in antrea-agent cluster role including access to `Gateway` and `ClusterInfoImport`. * Rename the `ServiceMarkTable` to `SNATMarkTable`. * Add a controller for Gateway Nodes to watch Gateway and ClusterInfoImport's events. It will set up a few openflow rules to forward cross-cluster traffic to remote Gateway Nodes. * Add a classification rule for cross-cluster traffic with global multicluster virtual MAC `aa:bb:cc:dd:ee:f0`. A sample is like below: ``` table=Classifier, priority=210,in_port="antrea-tun0",dl_dst=aa:bb:cc:dd:ee:f0 actions=load:0x1->NXM_NX_REG0[0..3],load:0x1->NXM_NX_REG0[9],resubmit(,SNATConntrackZone) ``` * Add a rule in `L3Forwarding` table for cross-cluster request packets that modifies the destination MAC to global multicluster virtual MAC. A sample is like below (the destination CIDR is remote Service ClusterIP CIDR, the tunnel IP in NXM_NX_TUN_IPV4_DST is remote Gateway IP): ``` table=L3Forwarding, priority=200,ip,nw_dst=10.96.0.0/12 actions=mod_dl_src:ee:73:a5:81:09:c6,mod_dl_dst:aa:bb:cc:dd:ee:f0,load:0xab01b39->NXM_NX_TUN_IPV4_DST[],load:0x1->NXM_NX_REG0[4..7],resubmit(,L3DecTTL) ``` * Add a rule in `L3Forwarding` table for cross-cluster reply packets. A sample is like below (the destination IP is remote Gateway IP): ``` table=L3Forwarding, priority=200,ct_state=+rpl+trk,ip,nw_dst=10.176.27.57 actions=mod_dl_src:ee:73:a5:81:09:c6,mod_dl_dst:aa:bb:cc:dd:ee:f0,load:0xab01b39->NXM_NX_TUN_IPV4_DST[],load:0x1->NXM_NX_REG0[4..7],resubmit(,L3DecTTL) ``` * Add a rule to `SNATMark` table to match the packets of multi-cluster Service connection and perform DNAT in DNAT zone. ``` table=SNATMark, priority=210,ip,nw_dst=10.96.0.0/12 actions=ct(commit,table=SNAT,zone=65520,exec(load:0x1->NXM_NX_CT_MARK[5])) ``` * Add a rule to `SNAT` table to perform SNAT for any remote cluster traffic. ``` table=SNAT, priority=200,ct_state=+new+trk,ip,nw_dst=10.96.0.0/12 actions=ct(commit,table=L2ForwardingCalc,zone=65521,nat(src=10.176.27.224)) ``` * Add a rule to `UnSNAT` table to perform de-SNAT if destination IP is local GatewayIP. ``` table=UnSNAT, priority=200,ip,nw_dst=10.176.27.224 actions=ct(table=ConntrackZone,zone=65521,nat) ``` * Add a rule in `L2ForwardingCalc` table to load the global virtual multi-cluster MAC's output to `antrea-tun0` ``` table=L2ForwardingCalc, priority=200,dl_dst=aa:bb:cc:dd:ee:f0 actions=load:0x1->NXM_NX_REG1[],load:0x1->NXM_NX_REG0[8],resubmit(,22) ``` * Add a rule in `Output` table to match the multi-cluster traffic to forward the traffic from/to regular Node through the same port. ``` table=Output, priority=210,reg1=0x1,in_port=1 actions=IN_PORT ``` * Add a controller for regular Nodes to watch Gateway and ClusterInfoImport's events. It will set up a few openflow rules to forward cross-cluster traffic to local Gateway Node. * Add a rule in L3Forwarding table for cross-cluster request packets, and modify the destination MAC to global multicluster virtual MAC. A sample is like below (the destination CIDR is remote Service ClusterIP CIDR, the tunnel IP in NXM_NX_TUN_IPV4_DST is local Gateway's Internal IP.): ``` table=L3Forwarding, priority=200,ip,nw_dst=10.96.0.0/12 actions=mod_dl_src:f2:08:93:0c:82:bd,mod_dl_dst:aa:bb:cc:dd:ee:ff,load:0xab0193b->NXM_NX_TUN_IPV4_DST[],load:0x1->NXM_NX_REG0[4..7],resubmit(,L3DecTTL) ``` * Add a rule in L3Forwarding table for cross-cluster reply packets. A sample is like below (the destination IP is remote Gateway IP, the tunnel IP in NXM_NX_TUN_IPV4_DST is local Gateway's Internal IP): ``` table=L3Forwarding, priority=200,ct_state=+rpl+trk,ip,nw_dst=10.176.27.57 actions=mod_dl_src:f2:08:93:0c:82:bd,mod_dl_dst:aa:bb:cc:dd:ee:f0,load:0xab0193b->NXM_NX_TUN_IPV4_DST[],load:0x1->NXM_NX_REG0[4..7],resubmit(,L3DecTTL) ``` * Add a rule in L2ForwardingCalc table to load the global virtual multi-cluster MAC's output to `antrea-tun0` ``` table=L2ForwardingCalc, priority=200,dl_dst=aa:bb:cc:dd:ee:f0 actions=load:0x1->NXM_NX_REG1[],load:0x1->NXM_NX_REG0[8],resubmit(,22) ``` * Add unit test cases * Refine e2e test for data plane change Signed-off-by: Lan Luo <luola@vmware.com> Co-authored-by: Hongliang Liu <lhongliang@vmware.com>
1. Use Service ClusterIPs instead of Pod IPs as MC Service's Endpoints. The ServiceExport controller will only watch ServiceExport and Service events, and wrap Service's ClusterIPs into a new Endpoint kind of ResourceExport. 2. Includes local Serivce ClusterIP as multi-cluster Service's Endpoints as well. Signed-off-by: Lan Luo <luola@vmware.com>
/test-integration |
Sure. Please take care of such issues earlier next time. |
Yeah, I will, I didn't notice integration test will be impacted, will check the result in time next time. |
Ideally run all tests of test-all. |
/test-all |
1 similar comment
/test-all |
/test-multicluster-dataplane-e2e |
Hi @tnqn all required tests are passed now, I skipped |
Since this change updates common flows, could you make sure ipv6-e2e and ipv6-only-e2e pass (except FQDNPolicyInCluster in ipv6-only-e2e)? We had issues with them several times and just fixed all of them except #3873, don't want to break them again when it's close to release. |
/test-ipv6-only-e2e |
This PR is on top of #3463, it includes two commits, one is for data path change, another one is for changing Multi-cluster Service's Endpoint from Pod IP to Service ClusterIP.
Commit 1:
Add Multi-cluster feature in Agent
Multicluster
and configs in antrea-agent.conf, and a few extra items in antrea-agentcluster role including access to
Gateway
andClusterInfoImport
.ServiceMarkTable
toSNATMarkTable
.events. It will set up a few openflow rules to forward cross-cluster traffic to remote Gateway Nodes.
MAC
aa:bb:cc:dd:ee:f0
. A sample is like below:L3Forwarding
table for cross-cluster request packets that modifiesthe destination MAC to global multicluster virtual MAC. A sample is like below (the destination CIDR
is remote Service ClusterIP CIDR, the tunnel IP in NXM_NX_TUN_IPV4_DST is remote Gateway IP):
L3Forwarding
table for cross-cluster reply packets. A sample is like below(the destination IP is remote Gateway IP):
SNATMark
table to match the packets of multi-cluster Service connection and perform DNAT in DNAT zone.SNAT
table to perform SNAT for any remote cluster traffic.UnSNAT
table to perform de-SNAT if destination IP is local GatewayIP.L2ForwardingCalc
table to load the global virtual multi-cluster MAC's output toantrea-tun0
Output
table to match the multi-cluster traffic to forward the traffic from/to regular Nodethrough the same port.
It will set up a few openflow rules to forward cross-cluster traffic to local Gateway Node.
modify the destination MAC to global multicluster virtual MAC. A sample is like below
(the destination CIDR is remote Service ClusterIP CIDR, the tunnel IP in NXM_NX_TUN_IPV4_DST is local Gateway's Internal IP.):
(the destination IP is remote Gateway IP, the tunnel IP in NXM_NX_TUN_IPV4_DST is local Gateway's Internal IP):
antrea-tun0
Signed-off-by: Lan Luo luola@vmware.com
Co-authored-by: Hongliang Liu lhongliang@vmware.com
Commit 2:
Use Service ClusterIPs as MC Service's Endpoints
The ServiceExport controller will only watch ServiceExport and
Service events, and wrap Service's ClusterIPs into a new Endpoint kind of
ResourceExport.
Signed-off-by: Lan Luo luola@vmware.com