Skip to content

Commit fc0d5b8

Browse files
authored
NETOBSERV-1899 hack ipfix capture (#729)
* hack ipfix capture * reuse K8S fields for better UX
1 parent e179f45 commit fc0d5b8

File tree

8 files changed

+905
-0
lines changed

8 files changed

+905
-0
lines changed

.mk/development.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ ocp-deploy: ocp-cleanup deploy-prometheus deploy-loki deploy-grafana deploy ## D
138138
@loki_url=$$(oc get route loki -o jsonpath='{.spec.host}'); \
139139
echo -e "\nAccess loki on OCP using: http://"$$loki_url"\n"
140140

141+
.PHONY: ipfix-capture
142+
ipfix-capture:
143+
./hack/docker-ipfix.sh
144+
141145
.PHONY: ocp-cleanup
142146
ocp-cleanup: undeploy undeploy-loki undeploy-prometheus undeploy-grafana ## Undeploy from OCP
143147

hack/docker-ipfix.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
3+
name=ipfix-observ
4+
lokiName=$name-loki
5+
consoleName=$name-console
6+
7+
echo "Running $name using docker"
8+
docker create --name $name --net=host quay.io/netobserv/flowlogs-pipeline:main --config=/root/config.yaml --log-level=debug
9+
docker create --name $consoleName --net=host quay.io/netobserv/network-observability-standalone-frontend:main --config=/root/config.yaml --loglevel=trace
10+
docker run -d --name $lokiName --net=host grafana/loki
11+
12+
docker cp ./hack/examples/docker-ipfix-config.yaml $name:/root/config.yaml
13+
docker start $name
14+
15+
docker cp ./hack/examples/docker-console-config.yaml $consoleName:/root/config.yaml
16+
docker start $consoleName
17+
18+
stopAndRemove() {
19+
docker stop $1
20+
docker rm $1
21+
}
22+
23+
exitFunc() {
24+
echo "Stopping $name..."
25+
stopAndRemove $name
26+
stopAndRemove $lokiName
27+
stopAndRemove $consoleName
28+
exit 0
29+
}
30+
31+
trap exitFunc SIGINT SIGTERM
32+
docker logs --follow $name

0 commit comments

Comments
 (0)