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 3, 2020
1 parent 3f168c6 commit ce4c318
Show file tree
Hide file tree
Showing 24 changed files with 93 additions and 1,313 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,6 +1,6 @@
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 "".
Expand All @@ -12,11 +12,15 @@ data:
# 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 "udp"
collectingProtocol: "udp"
kind: ConfigMap
metadata:
labels:
app: flow-aggregator
name: flow-aggregator-configmap-ht56gf55k8
name: flow-aggregator-configmap-bt5t8c94dh
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 @@ -65,7 +73,7 @@ spec:
command:
- flow-aggregator
image: antrea/flow-aggregator
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
name: flow-aggregator
ports:
- containerPort: 4739
Expand All @@ -76,5 +84,5 @@ spec:
subPath: flow-aggregator.conf
volumes:
- configMap:
name: flow-aggregator-configmap-ht56gf55k8
name: flow-aggregator-configmap-bt5t8c94dh
name: flow-aggregator-config
4 changes: 4 additions & 0 deletions build/yamls/flow-aggregator/base/conf/flow-aggregator.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ flowCollectorAddr: ""
# 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 "udp"
collectingProtocol: "udp"
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.

Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ spec:
spec:
containers:
- name: flow-aggregator
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
3 changes: 3 additions & 0 deletions cmd/flow-aggregator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ type FlowAggregatorConfig struct {
// 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 "udp"
CollectingProtocol string `yaml:"collectingProtocol,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.flowCollectorAddr, o.exportInterval, o.collectingProtocol)
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 ce4c318

Please sign in to comment.