Skip to content

Commit b6c7a34

Browse files
author
Mario Macias
authored
Improved README and configuration documentation (#17)
1 parent 1d9a9b6 commit b6c7a34

File tree

3 files changed

+56
-7
lines changed

3 files changed

+56
-7
lines changed

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,42 @@
11
# Network Observability eBPF Agent
22

3-
Network Observability eBPF Agent.
3+
The Network Observability eBPF Agent allows collecting and aggregating all the ingress and
4+
egress flows on a Linux host (required a Kernel 4.18+ with eBPF enabled).
45

56
## How to compile
67

78
```
89
make build
910
```
1011

12+
## How to configure
13+
14+
The eBPF Agent is configured by means of environment variables. Check the
15+
[configuration documentation](./docs/config.md) for more details.
16+
1117
## How to run
1218

19+
The NetObserv eBPF Agent is designed to run as a DaemonSet in OpenShift/K8s. It is triggered and
20+
configured by our [Network Observability Operator](https://github.com/netobserv/network-observability-operator).
21+
22+
Anyway you can run it directly as an executable with administrative privileges:
23+
1324
```
14-
sudo bin/netobserv-ebpf-agent
25+
export FLOWS_TARGET_HOST=...
26+
export FLOWS_TARGET_PORT=...
27+
sudo -E bin/netobserv-ebpf-agent
1528
```
16-
(Pod deployment will come soon)
29+
30+
To deploy it as a Pod, you can check the [deployment example](./examples/performance/deployment.yml).
31+
32+
## Where is the collector?
33+
34+
As part of our Network Observability solution, the eBPF Agent is designed to send the traced
35+
flows to our [Flowlogs Pipeline](https://github.com/netobserv/flowlogs-pipeline) component.
36+
37+
In addition, we provide a simple GRPC+Protobuf library to allow implementing your own collector.
38+
Check the [packet counter code](./examples/performance/server/packet-counter-collector.go)
39+
for an example of a simple collector using our library.
1740

1841
## Development receipts
1942

docs/config.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# eBPF Agent configuration environment variables
2+
3+
The following environment variables are available to configure the NetObserv eBFP Agent:
4+
5+
* `FLOWS_TARGET_HOST` (required). Host name or IP of the target Flow collector.
6+
* `FLOWS_TARGET_PORT` (required). Port of the target flow collector.
7+
* `INTERFACES` (optional). Comma-separated list of the interface names from where flows will be collected. If
8+
empty, the agent will use all the interfaces in the system, excepting the ones listed in
9+
the `EXCLUDE_INTERFACES` variable.
10+
If an entry is enclosed by slashes (e.g. `/br-/`), it will match as regular expression,
11+
otherwise it will be matched as a case-sensitive string.
12+
* `EXCLUDE_INTERFACES` (default: `lo`). Comma-separated list of the interface names that will be
13+
excluded from flow tracing. It takes priority over `INTERFACES` values.
14+
If an entry is enclosed by slashes (e.g. `/br-/`), it will match as regular expression,
15+
otherwise it will be matched as a case-sensitive string.
16+
* `SAMPLING` (default: disabled). Rate at which packets should be sampled and sent to the target
17+
collector. E.g. if set to 10, one out of 10 packets, on average, will be sent to the target
18+
collector.
19+
* `CACHE_MAX_FLOWS` (default: `1000`). Number of flows that can be accumulated in the accounting
20+
cache. If the accounter reaches the max number of flows, it flushes them to the collector.
21+
* `CACHE_ACTIVE_TIMEOUT` (default: `5s`). Duration string that specifies the maximum duration
22+
that flows are kept in the accounting cache before being flushed to the collector.
23+
* `LOG_LEVEL` (default: `info`). From more to less verbose: `trace`, `debug`, `info`, `warn`,
24+
`error`, `fatal`, `panic`.
25+
* `BUFFERS_LENGTH` (default: `50`). Length of the internal communication channels between the different
26+
processing stages. Most probably you won't need to change this value.

pkg/agent/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
type Config struct {
1212
// TargetHost is the host name or IP of the target Flow collector
1313
TargetHost string `env:"FLOWS_TARGET_HOST,notEmpty"`
14-
// TargetHost is the port the target Flow collector
14+
// TargetPort is the port the target Flow collector
1515
TargetPort int `env:"FLOWS_TARGET_PORT,notEmpty"`
1616
// Interfaces contains the interface names from where flows will be collected. If empty, the agent
1717
// will fetch all the interfaces in the system, excepting the ones listed in ExcludeInterfaces.
@@ -27,15 +27,15 @@ type Config struct {
2727
// stages
2828
BuffersLength int `env:"BUFFERS_LENGTH" envDefault:"50"`
2929
// CacheMaxFlows specifies how many flows can be accumulated in the accounting cache before
30-
// being flushing the cache for its later export
30+
// being flushed for its later export
3131
CacheMaxFlows int `env:"CACHE_MAX_FLOWS" envDefault:"1000"`
32-
// CacheActiveTimeout specifies the maximum duration in which a flow is kept in the accounting
32+
// CacheActiveTimeout specifies the maximum duration that flows are kept in the accounting
3333
// cache before being flushed for its later export
3434
CacheActiveTimeout time.Duration `env:"CACHE_ACTIVE_TIMEOUT" envDefault:"5s"`
3535
// Logger level. From more to less verbose: trace, debug, info, warn, error, fatal, panic.
3636
LogLevel string `env:"LOG_LEVEL" envDefault:"info"`
3737
// Sampling holds the rate at which packets should be sampled and sent to the target collector.
38-
// E.g. if set to 100, one out of 100 packets, on average, will be sent to each target collector.
38+
// E.g. if set to 100, one out of 100 packets, on average, will be sent to the target collector.
3939
Sampling uint32 `env:"SAMPLING" envDefault:"0"`
4040
}
4141

0 commit comments

Comments
 (0)