Skip to content

Commit

Permalink
Address comments for PR #2 of flow aggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongming Ding committed Dec 8, 2020
1 parent 3f168c6 commit dac13ee
Show file tree
Hide file tree
Showing 26 changed files with 117 additions and 1,336 deletions.
Binary file removed build/images/flowaggregator/main
Binary file not shown.
58 changes: 0 additions & 58 deletions build/images/flowaggregator/main.go

This file was deleted.

10 changes: 0 additions & 10 deletions build/yamls/base/conf/flow-aggregator.conf

This file was deleted.

20 changes: 14 additions & 6 deletions build/yamls/flow-aggregator.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
apiVersion: v1
data:
flow-aggregator.conf: |-
flow-aggregator.conf: |
# Provide the flow collector address as string with format <IP>:<port>[:<proto>], where proto is tcp or udp.
# If no L4 transport proto is given, we consider tcp as default.
# Defaults to "".
flowCollectorAddr: ""
externalFlowCollectorAddr: ""
# Provide flow export interval as a duration string. This determines how often the flow aggregator exports flow
# records to the flow collector.
# Flow export interval should be greater than or equal to 1s (one second).
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
# Defaults to "60s".
flowExportInterval: 60s
# Provide the protocol for flow aggregator collecting process, which is tcp or udp.
# Defaults to "tcp"
aggregatorFlowCollectorProtocol: "tcp"
kind: ConfigMap
metadata:
labels:
app: flow-aggregator
name: flow-aggregator-configmap-ht56gf55k8
name: flow-aggregator-configmap-b4899dtfdh
namespace: flow-aggregator
---
apiVersion: v1
Expand All @@ -28,12 +32,16 @@ metadata:
namespace: flow-aggregator
spec:
ports:
- port: 4739
- name: flow-aggregator-udp
port: 4739
protocol: UDP
targetPort: 4739
- name: flow-aggregator-tcp
port: 4739
protocol: TCP
targetPort: 4739
selector:
app: flow-aggregator
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -76,5 +84,5 @@ spec:
subPath: flow-aggregator.conf
volumes:
- configMap:
name: flow-aggregator-configmap-ht56gf55k8
name: flow-aggregator-configmap-b4899dtfdh
name: flow-aggregator-config
6 changes: 5 additions & 1 deletion build/yamls/flow-aggregator/base/conf/flow-aggregator.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Provide the flow collector address as string with format <IP>:<port>[:<proto>], where proto is tcp or udp.
# If no L4 transport proto is given, we consider tcp as default.
# Defaults to "".
flowCollectorAddr: ""
externalFlowCollectorAddr: ""

# Provide flow export interval as a duration string. This determines how often the flow aggregator exports flow
# records to the flow collector.
# Flow export interval should be greater than or equal to 1s (one second).
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
# Defaults to "60s".
flowExportInterval: 60s

# Provide the protocol for flow aggregator collecting process, which is tcp or udp.
# Defaults to "tcp"
aggregatorFlowCollectorProtocol: "tcp"
8 changes: 6 additions & 2 deletions build/yamls/flow-aggregator/base/flow-aggregator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ metadata:
spec:
selector:
app: flow-aggregator
type: NodePort
ports:
- port: 4739
- name: flow-aggregator-udp
port: 4739
protocol: UDP
targetPort: 4739
- name: flow-aggregator-tcp
port: 4739
protocol: TCP
targetPort: 4739
---
apiVersion: apps/v1
kind: Deployment
Expand Down
84 changes: 0 additions & 84 deletions build/yamls/flow-aggregator/flow-aggregator.yml

This file was deleted.

5 changes: 4 additions & 1 deletion cmd/flow-aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ type FlowAggregatorConfig struct {
// Provide the flow collector address as string with format <IP>:<port>[:<proto>], where proto is tcp or udp.
// If no L4 transport proto is given, we consider tcp as default.
// Defaults to "".
FlowCollectorAddr string `yaml:"flowCollectorAddr,omitempty"`
ExternalFlowCollectorProtocol string `yaml:"externalFlowCollectorAddr,omitempty"`
// Provide flow export interval as a duration string. This determines how often the flow aggregator exports flow
// records to the flow collector.
// Flow export interval should be greater than or equal to 1s (one second).
// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
// Defaults to "60s".
FlowExportInterval string `yaml:"flowExportInterval,omitempty"`
// Provide the protocol for flow aggregator collecting process, which is tcp or udp.
// Defaults to "tcp"
AggregatorFlowCollectorProtocol string `yaml:"aggregatorFlowCollectorProtocol,omitempty"`
}
2 changes: 1 addition & 1 deletion cmd/flow-aggregator/flow-aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func run(o *Options) error {
// cause the stopCh channel to be closed; if another signal is received before the program
// exits, we will force exit.
stopCh := signals.RegisterSignalHandlers()
flowAggregator := aggregator.NewFlowAggregator(o.flowCollectorAddr, o.exportFrequency)
flowAggregator := aggregator.NewFlowAggregator(o.externalFlowCollectorAddr, o.exportInterval, o.aggregatorFlowCollectorProtocol)
go flowAggregator.Run(stopCh)
<-stopCh
klog.Infof("Stopping flow aggregator")
Expand Down
11 changes: 0 additions & 11 deletions cmd/flow-aggregator/go.mod

This file was deleted.

Loading

0 comments on commit dac13ee

Please sign in to comment.