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

[IPv6] Merge IPv6 branch to master #1518

Merged
merged 28 commits into from
Nov 11, 2020
Merged

[IPv6] Merge IPv6 branch to master #1518

merged 28 commits into from
Nov 11, 2020

Conversation

lzhecheng
Copy link
Contributor

@lzhecheng lzhecheng commented Nov 9, 2020

Overview of IPv6 support:

  • L2 & L3 dual-stack and IPv6-only traffic
  • Kube-proxy as service
  • Antctl in IPv6 envinronment
  • Dual-stack NodeSubnet in antrea-octant-plugin
  • Adjust original e2e tests and CI pipeline
  • Extend e2e tests

The last commit is to solve some issues after rebasing.
24c6c70

  • remove Github Actions integration test. Integration Jenkins job name in check: jenkins-integration -> Integration tests
  • go fmt
  • add FlowProtocl() to interface Flow to solve traceflow test failure
  • remove extra lines when rebasing for an octant commit
  • TestIPv6RoutesAndNeighbors: routeClient.Initialize() should have 2 input values.

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-all-features-conformance: to trigger conformance tests with all alpha features enabled.
  • /skip-all-features-conformance: to skip conformance tests with all alpha features enabled.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

@lzhecheng
Copy link
Contributor Author

/test-all
/test-ipv6-all
/test-ipv6-only-all

@codecov-io
Copy link

codecov-io commented Nov 10, 2020

Codecov Report

Merging #1518 (267d1c0) into master (6c1a913) will decrease coverage by 5.23%.
The diff coverage is 63.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1518      +/-   ##
==========================================
- Coverage   67.79%   62.55%   -5.24%     
==========================================
  Files         169      167       -2     
  Lines       13503    13969     +466     
==========================================
- Hits         9154     8739     -415     
- Misses       3407     4320     +913     
+ Partials      942      910      -32     
Flag Coverage Δ
integration-tests ?
kind-e2e-tests 54.16% <57.09%> (-1.41%) ⬇️
unit-tests 40.99% <33.76%> (-0.25%) ⬇️

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

Impacted Files Coverage Δ
cmd/antrea-agent/agent.go 0.00% <0.00%> (ø)
cmd/antrea-agent/options.go 20.72% <0.00%> (-0.78%) ⬇️
pkg/agent/cniserver/ipam/ipam_service.go 63.15% <ø> (-7.90%) ⬇️
pkg/antctl/antctl.go 100.00% <ø> (ø)
pkg/controller/querier/querier.go 100.00% <ø> (ø)
pkg/ovs/ovsctl/appctl.go 28.35% <9.52%> (-5.58%) ⬇️
pkg/agent/util/net.go 51.28% <18.18%> (-13.01%) ⬇️
pkg/agent/route/route_linux.go 44.09% <24.60%> (-22.11%) ⬇️
pkg/agent/agent.go 48.71% <37.73%> (-2.42%) ⬇️
pkg/agent/apiserver/handlers/agentinfo/handler.go 38.23% <50.00%> (ø)
... and 56 more

@lzhecheng
Copy link
Contributor Author

/test-e2e

@lzhecheng
Copy link
Contributor Author

/test-all
/test-ipv6-all
/test-ipv6-only-all

@lzhecheng
Copy link
Contributor Author

@tnqn @jianjuns , could you please help review this PR? The next release is around the corner.

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

7 similar comments
@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

jianjuns
jianjuns previously approved these changes Nov 10, 2020
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 checked the last commit. Let me know if any other thing I should pay attention.

When you merge the PR, could you try merging and appending enough descriptions about the changes from all commits.

@jianjuns
Copy link
Contributor

There is a typo in the commit message:

FlowProtocl()

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

1 similar comment
@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

wenyingd and others added 13 commits November 11, 2020 15:28
…1200)

1. Add a config item for IPv6 Serivce CIDR if using kube-proxy to
   provide Service functions.
2. Output IPv6 traffic from host gateway if its destination is a
   Service address.
3. Use ct_mark to identify Service traffic and output the reply
   packet to the host gateway to ensure the DNAT processing in iptables.
1. Extend generic functions "podWaitForIP" to return all assigned
   IPs of a given Pod.
