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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d365b5f
Enable verbose logging through generate-manifest.sh (#1142)
srikartati Sep 14, 2020
301814f
Bug in PR#1142 (#1248)
srikartati Sep 14, 2020
a9a646c
[IPv6] Consume Node.Spec.CIDRs to support dual-stack configuration (#…
wenyingd Aug 7, 2020
b004976
[IPv6] Change openflow pipeline for L2 Pod networking (#1040)
mengdie-song Aug 12, 2020
5183f5c
[IPv6] Change host-local IPAM configuration for IPv6 (#1039)
mengdie-song Aug 19, 2020
4a62c45
[IPv6] Use separate fields for IPv4 and IPv6 in GatewayConfig (#1111)
mengdie-song Aug 21, 2020
a926dde
[IPv6] Implement L3 connectivity for IPv6 traffic (#1011)
wenyingd Aug 27, 2020
1468e91
[IPv6] Handle Spec.PodCIDR with IPv6 CIDR (#1151)
mengdie-song Aug 27, 2020
2f96a0b
[IPv6] Add support for IPv6 address in antctl and agent's apiserver (…
wenyingd Aug 28, 2020
210a8f3
[IPv6] Support IPv6 in e2e (#1129)
lzhecheng Aug 28, 2020
000fe89
[IPv6] Display dual stack NodeSubnet in antrea-octant-plugin (#1156)
mengdie-song Aug 28, 2020
295f952
[IPv6] Handle dual stack NodeSubnet for monitoring CRD (#1182)
mengdie-song Sep 2, 2020
39f2b71
[IPv6][e2e] Fix testDeletePod (#1193)
lzhecheng Sep 3, 2020
48f8eaf
[IPv6] Collect service CIDR in e2e
lzhecheng Sep 9, 2020
ff93d80
[IPv6] Add support for dual-stack when using kube-proxy for Service (…
wenyingd Sep 16, 2020
e70edd6
[IPv6] Extend e2e tests for dual-stack (#1192)
wenyingd Sep 18, 2020
3eb7a2d
[IPv6] E2e bug fixes (#1311)
lzhecheng Sep 28, 2020
c4de3a2
[IPv6] Fix TestReconcileGatewayRoutesOnStartup failure (#1313)
lzhecheng Sep 29, 2020
ab4ce42
[IPv6] adjust MTU for IPv6 overhead (#1305)
lzhecheng Sep 29, 2020
50cf482
[IPv6] Fix MTU config (#1317)
lzhecheng Sep 29, 2020
909035f
[IPv6] Skip IPsec e2e test (#1373)
lzhecheng Oct 15, 2020
905402a
[IPv6] Add 2 Network Policy tests (#1399)
lzhecheng Oct 20, 2020
41a0abc
Skip 2 Network Policy testcases before Network Policy IPv6 is support…
lzhecheng Oct 30, 2020
b265cb6
[IPv6] Fix after rebasing
lzhecheng Nov 5, 2020
5f6512d
[IPv6] Fix issues (#1496)
lzhecheng Nov 5, 2020
a31a432
[IPv6] Skip TestAntctlProxy for IPv6 (#1498)
lzhecheng Nov 5, 2020
3c5cdcf
[IPv6] Add IPv6 support for NetworkPolicy
wenyingd Oct 22, 2020
267d1c0
[IPv6] Fix issues
lzhecheng Nov 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/workflows/integration.yml

This file was deleted.

2 changes: 1 addition & 1 deletion ci/jenkins/jobs/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
- nobody123_nobody123_
only_trigger_phrase: false
trigger_permit_all: true
status_context: jenkins-integration
status_context: Integration tests
status_url: null
success_status: Build finished.
failure_status: Failed.
Expand Down
10 changes: 6 additions & 4 deletions pkg/agent/controller/noderoute/node_route_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ func newController(t *testing.T) (*fakeController, func()) {
routeClient := routetest.NewMockInterface(ctrl)
interfaceStore := interfacestore.NewInterfaceStore()
c := NewNodeRouteController(clientset, informerFactory, ofClient, ovsClient, routeClient, interfaceStore, &config.NetworkConfig{}, &config.NodeConfig{GatewayConfig: &config.GatewayConfig{
IP: nil,
MAC: gatewayMAC,
IPv4: nil,
MAC: gatewayMAC,
}})
return &fakeController{
Controller: c,
Expand Down Expand Up @@ -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.

c.ofClient.EXPECT().InstallNodeFlows("node1", gatewayMAC, gomock.Any(), nodeIP1, uint32(config.DefaultTunOFPort), uint32(0)).Times(1)
c.routeClient.EXPECT().AddRoutes(podCIDR, nodeIP1, podCIDRGateway).Times(1)
c.processNextWorkItem()

Expand All @@ -139,7 +140,8 @@ func TestControllerWithDuplicatePodCIDR(t *testing.T) {
c.processNextWorkItem()

// After node1 is deleted, routes and flows should be installed for node2 successfully.
c.ofClient.EXPECT().InstallNodeFlows("node2", gatewayMAC, *podCIDR, podCIDRGateway, nodeIP2, 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
c.ofClient.EXPECT().InstallNodeFlows("node2", gatewayMAC, gomock.Any(), nodeIP2, uint32(config.DefaultTunOFPort), uint32(0)).Times(1)
c.routeClient.EXPECT().AddRoutes(podCIDR, nodeIP2, podCIDRGateway).Times(1)
c.processNextWorkItem()
}()
Expand Down
8 changes: 5 additions & 3 deletions pkg/agent/openflow/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,12 @@ func (c *client) InstallTraceflowFlows(dataplaneTag uint8) error {
// Copy default drop rules
for _, ctx := range c.globalConjMatchFlowCache {
if ctx.dropFlow != nil {
copyFlowBuilder := ctx.dropFlow.CopyToBuilder(priorityNormal+2, false)
if ctx.dropFlow.FlowProtocol() == "" {
copyFlowBuilder = copyFlowBuilder.MatchProtocol(binding.ProtocolIP)
}
flows = append(
flows,
ctx.dropFlow.CopyToBuilder(priorityNormal+2, false).
MatchIPDscp(dataplaneTag).
flows, copyFlowBuilder.MatchIPDscp(dataplaneTag).
SetHardTimeout(300).
Action().SendToController(uint8(PacketInReasonTF)).
Done())
Expand Down
1 change: 1 addition & 0 deletions pkg/agent/openflow/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ func prepareTraceflowFlow(ctrl *gomock.Controller) *client {

mFlow := ovsoftest.NewMockFlow(ctrl)
ctx := &conjMatchFlowContext{dropFlow: mFlow}
mFlow.EXPECT().FlowProtocol().Return(ofconfig.Protocol("ip"))
mFlow.EXPECT().CopyToBuilder(priorityNormal+2, false).Return(c.pipeline[EgressDefaultTable].BuildFlow(priorityNormal + 2)).Times(1)
c.globalConjMatchFlowCache["mockContext"] = ctx
c.policyCache.Add(&policyRuleConjunction{metricFlows: []ofconfig.Flow{c.dropRuleMetricFlow(123, false)}})
Expand Down
52 changes: 26 additions & 26 deletions pkg/agent/openflow/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,33 @@ import (

const (
// Flow table id index
ClassifierTable binding.TableIDType = 0
uplinkTable binding.TableIDType = 5
spoofGuardTable binding.TableIDType = 10
arpResponderTable binding.TableIDType = 20
ipv6Table binding.TableIDType = 21
serviceHairpinTable binding.TableIDType = 29
conntrackTable binding.TableIDType = 30
conntrackStateTable binding.TableIDType = 31
sessionAffinityTable binding.TableIDType = 40
dnatTable binding.TableIDType = 40
serviceLBTable binding.TableIDType = 41
endpointDNATTable binding.TableIDType = 42
AntreaPolicyEgressRuleTable binding.TableIDType = 45
DefaultTierEgressRuleTable binding.TableIDType = 49
EgressRuleTable binding.TableIDType = 50
EgressDefaultTable binding.TableIDType = 60
EgressMetricTable binding.TableIDType = 61
l3ForwardingTable binding.TableIDType = 70
l2ForwardingCalcTable binding.TableIDType = 80
ClassifierTable binding.TableIDType = 0
uplinkTable binding.TableIDType = 5
spoofGuardTable binding.TableIDType = 10
arpResponderTable binding.TableIDType = 20
ipv6Table binding.TableIDType = 21
serviceHairpinTable binding.TableIDType = 29
conntrackTable binding.TableIDType = 30
conntrackStateTable binding.TableIDType = 31
sessionAffinityTable binding.TableIDType = 40
dnatTable binding.TableIDType = 40
serviceLBTable binding.TableIDType = 41
endpointDNATTable binding.TableIDType = 42
AntreaPolicyEgressRuleTable binding.TableIDType = 45
DefaultTierEgressRuleTable binding.TableIDType = 49
EgressRuleTable binding.TableIDType = 50
EgressDefaultTable binding.TableIDType = 60
EgressMetricTable binding.TableIDType = 61
l3ForwardingTable binding.TableIDType = 70
l2ForwardingCalcTable binding.TableIDType = 80
AntreaPolicyIngressRuleTable binding.TableIDType = 85
DefaultTierIngressRuleTable binding.TableIDType = 89
IngressRuleTable binding.TableIDType = 90
IngressDefaultTable binding.TableIDType = 100
IngressMetricTable binding.TableIDType = 101
conntrackCommitTable binding.TableIDType = 105
hairpinSNATTable binding.TableIDType = 106
L2ForwardingOutTable binding.TableIDType = 110
DefaultTierIngressRuleTable binding.TableIDType = 89
IngressRuleTable binding.TableIDType = 90
IngressDefaultTable binding.TableIDType = 100
IngressMetricTable binding.TableIDType = 101
conntrackCommitTable binding.TableIDType = 105
hairpinSNATTable binding.TableIDType = 106
L2ForwardingOutTable binding.TableIDType = 110

// Flow priority level
priorityHigh = uint16(210)
Expand Down
3 changes: 0 additions & 3 deletions pkg/agent/route/route_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@ func (c *Client) listRoutes() (map[string]*netroute.Route, error) {

// initFwRules adds Windows Firewall rules to accept the traffic that is sent to or from local Pods.
func (c *Client) initFwRules() error {
if c.nodeConfig.PodIPv4CIDR == nil {
return errors.New("no valid IPv4 PodCIDR")
}
err := c.fwClient.AddRuleAllowIP(inboundFirewallRuleName, winfirewall.FWRuleIn, c.nodeConfig.PodIPv4CIDR)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions pkg/ovs/openflow/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ type Flow interface {
OFEntry
// Returns the flow priority associated with OFEntry
FlowPriority() uint16
FlowProtocol() Protocol
MatchString() string
// CopyToBuilder returns a new FlowBuilder that copies the matches of the Flow.
// It copies the original actions of the Flow only if copyActions is set to true, and
Expand Down
4 changes: 4 additions & 0 deletions pkg/ovs/openflow/ofctrl_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ func (f *ofFlow) FlowPriority() uint16 {
return f.Match.Priority
}

func (f *ofFlow) FlowProtocol() Protocol {
return f.protocol
}

func (f *ofFlow) GetBundleMessage(entryOper OFOperation) (ofctrl.OpenFlowModMessage, error) {
var operation int
switch entryOper {
Expand Down
14 changes: 14 additions & 0 deletions pkg/ovs/openflow/testing/mock_openflow.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions plugins/octant/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ require (
)

replace (
<<<<<<< HEAD
github.com/contiv/ofnet => github.com/wenyingd/ofnet v0.0.0-20201109024835-6fd225d8c8d1
=======
github.com/contiv/ofnet => github.com/wenyingd/ofnet v0.0.0-20200728094531-d5b4d75f2cc3
>>>>>>> 964affb ([IPv6] Change openflow pipeline for L2 Pod networking (#1040))
github.com/vmware-tanzu/antrea => ../../
// Octant v0.13.1 and Antrea use different versions of github.com/googleapis/gnostic.
// Octant v0.13.1 uses v0.4.1 and Antrea uses v0.1.0.
Expand Down
2 changes: 1 addition & 1 deletion test/integration/agent/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func TestIPv6RoutesAndNeighbors(t *testing.T) {
NodeIPAddr: nodeIP,
GatewayConfig: dualGWConfig,
}
err = routeClient.Initialize(dualNodeConfig)
err = routeClient.Initialize(dualNodeConfig, func() {})
assert.Nil(t, err)

tcs := []struct {
Expand Down