• Stars
    star
    5,712
  • Rank 6,765 (Top 0.2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 4 years ago
  • Updated 14 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ebpf-go is a pure-Go library to read, modify and load eBPF programs and attach them to various hooks in the Linux kernel.

eBPF

PkgGoDev

HoneyGopher

ebpf-go is a pure Go library that provides utilities for loading, compiling, and debugging eBPF programs. It has minimal external dependencies and is intended to be used in long running processes.

See ebpf.io for complementary projects from the wider eBPF ecosystem.

Getting Started

A small collection of Go and eBPF programs that serve as examples for building your own tools can be found under examples/.

Contributions are highly encouraged, as they highlight certain use cases of eBPF and the library, and help shape the future of the project.

Getting Help

The community actively monitors our GitHub Discussions page. Please search for existing threads before starting a new one. Refrain from opening issues on the bug tracker if you're just starting out or if you're not sure if something is a bug in the library code.

Alternatively, join the #ebpf-go channel on Slack if you have other questions regarding the project. Note that this channel is ephemeral and has its history erased past a certain point, which is less helpful for others running into the same problem later.

Packages

This library includes the following packages:

  • asm contains a basic assembler, allowing you to write eBPF assembly instructions directly within your Go code. (You don't need to use this if you prefer to write your eBPF program in C.)
  • cmd/bpf2go allows compiling and embedding eBPF programs written in C within Go code. As well as compiling the C code, it auto-generates Go code for loading and manipulating the eBPF program and map objects.
  • link allows attaching eBPF to various hooks
  • perf allows reading from a PERF_EVENT_ARRAY
  • ringbuf allows reading from a BPF_MAP_TYPE_RINGBUF map
  • features implements the equivalent of bpftool feature probe for discovering BPF-related kernel features using native Go.
  • rlimit provides a convenient API to lift the RLIMIT_MEMLOCK constraint on kernels before 5.11.
  • btf allows reading the BPF Type Format.

Requirements

  • A version of Go that is supported by upstream
  • Linux >= 4.9. CI is run against kernel.org LTS releases. 4.4 should work but is not tested against.

Regenerating Testdata

Run make in the root of this repository to rebuild testdata in all subpackages. This requires Docker, as it relies on a standardized build environment to keep the build output stable.

It is possible to regenerate data using Podman by overriding the CONTAINER_* variables: CONTAINER_ENGINE=podman CONTAINER_RUN_ARGS= make.

The toolchain image build files are kept in testdata/docker/.

License

MIT

eBPF Gopher

The eBPF honeygopher is based on the Go gopher designed by Renee French.

More Repositories

1

cilium

eBPF-based Networking, Security, and Observability
Go
18,311
star
2

hubble

Hubble - Network, Service & Security Observability for Kubernetes using eBPF
Go
3,218
star
3

tetragon

eBPF-based Security Observability and Runtime Enforcement
Go
3,195
star
4

pwru

Packet, where are you? -- eBPF-based Linux kernel networking debugger
C
2,354
star
5

cilium-cli

CLI to install, manage & troubleshoot Kubernetes clusters running Cilium
Go
354
star
6

hubble-ui

Observability & Troubleshooting for Kubernetes Services
TypeScript
343
star
7

proxy

Envoy with Cilium filters
C++
118
star
8

cilium-service-mesh-beta

Instructions and issue tracking for Service Mesh capabilities of Cilium
106
star
9

k8s-iptables-diagram

Diagram of Kubernetes / kube-proxy iptables rules architecture
104
star
10

hubble-otel

Hubble adaptor for OpenTelemetry
Go
67
star
11

little-vm-helper

tool for building and running VMs for development and testing
Go
52
star
12

cilium-perf-networking

Utilities for Cilium networking performance evaluation
Shell
51
star
13

team-manager

Bot to manage team members in GitHub organizations
Go
49
star
14

bpf-map

Generic tool to inspect BPF maps
Go
43
star
15

coverbee

Code coverage tooling for eBPF
Go
31
star
16

charts

Helm charts repository for the Cilium project
Shell
30
star
17

chaos-testing-examples

Examples of using Cilium for chaos testing and fault injection
Shell
27
star
18

cilium.io

Cilium project website
JavaScript
27
star
19

cilium-etcd-operator

Operator to manage Cilium's etcd cluster
Go
26
star
20

star-wars-demo

Cilium Star Wars Demo
Shell
25
star
21

workerpool

Run tasks concurrently with limits
Go
23
star
22

k8s-1abel

Kubernetes YAML/JSON survival kit
TypeScript
22
star
23

fake

A Go library to generate random data for testing and/or performance evaluation
Go
19
star
24

design-cfps

Repo to store Cilium CFP design docs
19
star
25

certgen

A convenience tool to generate and store certificates for Hubble Relay mTLS
Go
17
star
26

microscope

[DEPRECATED: See https://github.com/cilium/hubble/] Gather monitor data data from all cilium nodes in your cluster
Python
17
star
27

cilium-sysdump

Tool to collect system information to troubleshoot Cilium & Hubble related issues
Python
16
star
28

ci-kernels

A collection of kernels used for CI builds
Shell
14
star
29

installfest

Documentation and resources for Cilium Installfest
14
star
30

image-tools

Dockerfiles for cilium-runtime and cilium-builder dependencies
Shell
13
star
31

echoserver

k8s.gcr.io/echoserver fork
Dockerfile
13
star
32

json-mock

Simple container image for json-server to mock REST/JSON APIs
Makefile
11
star
33

cilium-olm

Smarty
10
star
34

packer-ci-build

Contains the scripts and data for building the Cilium CI testing VM.
Shell
10
star
35

little-vm-helper-images

Dockerfile
10
star
36

cilium-l4lb-test

Repo for containing scripts to test Cilium's L4LB
C
9
star
37

ipam

Go
8
star
38

gke

Guide & scripts for deploying Cilium on GKE
Shell
7
star
39

scaffolding

Set of tools and resources for automating performance tests.
Go
7
star
40

community

Here you can find community content around Cilium
Shell
7
star
41

clustermesh-apiserver

API server for ClusterMesh
Go
7
star
42

client-example

Cilium API example
Go
7
star
43

alpine-curl

Container image for curl client
Makefile
6
star
44

chaos-monkeys

Base infrastructure plus collection of tests to assist in the Cilium chaos testing efforts
Shell
6
star
45

release

Repository used to generate release notes for Cilium releases
Go
5
star
46

misc-scripts

Misc netperf scripts
Shell
5
star
47

github-actions

Repository dedicated for the GitHub actions logic executed in cilium/cilium. Also known as the maintainer's little helper (MLH).
Go
5
star
48

arping

Go
5
star
49

kube-apate

Go
4
star
50

clustermesh-tools

Tooling to set up a cluster mesh
Shell
4
star
51

cilium-perf-test

Go
4
star
52

docsearch-scraper-webhook

Python
4
star
53

xdp-config

XDP config quirks / troubleshooting documents
Shell
4
star
54

terraform-gke-ci-management-cluster

Terraform module for GKE CI management cluster
HCL
4
star
55

statedb

Go
4
star
56

openshift-terraform-upi

HCL
3
star
57

customvet

Custom Go Vet tool for the Cilium Repository
Go
3
star
58

starwars-docker

Deathstar as a Service
Go
2
star
59

ubuntu-curl

Container image for curl client
Makefile
2
star
60

kustomize-bases

A collection of kustomize bases used for demos
2
star
61

helm-toolbox

Set of tools that are useful for linting helm charts and generating documentation
Dockerfile
2
star
62

echoserver-udp

Container image serving a dynamic TFTP page similar to cilium/echoserver
Go
2
star
63

.github

2
star
64

hive

Hive dependency injection
Go
2
star
65

scruffy

Utility to garbage collect docker image tags from quay.io
Go
1
star
66

reusable-workflows

1
star
67

bpf-ci-scripts

Make testing BPF trees easier with Jenkins
Shell
1
star
68

ebpf.io-summit

JavaScript
1
star
69

linters

Go
1
star
70

stale-rules

A tool to detect and remove stale routing rules
Go
1
star
71

star-wars-demo-automated

Shell
1
star
72

go-bindata

Go
1
star
73

log-gatherer

Dockerfile
1
star
74

api-router

Simple HTTP API router
Go
1
star
75

state-writer

Restore endpoint state from API and write to disk
Go
1
star
76

graceful-termination-test-apps

Apps to test graceful termination
Go
1
star
77

affinity-test-apps

Apps to test connection affinity with load-balancing endpoint updates
Go
1
star
78

test-connection-disruption

Testing connection interruptions during Cilium upgrades
Go
1
star
79

dummylb

Dummy k8s LB used for testing
Go
1
star
80

little-vm-helper-action

1
star
81

busybox

C
1
star