Skip to content

Commit 7c11035

Browse files
committed
bpfman-operator: Support Load/Attach Split
This commit introduces support for bpfman’s load-attach split from bpfman PR refactoring and CRD changes to align with this new model. Key Changes: - Remove "*Program" CRDs and related code in favor of the BpfApplication CRD, which can contain multiple eBPF programs. - Replace BpfProgram CRD with BpfApplicationState, which stores per-node state information for all eBPF programs in a BpfApplication. - Rename CRDs for better alignment with Kubernetes conventions: - BpfApplication => ClusterBpfApplication (Cluster-scoped) - BpfNsApplication => BpfApplication (Namespace-scoped) - The BpfApplication CRDs have been modified to include an optional list of attach points for each program, enabling pre-loading programs before attachment and supporting dynamic attachment updates. - Redesign the bpfman-agent controller to natively support BpfApplications. Fixes: #397 Signed-off-by: Andre Fredette <[email protected]>
1 parent b299c46 commit 7c11035

File tree

347 files changed

+19634
-46553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+19634
-46553
lines changed

PROJECT

+3-92
Original file line numberDiff line numberDiff line change
@@ -11,69 +11,6 @@ plugins:
1111
projectName: bpfman-operator
1212
repo: github.com/bpfman
1313
resources:
14-
- api:
15-
crdVersion: v1
16-
controller: true
17-
domain: bpfman.io
18-
kind: BpfProgram
19-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
20-
version: v1alpha1
21-
- api:
22-
crdVersion: v1
23-
controller: true
24-
domain: bpfman.io
25-
kind: XdpProgram
26-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
27-
version: v1alpha1
28-
- api:
29-
crdVersion: v1
30-
controller: true
31-
domain: bpfman.io
32-
kind: TcProgram
33-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
34-
version: v1alpha1
35-
- api:
36-
crdVersion: v1
37-
controller: true
38-
domain: bpfman.io
39-
kind: TcxProgram
40-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
41-
version: v1alpha1
42-
- api:
43-
crdVersion: v1
44-
controller: true
45-
domain: bpfman.io
46-
kind: TracePointProgram
47-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
48-
version: v1alpha1
49-
- api:
50-
crdVersion: v1
51-
controller: true
52-
domain: bpfman.io
53-
kind: KprobeProgram
54-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
55-
version: v1alpha1
56-
- api:
57-
crdVersion: v1
58-
controller: true
59-
domain: bpfman.io
60-
kind: UprobeProgram
61-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
62-
version: v1alpha1
63-
- api:
64-
crdVersion: v1
65-
controller: true
66-
domain: bpfman.io
67-
kind: FentryProgram
68-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
69-
version: v1alpha1
70-
- api:
71-
crdVersion: v1
72-
controller: true
73-
domain: bpfman.io
74-
kind: FexitProgram
75-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
76-
version: v1alpha1
7714
- api:
7815
crdVersion: v1
7916
controller: true
@@ -86,47 +23,21 @@ resources:
8623
namespaced: true
8724
controller: true
8825
domain: bpfman.io
89-
kind: BpfNsProgram
90-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
91-
version: v1alpha1
92-
- api:
93-
crdVersion: v1
94-
namespaced: true
95-
controller: true
96-
domain: bpfman.io
97-
kind: XdpNsProgram
26+
kind: ClusterBpfApplication
9827
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
9928
version: v1alpha1
10029
- api:
10130
crdVersion: v1
102-
namespaced: true
10331
controller: true
10432
domain: bpfman.io
105-
kind: TcNsProgram
33+
kind: BpfApplicationState
10634
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
10735
version: v1alpha1
10836
- api:
10937
crdVersion: v1
110-
namespaced: true
111-
controller: true
112-
domain: bpfman.io
113-
kind: TcxNsProgram
114-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
115-
version: v1alpha1
116-
- api:
117-
crdVersion: v1
118-
namespaced: true
119-
controller: true
120-
domain: bpfman.io
121-
kind: UprobeNsProgram
122-
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
123-
version: v1alpha1
124-
- api:
125-
crdVersion: v1
126-
namespaced: true
12738
controller: true
12839
domain: bpfman.io
129-
kind: BpfNsApplication
40+
kind: ClusterBpfApplicationState
13041
path: github.com/bpfman/bpfman-operator/apis/v1alpha1
13142
version: v1alpha1
13243
version: "3"

TODO.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Intro
2+
3+
The operator is integrated with Dave's load/attach split code.
4+
5+
# Testing:
6+
7+
- Unit tests for the agent and the operator
8+
- All sample yamls work (except for bpfman.io_v1alpha1_test1_clusterbpfapplication.yaml which is a negative test.)
9+
10+
# TODO:
11+
12+
(In no particular order.)
13+
14+
- Scrub logs (need to remove some and make some Info logs Debug)
15+
- Figure out why `k apply -f
16+
config/samples/bpfman.io_v1alpha1_test1_clusterbpfapplication.yaml` works for
17+
kprobe, fentry and fexit, but is rejected for the other program types.
18+
- Delete the "test" sample programs when I'm done using them for testing.
19+
- Get the bpfman examples and regression tests working (probably after)
20+
21+
# TODO (After merge)
22+
- Possibly more of the scrubbing mentioned above.
23+
- Make more of the bpfman-agent controller code common.
24+
- Change ContainerSelector to PodSelector for xdp, tc and tcx programs. xdp, tc
25+
and tcx programs can't attach to multiple containers in a pod because they are
26+
all in the same namespace. Technically, xdp and tc can because of the way we
27+
implemented the dispatchers, but it probably doesn't make sense. Tcx errors
28+
out if you try to do it.
29+
- Update documentation

apis/v1alpha1/bpfApplication_types.go

-168
This file was deleted.

0 commit comments

Comments
 (0)