33The Network Observability eBPF Agent allows collecting and aggregating all the ingress and
44egress flows on a Linux host (required a Kernel 4.18+ with eBPF enabled).
55
6+ * [ How to compile] ( #how-to-compile )
7+ * [ Hot to configure] ( #how-to-configure )
8+ * [ How to run] ( #how-to-run )
9+ * [ Development receipts] ( #development-receipts )
10+ * [ Known issues] ( #known-issues )
11+ * [ Frequently-asked questions] ( #frequently-asked-questions )
12+ * [ Troubleshooting] ( #troubleshooting )
13+
614## How to compile
715
816```
@@ -19,24 +27,56 @@ The eBPF Agent is configured by means of environment variables. Check the
1927The NetObserv eBPF Agent is designed to run as a DaemonSet in OpenShift/K8s. It is triggered and
2028configured by our [ Network Observability Operator] ( https://github.com/netobserv/network-observability-operator ) .
2129
22- Anyway you can run it directly as an executable with administrative privileges :
30+ Anyway you can run it directly as an executable from your command line :
2331
2432```
2533export FLOWS_TARGET_HOST=...
2634export FLOWS_TARGET_PORT=...
2735sudo -E bin/netobserv-ebpf-agent
2836```
37+
2938To deploy locally, use instructions from [ flowlogs-dump (like tcpdump)] ( ./examples/flowlogs-dump/README.md ) .
30- To deploy it as a Pod, you can check the [ deployment example] ( ./examples/performance/deployment.yml ) .
39+ To deploy it as a Pod, you can check the [ deployment examples] ( ./deployments ) .
40+
41+ The Agent needs to be executed either with:
42+
43+ 1 . The following [ Linux capabilities] ( https://man7.org/linux/man-pages/man7/capabilities.7.html )
44+ (recommended way): ` BPF ` , ` PERFMON ` , ` NET_ADMIN ` , ` SYS_RESOURCE ` . If you
45+ [ deploy it in Kubernetes or OpenShift] ( ./deployments/flp-daemonset-cap.yml ) ,
46+ the container running the Agent needs to define the following ` securityContext ` :
47+ ``` yaml
48+ securityContext :
49+ runAsUser : 0
50+ capabilities :
51+ add :
52+ - BPF
53+ - PERFMON
54+ - NET_ADMIN
55+ - SYS_RESOURCE
56+ ` ` `
57+ (Please notice that the ` runAsUser: 0` is still needed).
58+ 2. Administrative privileges. If you
59+ [deploy it in Kubernetes or OpenShift](./deployments/flp-daemonset.yml),
60+ the container running the Agent needs to define the following `securityContext` :
61+ ` ` ` yaml
62+ securityContext:
63+ privileged: true
64+ runAsUser: 0
65+ ` ` `
66+ This option is only recommended if your Kernel does not recognize some of the above capabilities.
67+ We found some Kubernetes distributions (e.g. K3s) that do not recognize the `BPF` and
68+ ` PERFMON` capabilities.
69+
70+ Here is a list of distributions where we tested both full privileges and capability approaches,
71+ and whether they worked (✅) or did not (❌) :
72+
73+ | Distribution | K8s Server version | Capabilities | Privileged |
74+ |-------------------------------|--------------------|--------------|------------|
75+ | Amazon EKS (Bottlerocket AMI) | 1.22.6 | ✅ | ✅ |
76+ | K3s (Rancher Desktop) | 1.23.5 | ❌ | ✅ |
77+ | Kind | 1.23.5 | ❌ | ✅ |
78+ | OpenShift | 1.23.3 | ✅ | ✅ |
3179
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.
4080
4181# # Development receipts
4282
@@ -62,7 +102,38 @@ Tested in Fedora 35 and Red Hat Enterprise Linux 8.
62102
63103# # Known issues
64104
65- ## Extrenal Traffic in Openshift (OVN-Kubernetes CNI)
105+ # ## Extrenal Traffic in Openshift (OVN-Kubernetes CNI)
66106
67107For egress traffic, you can see the source Pod metadata. For ingress traffic (e.g. an HTTP response),
68- you see the destination ** Host** metadata.
108+ you see the destination **Host** metadata.
109+
110+ # # Frequently-asked questions
111+
112+ # ## Where is the collector?
113+
114+ As part of our Network Observability solution, the eBPF Agent is designed to send the traced
115+ flows to our [Flowlogs Pipeline](https://github.com/netobserv/flowlogs-pipeline) component.
116+
117+ In addition, we provide a simple GRPC+Protobuf library to allow implementing your own collector.
118+ Check the [packet counter code](./examples/performance/server/packet-counter-collector.go)
119+ for an example of a simple collector using our library.
120+
121+ # # Troubleshooting
122+
123+ # ## Deployed as a Kubernetes Pod, the agent shows permission errors in the logs and can't start
124+
125+ In your [deployment file](./deployments/flp-daemonset-cap.yml), make sure that the container runs as
126+ the root user (`runAsUser : 0`) and with the granted capabilities or privileges (see [how to run](#how-to-run) section).
127+
128+ # ## The Agent doesn't work in my Amazon EKS puzzle
129+
130+ Despite Amazon Linux 2 enables eBPF by default in EC2, the
131+ [EKS images are shipped with disabled eBPF](https://github.com/awslabs/amazon-eks-ami/issues/728).
132+
133+ You'd need either :
134+
135+ 1. Provide your own AMI configured to work with eBPF
136+ 2. Use other Linux distributions that are shipped with eBPF enabled by default. We have successfully
137+ tested the eBPF Agent in EKS with the [Bottlerocket](https://aws.amazon.com/es/bottlerocket/)
138+ Linux distribution, without requiring any extra configuration.
139+
0 commit comments