2. Validate each IP address in the cluster's network CIDR
3. Use each valid IP to check connectivity.
4. Use each valid IP to execute tests.
1. No -6 option in busybox nc
So, no need to distinguish if it is an IPv6 environment for runNetcatCommandFromTestPod()
nc
BusyBox v1.31.1 (2019-10-28 18:40:01 UTC) multi-call binary.

Usage: nc [OPTIONS] HOST PORT  - connect
nc [OPTIONS] -l -p PORT [HOST] [PORT]  - listen

	-e PROG	Run PROG after connect (must be last)
	-l	Listen mode, for inbound connects
	-lk	With -e, provides persistent server
	-p PORT	Local port
	-s ADDR	Local address
	-w SEC	Timeout for connects and final net reads
	-i SEC	Delay interval for lines sent
	-n	Don't do DNS resolution
	-u	UDP mode
	-v	Verbose
	-o FILE	Hex dump traffic
	-z	Zero-I/O mode (scanning)
2. testCert
* IPv6 address should be in "[]"
If Antrea MTU is too large in IPv6 environment, large packet with overhead exceeds node MTU cannot be transmitted successfully across nodes.
IPv6ExtraOverhead, 20 is from observation of IPv4 and IPv6 packets under same situation.
Use Node's internal address to decide if extra IPv6 overhead is needed.
* With OVS v2.14.0, IPsec in IPv6 envinronment is not supported.
* More user-friendly output for PodIPs.
From:
Retrieved all Pod IPs: map[test-pod-0-upgp1ung:0xc000708960 test-pod-1-pbva9007:0xc0006ec8a0]
To:
Retrieved all Pod IPs: map[test-pod-0-mudzj847:IPv6: fd74:ca9b:172:16::4, IP strings: fd74:ca9b:172:16::4 test-pod-1-apcmyd30:IPv6: fd74:ca9b:172:16:1::3c, IP strings: fd74:ca9b:172:16:1::3c]
2 upstream Network Policy tests didn't consider netmask for IPv6, this patch
is to add correct tests. When bug is fixed in latest release, these 2 tests can be deleted.
Kubernetes PR:
kubernetes/kubernetes#93583
2 testcases:
https://github.com/kubernetes/kubernetes/blob/v1.20.0-alpha.0/test/e2e/network/network_policy.go#L1365
https://github.com/kubernetes/kubernetes/blob/v1.20.0-alpha.0/test/e2e/network/network_policy.go#L1444
* format code
* fix TestPodTrafficShaping
* fix TestIPv6RoutesAndNeighbors
* unit test
* manifest
1. Add enhancement in Antrea Controller and Agent to support NetworkPolicy
   in IPv6.
2. Optimize test cases to support IPv6
3. Use regex in CRD to validate IPv4 or IPv6 string
4. Add TestEgressToServerInCIDRBlock and TestEgressToServerInCIDRBlockWithException
5. networkpolicy_controller.go: PodIPs includes PodIP
* remove Github Actions integration test, Jenkins: jenkins-integration
-> Integration tests
* go fmt
* add FlowProtocl() to interface Flow
* remove extra lines when rebasing for an octant commit
* TestIPv6RoutesAndNeighbors: routeClient.Initialize
@lzhecheng
Copy link
Contributor Author

/test-all
/test-ipv6-all
/test-ipv6-only-all

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

3 similar comments
@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

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

@@ -124,7 +124,8 @@ func TestControllerWithDuplicatePodCIDR(t *testing.T) {
defer close(finishCh)

c.clientset.CoreV1().Nodes().Create(context.TODO(), node1, metav1.CreateOptions{})
c.ofClient.EXPECT().InstallNodeFlows("node1", gatewayMAC, *podCIDR, podCIDRGateway, nodeIP1, uint32(config.DefaultTunOFPort), uint32(0)).Times(1)
// The 2nd argument is Any() because it is not safe to use pointer as key in a map. peerConfigs map[*net.IPNet]net.IP
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// The 2nd argument is Any() because it is not safe to use pointer as key in a map. peerConfigs map[*net.IPNet]net.IP
// The 2nd argument is Any() because the argument is unpredictable when it uses pointer as the key of map. The argument type is map[*net.IPNet]net.IP.

But we could improve it later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants