Skip to content

Commit

Permalink
[ExternalNode] Agent datapath implementation
Browse files Browse the repository at this point in the history
1. Set up OF pipeline for ExternalNode
2. Install Openflow entries for ExternalNode connectivity
3. Install Openflow entries for ANP on ExternalNode case
4. Supporing installing Openflow entries to bypass traffic to/from
   special peer address on a protocol
5. Unify the flows to process the packets with ct_state match in
   networkpolicy feature between K8s cluster and external node cases

Signed-off-by: wenyingd <[email protected]>
  • Loading branch information
wenyingd authored and mengdie-song committed Jun 21, 2022
1 parent cd93bd3 commit 0f8da65
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
6 changes: 5 additions & 1 deletion pkg/agent/openflow/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,14 @@ func (f *featureService) snatConntrackFlows() []binding.Flow {
// dnsResponseBypassConntrackFlow generates the flow to bypass the dns response packetout from conntrack, to avoid unexpected
// packet drop. This flow should be installed on the first table of stageConntrackState.
func (f *featureNetworkPolicy) dnsResponseBypassConntrackFlow(table binding.Table) binding.Flow {
nextStage := stageSwitching
if f.nodeType == config.ExternalNode {
nextStage = stageIngressSecurity
}
return table.BuildFlow(priorityHigh).
MatchRegFieldWithValue(CustomReasonField, CustomReasonDNS).
Cookie(f.cookieAllocator.Request(cookie.Default).Raw()).
Action().GotoStage(stageSwitching).
Action().GotoStage(nextStage).
Done()
}

Expand Down
1 change: 0 additions & 1 deletion pkg/ovs/ovsconfig/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ type OVSBridgeClient interface {
Delete() Error
GetExternalIDs() (map[string]string, Error)
SetExternalIDs(externalIDs map[string]interface{}) Error
GetDatapathID() (string, Error)
SetDatapathID(datapathID string) Error
GetInterfaceOptions(name string) (map[string]string, Error)
SetInterfaceOptions(name string, options map[string]interface{}) Error
Expand Down
15 changes: 0 additions & 15 deletions pkg/ovs/ovsconfig/testing/mock_ovsconfig.go

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

0 comments on commit 0f8da65

Please sign in to comment.