From 8ad536eb1252700bec6793bf9dd430f635e84142 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Thu, 23 Nov 2023 12:04:39 +0000 Subject: [PATCH] Rename all of the things! Signed-off-by: Dave Tucker --- .github/workflows/build.yml | 77 ++-- .github/workflows/image-build.yaml | 93 +++-- .github/workflows/put-issue-in-project.yaml | 6 +- .licenserc.yaml | 8 +- .vscode/settings.json | 2 +- .yamllint.yaml | 8 +- CODEOWNERS | 14 +- CONTRIBUTING.md | 30 +- Cargo.lock | 46 +-- Cargo.toml | 8 +- GOVERNANCE.md | 12 +- LICENSE-APACHE | 2 +- LICENSE-BSD2 | 2 +- MAINTAINERS.md | 2 +- MEETINGS.md | 2 +- README.md | 40 +- RELEASE.md | 98 ++--- SECURITY.md | 2 +- bpf/tc_dispatcher.bpf.c | 2 +- bpf/xdp_dispatcher_v1.bpf.c | 2 +- bpf/xdp_dispatcher_v2.bpf.c | 2 +- bpfctl/Cargo.toml | 6 +- bpfctl/src/main.rs | 36 +- bpfd-api/src/util.rs | 44 --- .../config/bpfd-deployment/kustomization.yaml | 11 - .../kustomization.yaml | 8 - .../config/rbac/auth_proxy_role.yaml | 24 -- .../config/rbac/bpfprogram_editor_role.yaml | 31 -- bpfd-operator/config/rbac/kustomization.yaml | 21 - .../config/rbac/leader_election_role.yaml | 44 --- .../config/samples/kustomization.yaml | 8 - bpfd-operator/config/test/patch.yaml | 9 - .../internal/test-utils/fake_bpfd_client.go | 120 ------ .../controllers/bpfd-operator/configmap.go | 266 ------------- {bpfd-api => bpfman-api}/Cargo.toml | 6 +- .../bpfd.v1.rs => bpfman-api/src/bpfman.v1.rs | 290 ++++++-------- {bpfd-api => bpfman-api}/src/config.rs | 12 +- {bpfd-api => bpfman-api}/src/lib.rs | 4 +- bpfman-api/src/util.rs | 46 +++ .../.dockerignore | 0 {bpfd-operator => bpfman-operator}/.gitignore | 0 .../Containerfile.bpfman-agent | 12 +- .../Containerfile.bpfman-operator | 16 +- .../Containerfile.bundle | 2 +- {bpfd-operator => bpfman-operator}/Makefile | 80 ++-- {bpfd-operator => bpfman-operator}/PROJECT | 30 +- .../apis/doc.go | 0 .../apis/v1alpha1/bpfprogram_types.go | 0 .../apis/v1alpha1/doc.go | 4 +- .../apis/v1alpha1/kprobeProgram_types.go | 2 +- .../apis/v1alpha1/shared_types.go | 24 +- .../apis/v1alpha1/tcProgram_types.go | 0 .../apis/v1alpha1/tracepointProgram_types.go | 0 .../apis/v1alpha1/uprobeProgram_types.go | 2 +- .../apis/v1alpha1/xdpProgram_types.go | 0 .../apis/v1alpha1/zz_generated.deepcopy.go | 2 +- .../apis/v1alpha1/zz_generated.register.go | 4 +- .../bundle.Dockerfile | 2 +- .../cmd/bpfman-agent}/main.go | 50 +-- .../cmd/bpfman-operator}/main.go | 34 +- .../config/bpfman-deployment}/config.yaml | 12 +- .../bpfman-deployment}/csidriverinfo.yaml | 4 +- .../config/bpfman-deployment}/daemonset.yaml | 78 ++-- .../bpfman-deployment/kustomization.yaml | 11 + .../deployment.yaml | 16 +- .../kustomization.yaml | 8 + .../crd/bases/bpfman.io_bpfprograms.yaml | 4 +- .../crd/bases/bpfman.io_kprobeprograms.yaml | 6 +- .../crd/bases/bpfman.io_tcprograms.yaml | 6 +- .../bases/bpfman.io_tracepointprograms.yaml | 6 +- .../crd/bases/bpfman.io_uprobeprograms.yaml | 6 +- .../crd/bases/bpfman.io_xdpprograms.yaml | 6 +- .../config/crd/kustomization.yaml | 14 +- .../config/crd/kustomizeconfig.yaml | 0 .../patches/cainjection_in_bpfprograms.yaml | 2 +- .../cainjection_in_kprobeprograms.yaml | 2 +- .../patches/cainjection_in_tcprograms.yaml | 2 +- .../cainjection_in_tracepointprograms.yaml | 2 +- .../cainjection_in_uprobeprograms.yaml | 2 +- .../patches/cainjection_in_xdpprograms.yaml | 2 +- .../crd/patches/webhook_in_bpfprograms.yaml | 4 +- .../patches/webhook_in_kprobeprograms.yaml | 4 +- .../crd/patches/webhook_in_tcprograms.yaml | 4 +- .../webhook_in_tracepointprograms.yaml | 4 +- .../patches/webhook_in_uprobeprograms.yaml | 4 +- .../crd/patches/webhook_in_xdpprograms.yaml | 4 +- .../config/default/kustomization.yaml | 8 +- .../default/manager_auth_proxy_patch.yaml | 2 +- .../config/default/manager_config_patch.yaml | 2 +- ...bpfman-operator.clusterserviceversion.yaml | 56 +-- .../config/manifests/kustomization.yaml | 2 +- .../config/openshift/kustomization.yaml | 8 +- .../openshift/manager_auth_proxy_patch.yaml | 2 +- .../openshift/manager_config_patch.yaml | 2 +- .../config/openshift/patch.yaml | 6 +- .../config/openshift/rbac.yaml | 4 +- .../config/prometheus/kustomization.yaml | 0 .../config/prometheus/monitor.yaml | 4 +- .../rbac/auth_proxy_client_clusterrole.yaml | 12 +- .../config/rbac/auth_proxy_role.yaml | 24 ++ .../config/rbac/auth_proxy_role_binding.yaml | 10 +- .../config/rbac/auth_proxy_service.yaml | 12 +- .../config/rbac/bpfman-agent}/role.yaml | 26 +- .../config/rbac/bpfman-operator}/role.yaml | 34 +- .../config/rbac/bpfprogram_editor_role.yaml | 31 ++ .../config/rbac/bpfprogram_viewer_role.yaml | 32 +- .../config/rbac/kustomization.yaml | 21 + .../config/rbac/leader_election_role.yaml | 44 +++ .../rbac/leader_election_role_binding.yaml | 10 +- .../config/rbac/role_binding.yaml | 40 +- .../config/rbac/service_account.yaml | 0 ...man.io_v1alpha1_go_counter_xdpprogram.yaml | 4 +- ...fman.io_v1alpha1_kprobe_kprobeprogram.yaml | 4 +- .../bpfman.io_v1alpha1_tc_pass_tcprogram.yaml | 4 +- ...v1alpha1_tracepoint_tracepointprogram.yaml | 4 +- ...fman.io_v1alpha1_uprobe_uprobeprogram.yaml | 6 +- ..._v1alpha1_xdp_pass_private_xdpprogram.yaml | 8 +- ...pfman.io_v1alpha1_xdp_pass_xdpprogram.yaml | 4 +- .../config/samples/kustomization.yaml | 8 + .../config/scorecard/bases/config.yaml | 0 .../config/scorecard/kustomization.yaml | 0 .../scorecard/patches/basic.config.yaml | 0 .../config/scorecard/patches/olm.config.yaml | 0 .../config/test/kustomization.yaml | 12 +- .../config/test/manager_auth_proxy_patch.yaml | 2 +- .../config/test/manager_config_patch.yaml | 2 +- bpfman-operator/config/test/patch.yaml | 9 + .../controllers/bpfman-agent}/common.go | 114 +++--- .../bpfman-agent}/discovered_program.go | 28 +- .../bpfman-agent}/discovered_program_test.go | 92 ++--- .../bpfman-agent}/internal/auth.go | 0 .../bpfman-agent/internal/bpfman-core.go | 72 ++-- .../controllers/bpfman-agent}/internal/cmp.go | 4 +- .../bpfman-agent}/internal/iface.go | 0 .../internal/test-utils/fake_bpfman_client.go | 120 ++++++ .../bpfman-agent}/kprobe-program.go | 128 +++--- .../bpfman-agent}/kprobe-program_test.go | 64 +-- .../controllers/bpfman-agent}/tc-program.go | 130 +++---- .../bpfman-agent}/tc-program_test.go | 152 ++++---- .../bpfman-agent}/tracepoint-program.go | 126 +++--- .../bpfman-agent}/tracepoint-program_test.go | 64 +-- .../bpfman-agent}/uprobe-program.go | 128 +++--- .../bpfman-agent}/uprobe-program_test.go | 64 +-- .../controllers/bpfman-agent}/xdp-program.go | 128 +++--- .../bpfman-agent}/xdp-program_test.go | 94 ++--- .../controllers/bpfman-operator}/common.go | 46 +-- .../controllers/bpfman-operator/configmap.go | 266 +++++++++++++ .../bpfman-operator}/configmap_test.go | 62 +-- .../bpfman-operator}/kprobe-program.go | 24 +- .../bpfman-operator}/kprobe-program_test.go | 42 +- .../bpfman-operator}/tc-program.go | 24 +- .../bpfman-operator}/tc-program_test.go | 46 +-- .../bpfman-operator}/tracepoint-program.go | 24 +- .../tracepoint-program_test.go | 38 +- .../bpfman-operator}/uprobe-program.go | 24 +- .../bpfman-operator}/uprobe-program_test.go | 38 +- .../bpfman-operator}/xdp-program.go | 24 +- .../bpfman-operator}/xdp-program_test.go | 44 +-- .../hack/api-docs/config.json | 0 .../hack/api-docs/generate.sh | 2 +- .../hack/api-docs/members.tpl | 0 .../hack/api-docs/pkg.tpl | 0 .../hack/api-docs/type.tpl | 0 .../hack/boilerplate.go.txt | 4 +- .../hack/boilerplate.sh.txt | 0 .../hack/build-release-yamls.sh | 36 +- .../hack/kind-config.yaml | 0 .../hack/kubectl-bpfprogramconfigs | 0 .../hack/kubectl-bpfprograms | 0 .../hack/ocp-scc-hacks.yaml | 48 +-- .../hack/tools.go | 0 .../hack/verify-codegen.sh | 2 +- .../internal/conn/conn.go | 4 +- .../internal/constants.go | 54 +-- .../internal/k8s.go | 14 +- .../internal/test-utils/helpers.go | 0 .../client/clientset/versioned/clientset.go | 18 +- .../pkg/client/clientset/versioned/doc.go | 2 +- .../versioned/fake/clientset_generated.go | 14 +- .../client/clientset/versioned/fake/doc.go | 2 +- .../clientset/versioned/fake/register.go | 6 +- .../client/clientset/versioned/scheme/doc.go | 2 +- .../clientset/versioned/scheme/register.go | 6 +- .../typed/apis/v1alpha1/apis_client.go | 46 +-- .../typed/apis/v1alpha1/bpfprogram.go | 8 +- .../versioned/typed/apis/v1alpha1/doc.go | 2 +- .../versioned/typed/apis/v1alpha1/fake/doc.go | 2 +- .../apis/v1alpha1/fake/fake_apis_client.go | 20 +- .../apis/v1alpha1/fake/fake_bpfprogram.go | 10 +- .../apis/v1alpha1/fake/fake_kprobeprogram.go | 10 +- .../apis/v1alpha1/fake/fake_tcprogram.go | 10 +- .../v1alpha1/fake/fake_tracepointprogram.go | 10 +- .../apis/v1alpha1/fake/fake_uprobeprogram.go | 10 +- .../apis/v1alpha1/fake/fake_xdpprogram.go | 10 +- .../apis/v1alpha1/generated_expansion.go | 2 +- .../typed/apis/v1alpha1/kprobeprogram.go | 8 +- .../typed/apis/v1alpha1/tcprogram.go | 8 +- .../typed/apis/v1alpha1/tracepointprogram.go | 8 +- .../typed/apis/v1alpha1/uprobeprogram.go | 8 +- .../typed/apis/v1alpha1/xdpprogram.go | 8 +- .../externalversions/apis/interface.go | 6 +- .../apis/v1alpha1/bpfprogram.go | 14 +- .../apis/v1alpha1/interface.go | 4 +- .../apis/v1alpha1/kprobeprogram.go | 14 +- .../apis/v1alpha1/tcprogram.go | 14 +- .../apis/v1alpha1/tracepointprogram.go | 14 +- .../apis/v1alpha1/uprobeprogram.go | 14 +- .../apis/v1alpha1/xdpprogram.go | 14 +- .../informers/externalversions/factory.go | 12 +- .../informers/externalversions/generic.go | 18 +- .../internalinterfaces/factory_interfaces.go | 4 +- .../listers/apis/v1alpha1/bpfprogram.go | 4 +- .../apis/v1alpha1/expansion_generated.go | 2 +- .../listers/apis/v1alpha1/kprobeprogram.go | 4 +- .../client/listers/apis/v1alpha1/tcprogram.go | 4 +- .../apis/v1alpha1/tracepointprogram.go | 4 +- .../listers/apis/v1alpha1/uprobeprogram.go | 4 +- .../listers/apis/v1alpha1/xdpprogram.go | 4 +- .../pkg/helpers/helpers.go | 64 +-- .../test/integration/suite_test.go | 90 ++--- .../test/integration/tc_test.go | 0 .../test/integration/tracepoint_test.go | 0 .../test/integration/xdp_test.go | 16 +- {bpfd => bpfman}/Cargo.toml | 10 +- {bpfd => bpfman}/src/bpf.rs | 143 ++++--- {bpfd => bpfman}/src/command.rs | 60 +-- {bpfd => bpfman}/src/dispatcher_config.rs | 2 +- {bpfd => bpfman}/src/errors.rs | 6 +- {bpfd => bpfman}/src/main.rs | 24 +- {bpfd => bpfman}/src/multiprog/mod.rs | 22 +- {bpfd => bpfman}/src/multiprog/tc.rs | 54 +-- {bpfd => bpfman}/src/multiprog/xdp.rs | 56 +-- {bpfd => bpfman}/src/oci_utils/cosign.rs | 2 +- .../src/oci_utils/image_manager.rs | 20 +- {bpfd => bpfman}/src/oci_utils/mod.rs | 2 +- {bpfd => bpfman}/src/rpc.rs | 48 +-- {bpfd => bpfman}/src/serve.rs | 14 +- {bpfd => bpfman}/src/static_program.rs | 12 +- {bpfd => bpfman}/src/storage.rs | 32 +- {bpfd => bpfman}/src/utils.rs | 22 +- changelogs/CHANGELOG-v0.1.0.md | 2 +- changelogs/CHANGELOG-v0.2.0.md | 2 +- changelogs/CHANGELOG-v0.2.1.md | 4 +- changelogs/CHANGELOG-v0.3.0.md | 20 +- changelogs/CHANGELOG-v0.3.1.md | 62 +-- .../bpfd.pb.go => gobpfman/v1/bpfman.pb.go} | 366 +++++++++--------- .../v1/bpfman_grpc.pb.go} | 128 +++--- csi/Cargo.toml | 4 +- csi/src/lib.rs | 2 +- docs/blog/.authors.yml | 21 +- docs/blog/index.md | 2 +- docs/blog/posts/bpfd-becomes-bpfman.md | 69 ++++ ...chitecture.jpg => bpfman_architecture.jpg} | Bin ...n-to-bpfd.md => introduction-to-bpfman.md} | 190 ++++----- docs/developer-guide/configuration.md | 18 +- docs/developer-guide/debugging.md | 10 +- docs/developer-guide/develop-operator.md | 104 ++--- docs/developer-guide/documentation.md | 22 +- docs/developer-guide/image-build.md | 20 +- docs/developer-guide/linux-capabilities.md | 56 +-- docs/developer-guide/logging.md | 132 +++---- docs/developer-guide/operator-quick-start.md | 56 +-- docs/developer-guide/testing.md | 16 +- docs/getting-started/bpfctl-guide.md | 92 ++--- .../{building-bpfd.md => building-bpfman.md} | 60 +-- docs/getting-started/example-bpf-k8s.md | 232 +++++------ docs/getting-started/example-bpf-local.md | 80 ++-- docs/getting-started/example-bpf.md | 24 +- docs/getting-started/running-release.md | 98 ++--- docs/getting-started/tutorial.md | 146 +++---- .../{bpfd-on-k8s.png => bpfman-on-k8s.png} | Bin docs/img/{bpfd.png => bpfman.png} | Bin docs/img/{bpfd.svg => bpfman.svg} | 4 +- docs/img/{bpfd_icon.svg => bpfman_icon.svg} | 2 +- docs/index.md | 50 +-- examples/Makefile | 52 +-- .../config/base/go-tc-counter/bytecode.yaml | 4 +- .../config/base/go-tc-counter/deployment.yaml | 12 +- .../base/go-tracepoint-counter/bytecode.yaml | 4 +- .../go-tracepoint-counter/deployment.yaml | 12 +- .../go-xdp-counter-sharing-map/bytecode.yaml | 6 +- .../config/base/go-xdp-counter/bytecode.yaml | 4 +- .../base/go-xdp-counter/deployment.yaml | 12 +- .../default/go-tc-counter/kustomization.yaml | 4 +- .../config/default/go-tc-counter/patch.yaml | 2 +- .../go-tracepoint-counter/kustomization.yaml | 4 +- .../default/go-tracepoint-counter/patch.yaml | 2 +- .../kustomization.yaml | 4 +- .../go-xdp-counter-sharing-map/patch.yaml | 2 +- .../default/go-xdp-counter/kustomization.yaml | 4 +- .../config/default/go-xdp-counter/patch.yaml | 2 +- .../v0.2.0/go-tc-counter/kustomization.yaml | 6 +- .../go-tracepoint-counter/kustomization.yaml | 6 +- .../v0.2.0/go-xdp-counter/kustomization.yaml | 6 +- .../v0.3.0/go-tc-counter/kustomization.yaml | 6 +- .../go-tracepoint-counter/kustomization.yaml | 6 +- .../kustomization.yaml | 6 +- .../v0.3.0/go-xdp-counter/kustomization.yaml | 6 +- .../go-tc-counter/kustomization.yaml | 6 +- .../v0.3.1-ocp/go-tc-counter/ocp-scc.yaml | 2 +- .../v0.3.1-ocp/go-tc-counter/patch.yaml | 2 +- .../go-tracepoint-counter/kustomization.yaml | 6 +- .../go-tracepoint-counter/ocp-scc.yaml | 2 +- .../kustomization.yaml | 6 +- .../go-xdp-counter-sharing-map/ocp-scc.yaml | 2 +- .../go-xdp-counter/kustomization.yaml | 6 +- .../v0.3.1-ocp/go-xdp-counter/ocp-scc.yaml | 2 +- .../v0.3.1/go-tc-counter/kustomization.yaml | 6 +- .../go-tracepoint-counter/kustomization.yaml | 6 +- .../kustomization.yaml | 6 +- .../v0.3.1/go-xdp-counter/kustomization.yaml | 6 +- examples/go-tc-counter/bpf/tc_counter.c | 2 +- .../Containerfile.go-tc-counter | 8 +- examples/go-tc-counter/main.go | 44 +-- .../bpf/tracepoint_counter.c | 2 +- .../Containerfile.go-tracepoint-counter | 8 +- examples/go-tracepoint-counter/main.go | 48 +-- examples/go-xdp-counter/bpf/xdp_counter.c | 2 +- .../Containerfile.go-xdp-counter | 8 +- examples/go-xdp-counter/main.go | 38 +- examples/go.sum | 24 -- examples/pkg/config-mgmt/configfile.go | 2 +- examples/pkg/config-mgmt/param.go | 36 +- go.mod | 2 +- mkdocs.yml | 20 +- .../container-deployment/Containerfile.bpfctl | 6 +- .../Containerfile.bpfctl.local | 12 +- .../container-deployment/Containerfile.bpfd | 27 -- .../container-deployment/Containerfile.bpfman | 27 ++ ....bpfd.local => Containerfile.bpfman.local} | 30 +- .../{rust-bpfd.spec => rust-bpfman.spec} | 6 +- packaging/vm-deployment/README.md | 14 +- packaging/vm-deployment/provision.yaml | 18 +- proto/{bpfd.proto => bpfman.proto} | 38 +- release.toml | 4 +- requirements.txt | 28 +- scripts/{bpfd.service => bpfman.service} | 4 +- scripts/{bpfd.toml => bpfman.toml} | 2 +- scripts/certificates.sh | 8 +- ...el-bpfd-qdiscs.sh => del-bpfman-qdiscs.sh} | 2 +- scripts/install.sh | 28 +- scripts/make-docs.sh | 2 +- scripts/setup.sh | 50 +-- scripts/user.sh | 10 +- scripts/verify-golint.sh | 12 +- tests/integration-test/Cargo.toml | 2 +- .../integration-test/bpf/build_push_images.sh | 32 +- tests/integration-test/bpf/kprobe.bpf.c | 2 +- tests/integration-test/bpf/tc_pass.bpf.c | 2 +- tests/integration-test/bpf/tp_openat.bpf.c | 2 +- tests/integration-test/bpf/uprobe.bpf.c | 2 +- tests/integration-test/bpf/xdp_pass.bpf.c | 2 +- tests/integration-test/src/tests/basic.rs | 70 ++-- tests/integration-test/src/tests/e2e.rs | 108 +++--- tests/integration-test/src/tests/utils.rs | 102 ++--- xtask/src/main.rs | 6 +- xtask/src/protobuf.rs | 18 +- xtask/src/run.rs | 2 +- 358 files changed, 4554 insertions(+), 4529 deletions(-) delete mode 100644 bpfd-api/src/util.rs delete mode 100644 bpfd-operator/config/bpfd-deployment/kustomization.yaml delete mode 100644 bpfd-operator/config/bpfd-operator-deployment/kustomization.yaml delete mode 100644 bpfd-operator/config/rbac/auth_proxy_role.yaml delete mode 100644 bpfd-operator/config/rbac/bpfprogram_editor_role.yaml delete mode 100644 bpfd-operator/config/rbac/kustomization.yaml delete mode 100644 bpfd-operator/config/rbac/leader_election_role.yaml delete mode 100644 bpfd-operator/config/samples/kustomization.yaml delete mode 100644 bpfd-operator/config/test/patch.yaml delete mode 100644 bpfd-operator/controllers/bpfd-agent/internal/test-utils/fake_bpfd_client.go delete mode 100644 bpfd-operator/controllers/bpfd-operator/configmap.go rename {bpfd-api => bpfman-api}/Cargo.toml (82%) rename bpfd-api/src/bpfd.v1.rs => bpfman-api/src/bpfman.v1.rs (78%) rename {bpfd-api => bpfman-api}/src/config.rs (95%) rename {bpfd-api => bpfman-api}/src/lib.rs (99%) create mode 100644 bpfman-api/src/util.rs rename {bpfd-operator => bpfman-operator}/.dockerignore (100%) rename {bpfd-operator => bpfman-operator}/.gitignore (100%) rename bpfd-operator/Containerfile.bpfd-agent => bpfman-operator/Containerfile.bpfman-agent (80%) rename bpfd-operator/Containerfile.bpfd-operator => bpfman-operator/Containerfile.bpfman-operator (65%) rename {bpfd-operator => bpfman-operator}/Containerfile.bundle (92%) rename {bpfd-operator => bpfman-operator}/Makefile (78%) rename {bpfd-operator => bpfman-operator}/PROJECT (62%) rename {bpfd-operator => bpfman-operator}/apis/doc.go (100%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/bpfprogram_types.go (100%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/doc.go (93%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/kprobeProgram_types.go (99%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/shared_types.go (92%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/tcProgram_types.go (100%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/tracepointProgram_types.go (100%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/uprobeProgram_types.go (99%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/xdpProgram_types.go (100%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/zz_generated.deepcopy.go (99%) rename {bpfd-operator => bpfman-operator}/apis/v1alpha1/zz_generated.register.go (97%) rename {bpfd-operator => bpfman-operator}/bundle.Dockerfile (92%) rename {bpfd-operator/cmd/bpfd-agent => bpfman-operator/cmd/bpfman-agent}/main.go (77%) rename {bpfd-operator/cmd/bpfd-operator => bpfman-operator/cmd/bpfman-operator}/main.go (82%) rename {bpfd-operator/config/bpfd-deployment => bpfman-operator/config/bpfman-deployment}/config.yaml (61%) rename {bpfd-operator/config/bpfd-deployment => bpfman-operator/config/bpfman-deployment}/csidriverinfo.yaml (59%) rename {bpfd-operator/config/bpfd-deployment => bpfman-operator/config/bpfman-deployment}/daemonset.yaml (76%) create mode 100644 bpfman-operator/config/bpfman-deployment/kustomization.yaml rename {bpfd-operator/config/bpfd-operator-deployment => bpfman-operator/config/bpfman-operator-deployment}/deployment.yaml (90%) create mode 100644 bpfman-operator/config/bpfman-operator-deployment/kustomization.yaml rename bpfd-operator/config/crd/bases/bpfd.dev_bpfprograms.yaml => bpfman-operator/config/crd/bases/bpfman.io_bpfprograms.yaml (99%) rename bpfd-operator/config/crd/bases/bpfd.dev_kprobeprograms.yaml => bpfman-operator/config/crd/bases/bpfman.io_kprobeprograms.yaml (99%) rename bpfd-operator/config/crd/bases/bpfd.dev_tcprograms.yaml => bpfman-operator/config/crd/bases/bpfman.io_tcprograms.yaml (99%) rename bpfd-operator/config/crd/bases/bpfd.dev_tracepointprograms.yaml => bpfman-operator/config/crd/bases/bpfman.io_tracepointprograms.yaml (99%) rename bpfd-operator/config/crd/bases/bpfd.dev_uprobeprograms.yaml => bpfman-operator/config/crd/bases/bpfman.io_uprobeprograms.yaml (99%) rename bpfd-operator/config/crd/bases/bpfd.dev_xdpprograms.yaml => bpfman-operator/config/crd/bases/bpfman.io_xdpprograms.yaml (99%) rename {bpfd-operator => bpfman-operator}/config/crd/kustomization.yaml (83%) rename {bpfd-operator => bpfman-operator}/config/crd/kustomizeconfig.yaml (100%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/cainjection_in_bpfprograms.yaml (89%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/cainjection_in_kprobeprograms.yaml (88%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/cainjection_in_tcprograms.yaml (89%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/cainjection_in_tracepointprograms.yaml (87%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/cainjection_in_uprobeprograms.yaml (88%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/cainjection_in_xdpprograms.yaml (89%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/webhook_in_bpfprograms.yaml (89%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/webhook_in_kprobeprograms.yaml (88%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/webhook_in_tcprograms.yaml (89%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/webhook_in_tracepointprograms.yaml (87%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/webhook_in_uprobeprograms.yaml (88%) rename {bpfd-operator => bpfman-operator}/config/crd/patches/webhook_in_xdpprograms.yaml (89%) rename {bpfd-operator => bpfman-operator}/config/default/kustomization.yaml (94%) rename {bpfd-operator => bpfman-operator}/config/default/manager_auth_proxy_patch.yaml (98%) rename {bpfd-operator => bpfman-operator}/config/default/manager_config_patch.yaml (80%) rename bpfd-operator/config/manifests/bases/bpfd-operator.clusterserviceversion.yaml => bpfman-operator/config/manifests/bases/bpfman-operator.clusterserviceversion.yaml (92%) rename {bpfd-operator => bpfman-operator}/config/manifests/kustomization.yaml (95%) rename {bpfd-operator => bpfman-operator}/config/openshift/kustomization.yaml (91%) rename {bpfd-operator => bpfman-operator}/config/openshift/manager_auth_proxy_patch.yaml (98%) rename {bpfd-operator => bpfman-operator}/config/openshift/manager_config_patch.yaml (80%) rename {bpfd-operator => bpfman-operator}/config/openshift/patch.yaml (80%) rename {bpfd-operator => bpfman-operator}/config/openshift/rbac.yaml (81%) rename {bpfd-operator => bpfman-operator}/config/prometheus/kustomization.yaml (100%) rename {bpfd-operator => bpfman-operator}/config/prometheus/monitor.yaml (87%) rename {bpfd-operator => bpfman-operator}/config/rbac/auth_proxy_client_clusterrole.yaml (64%) create mode 100644 bpfman-operator/config/rbac/auth_proxy_role.yaml rename {bpfd-operator => bpfman-operator}/config/rbac/auth_proxy_role_binding.yaml (70%) rename {bpfd-operator => bpfman-operator}/config/rbac/auth_proxy_service.yaml (70%) rename {bpfd-operator/config/rbac/bpfd-agent => bpfman-operator/config/rbac/bpfman-agent}/role.yaml (87%) rename {bpfd-operator/config/rbac/bpfd-operator => bpfman-operator/config/rbac/bpfman-operator}/role.yaml (89%) create mode 100644 bpfman-operator/config/rbac/bpfprogram_editor_role.yaml rename {bpfd-operator => bpfman-operator}/config/rbac/bpfprogram_viewer_role.yaml (52%) create mode 100644 bpfman-operator/config/rbac/kustomization.yaml create mode 100644 bpfman-operator/config/rbac/leader_election_role.yaml rename {bpfd-operator => bpfman-operator}/config/rbac/leader_election_role_binding.yaml (70%) rename {bpfd-operator => bpfman-operator}/config/rbac/role_binding.yaml (60%) rename {bpfd-operator => bpfman-operator}/config/rbac/service_account.yaml (100%) rename bpfd-operator/config/samples/bpfd.io_v1alpha1_go_counter_xdpprogram.yaml => bpfman-operator/config/samples/bpfman.io_v1alpha1_go_counter_xdpprogram.yaml (74%) rename bpfd-operator/config/samples/bpfd.io_v1alpha1_kprobe_kprobeprogram.yaml => bpfman-operator/config/samples/bpfman.io_v1alpha1_kprobe_kprobeprogram.yaml (82%) rename bpfd-operator/config/samples/bpfd.io_v1alpha1_tc_pass_tcprogram.yaml => bpfman-operator/config/samples/bpfman.io_v1alpha1_tc_pass_tcprogram.yaml (82%) rename bpfd-operator/config/samples/bpfd.io_v1alpha1_tracepoint_tracepointprogram.yaml => bpfman-operator/config/samples/bpfman.io_v1alpha1_tracepoint_tracepointprogram.yaml (81%) rename bpfd-operator/config/samples/bpfd.io_v1alpha1_uprobe_uprobeprogram.yaml => bpfman-operator/config/samples/bpfman.io_v1alpha1_uprobe_uprobeprogram.yaml (82%) rename bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_private_xdpprogram.yaml => bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_private_xdpprogram.yaml (52%) rename bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_xdpprogram.yaml => bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_xdpprogram.yaml (81%) create mode 100644 bpfman-operator/config/samples/kustomization.yaml rename {bpfd-operator => bpfman-operator}/config/scorecard/bases/config.yaml (100%) rename {bpfd-operator => bpfman-operator}/config/scorecard/kustomization.yaml (100%) rename {bpfd-operator => bpfman-operator}/config/scorecard/patches/basic.config.yaml (100%) rename {bpfd-operator => bpfman-operator}/config/scorecard/patches/olm.config.yaml (100%) rename {bpfd-operator => bpfman-operator}/config/test/kustomization.yaml (89%) rename {bpfd-operator => bpfman-operator}/config/test/manager_auth_proxy_patch.yaml (98%) rename {bpfd-operator => bpfman-operator}/config/test/manager_config_patch.yaml (80%) create mode 100644 bpfman-operator/config/test/patch.yaml rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/common.go (79%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/discovered_program.go (86%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/discovered_program_test.go (80%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/internal/auth.go (100%) rename bpfd-operator/controllers/bpfd-agent/internal/bpfd-core.go => bpfman-operator/controllers/bpfman-agent/internal/bpfman-core.go (66%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/internal/cmp.go (97%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/internal/iface.go (100%) create mode 100644 bpfman-operator/controllers/bpfman-agent/internal/test-utils/fake_bpfman_client.go rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/kprobe-program.go (68%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/kprobe-program_test.go (74%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/tc-program.go (69%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/tc-program_test.go (74%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/tracepoint-program.go (67%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/tracepoint-program_test.go (73%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/uprobe-program.go (67%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/uprobe-program_test.go (74%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/xdp-program.go (69%) rename {bpfd-operator/controllers/bpfd-agent => bpfman-operator/controllers/bpfman-agent}/xdp-program_test.go (76%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/common.go (76%) create mode 100644 bpfman-operator/controllers/bpfman-operator/configmap.go rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/configmap_test.go (60%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/kprobe-program.go (82%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/kprobe-program_test.go (76%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/tc-program.go (83%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/tc-program_test.go (72%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/tracepoint-program.go (82%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/tracepoint-program_test.go (76%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/uprobe-program.go (82%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/uprobe-program_test.go (75%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/xdp-program.go (83%) rename {bpfd-operator/controllers/bpfd-operator => bpfman-operator/controllers/bpfman-operator}/xdp-program_test.go (72%) rename {bpfd-operator => bpfman-operator}/hack/api-docs/config.json (100%) rename {bpfd-operator => bpfman-operator}/hack/api-docs/generate.sh (95%) rename {bpfd-operator => bpfman-operator}/hack/api-docs/members.tpl (100%) rename {bpfd-operator => bpfman-operator}/hack/api-docs/pkg.tpl (100%) rename {bpfd-operator => bpfman-operator}/hack/api-docs/type.tpl (100%) rename {bpfd-operator => bpfman-operator}/hack/boilerplate.go.txt (93%) rename {bpfd-operator => bpfman-operator}/hack/boilerplate.sh.txt (100%) rename {bpfd-operator => bpfman-operator}/hack/build-release-yamls.sh (63%) rename {bpfd-operator => bpfman-operator}/hack/kind-config.yaml (100%) rename {bpfd-operator => bpfman-operator}/hack/kubectl-bpfprogramconfigs (100%) rename {bpfd-operator => bpfman-operator}/hack/kubectl-bpfprograms (100%) rename {bpfd-operator => bpfman-operator}/hack/ocp-scc-hacks.yaml (68%) rename {bpfd-operator => bpfman-operator}/hack/tools.go (100%) rename {bpfd-operator => bpfman-operator}/hack/verify-codegen.sh (94%) rename {bpfd-operator => bpfman-operator}/internal/conn/conn.go (96%) rename {bpfd-operator => bpfman-operator}/internal/constants.go (75%) rename {bpfd-operator => bpfman-operator}/internal/k8s.go (85%) rename {bpfd-operator => bpfman-operator}/internal/test-utils/helpers.go (100%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/clientset.go (85%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/doc.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/fake/clientset_generated.go (81%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/fake/doc.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/fake/register.go (92%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/scheme/doc.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/scheme/register.go (92%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go (61%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/bpfprogram.go (96%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go (60%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_bpfprogram.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_kprobeprogram.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tcprogram.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tracepointprogram.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_uprobeprogram.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_xdpprogram.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/kprobeprogram.go (96%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/tcprogram.go (96%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/tracepointprogram.go (96%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/uprobeprogram.go (96%) rename {bpfd-operator => bpfman-operator}/pkg/client/clientset/versioned/typed/apis/v1alpha1/xdpprogram.go (96%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/interface.go (84%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/v1alpha1/bpfprogram.go (84%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/v1alpha1/interface.go (94%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/v1alpha1/kprobeprogram.go (84%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/v1alpha1/tcprogram.go (84%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/v1alpha1/tracepointprogram.go (84%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/v1alpha1/uprobeprogram.go (84%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/apis/v1alpha1/xdpprogram.go (84%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/factory.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/generic.go (82%) rename {bpfd-operator => bpfman-operator}/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go (91%) rename {bpfd-operator => bpfman-operator}/pkg/client/listers/apis/v1alpha1/bpfprogram.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/listers/apis/v1alpha1/expansion_generated.go (97%) rename {bpfd-operator => bpfman-operator}/pkg/client/listers/apis/v1alpha1/kprobeprogram.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/listers/apis/v1alpha1/tcprogram.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/listers/apis/v1alpha1/tracepointprogram.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/listers/apis/v1alpha1/uprobeprogram.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/client/listers/apis/v1alpha1/xdpprogram.go (95%) rename {bpfd-operator => bpfman-operator}/pkg/helpers/helpers.go (70%) rename {bpfd-operator => bpfman-operator}/test/integration/suite_test.go (63%) rename {bpfd-operator => bpfman-operator}/test/integration/tc_test.go (100%) rename {bpfd-operator => bpfman-operator}/test/integration/tracepoint_test.go (100%) rename {bpfd-operator => bpfman-operator}/test/integration/xdp_test.go (78%) rename {bpfd => bpfman}/Cargo.toml (91%) rename {bpfd => bpfman}/src/bpf.rs (89%) rename {bpfd => bpfman}/src/command.rs (93%) rename {bpfd => bpfman}/src/dispatcher_config.rs (98%) rename {bpfd => bpfman}/src/errors.rs (93%) rename {bpfd => bpfman}/src/main.rs (89%) rename {bpfd => bpfman}/src/multiprog/mod.rs (83%) rename {bpfd => bpfman}/src/multiprog/tc.rs (90%) rename {bpfd => bpfman}/src/multiprog/xdp.rs (85%) rename {bpfd => bpfman}/src/oci_utils/cosign.rs (99%) rename {bpfd => bpfman}/src/oci_utils/image_manager.rs (97%) rename {bpfd => bpfman}/src/oci_utils/mod.rs (96%) rename {bpfd => bpfman}/src/rpc.rs (91%) rename {bpfd => bpfman}/src/serve.rs (94%) rename {bpfd => bpfman}/src/static_program.rs (94%) rename {bpfd => bpfman}/src/storage.rs (93%) rename {bpfd => bpfman}/src/utils.rs (80%) rename clients/{gobpfd/v1/bpfd.pb.go => gobpfman/v1/bpfman.pb.go} (85%) rename clients/{gobpfd/v1/bpfd_grpc.pb.go => gobpfman/v1/bpfman_grpc.pb.go} (51%) create mode 100644 docs/blog/posts/bpfd-becomes-bpfman.md rename docs/blog/posts/img/{bpfd_architecture.jpg => bpfman_architecture.jpg} (100%) rename docs/blog/posts/{introduction-to-bpfd.md => introduction-to-bpfman.md} (73%) rename docs/getting-started/{building-bpfd.md => building-bpfman.md} (69%) rename docs/img/{bpfd-on-k8s.png => bpfman-on-k8s.png} (100%) rename docs/img/{bpfd.png => bpfman.png} (100%) rename docs/img/{bpfd.svg => bpfman.svg} (99%) rename docs/img/{bpfd_icon.svg => bpfman_icon.svg} (99%) delete mode 100644 examples/go.sum delete mode 100644 packaging/container-deployment/Containerfile.bpfd create mode 100644 packaging/container-deployment/Containerfile.bpfman rename packaging/container-deployment/{Containerfile.bpfd.local => Containerfile.bpfman.local} (52%) rename packaging/{rust-bpfd.spec => rust-bpfman.spec} (91%) rename proto/{bpfd.proto => bpfman.proto} (88%) rename scripts/{bpfd.service => bpfman.service} (82%) rename scripts/{bpfd.toml => bpfman.toml} (87%) rename scripts/{del-bpfd-qdiscs.sh => del-bpfman-qdiscs.sh} (88%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3db73def4..0675fca35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: - name: Build run: cargo build --verbose - ## If the push is a tag....build and upload the release bpfd and bpfctl binaries to an archive + ## If the push is a tag....build and upload the release bpfman and bpfctl binaries to an archive - name: Build-Release if: startsWith(github.ref, 'refs/tags/v') run: | @@ -101,19 +101,19 @@ jobs: if: startsWith(github.ref, 'refs/tags/v') run: | tar -czvf bpfctl-linux-x86_64.tar.gz ./target/x86_64-unknown-linux-musl/release/bpfctl - tar -czvf bpfd-linux-x86_64.tar.gz ./target/x86_64-unknown-linux-musl/release/bpfd + tar -czvf bpfman-linux-x86_64.tar.gz ./target/x86_64-unknown-linux-musl/release/bpfman - - name: Archive bpfd and bpfctl Release Binaries + - name: Archive bpfman and bpfctl Release Binaries if: startsWith(github.ref, 'refs/tags/v') uses: actions/upload-artifact@v3 with: - name: bpfd-release + name: bpfman-release path: | ./bpfctl-linux-x86_64.tar.gz - ./bpfd-linux-x86_64.tar.gz + ./bpfman-linux-x86_64.tar.gz - name: Run tests - run: cargo llvm-cov test --all-features -p bpfd -p bpfd-api -p bpfctl --lcov --output-path lcov.info + run: cargo llvm-cov test --all-features -p bpfman -p bpfman-api -p bpfctl --lcov --output-path lcov.info env: RUST_BACKTRACE: full @@ -133,14 +133,14 @@ jobs: steps: - uses: actions/checkout@v4 with: - path: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd + path: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman - uses: actions/setup-go@v4 with: go-version: "1.20" - name: Go mod check - working-directory: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd + working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman run: | go mod tidy git diff --exit-code go.mod go.sum @@ -148,8 +148,8 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v3 with: - # Keep this version synced with /bpfd/scripts/verify-golint.sh - working-directory: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd + # Keep this version synced with /bpfman/scripts/verify-golint.sh + working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman version: v1.54.2 skip-cache: true skip-pkg-cache: true @@ -157,27 +157,28 @@ jobs: args: -v --timeout 5m --enable=gofmt - name: Build Examples - working-directory: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd/examples + working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman/examples run: | go build ./... - name: Build Operator - working-directory: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd/bpfd-operator + working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman/bpfman-operator run: make build - - name: Verify Operator - working-directory: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd/bpfd-operator - run: make verify + # FIXME: This is currently failing due to a GOPATH weirdness + # - name: Verify Operator + # working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman/bpfman-operator + # run: make verify - name: Run Tests - working-directory: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd/bpfd-operator + working-directory: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman/bpfman-operator run: make test - name: Archive Go code coverage results uses: actions/upload-artifact@v3 with: name: coverage - path: ${{ env.GOPATH }}/src/github.com/bpfd-dev/bpfd/bpfd-operator/cover.out + path: ${{ env.GOPATH }}/src/github.com/bpfman/bpfman/bpfman-operator/cover.out if-no-files-found: error basic-integration-tests: @@ -217,23 +218,23 @@ jobs: - name: Build eBPF run: cargo xtask build-ebpf --libbpf-dir ./libbpf - - name: Build bpfd + - name: Build bpfman run: cargo build --verbose - - name: Run the bpfd installer + - name: Run the bpfman installer run: sudo ./scripts/setup.sh install - name: Give certs time to be created run: sleep 5 - - name: Verify the bpfd systemd service is active - run: systemctl is-active bpfd + - name: Verify the bpfman systemd service is active + run: systemctl is-active bpfman - - name: Verify the bpfctl can reach bpfd + - name: Verify the bpfctl can reach bpfman run: sudo bpfctl list - - name: Stop the bpfd systemd service - run: sudo systemctl stop bpfd + - name: Stop the bpfman systemd service + run: sudo systemctl stop bpfman - name: Run integration tests run: cargo xtask integration-test @@ -242,9 +243,9 @@ jobs: needs: ["build", "build-go"] runs-on: ubuntu-latest env: - BPFD_IMG: "quay.io/bpfd/bpfd:int-test" - BPFD_AGENT_IMG: "quay.io/bpfd/bpfd-agent:int-test" - BPFD_OPERATOR_IMG: "quay.io/bpfd/bpfd-operator:int-test" + BPFMAN_IMG: "quay.io/bpfman/bpfman:int-test" + BPFMAN_AGENT_IMG: "quay.io/bpfman/bpfman-agent:int-test" + BPFMAN_OPERATOR_IMG: "quay.io/bpfman/bpfman-operator:int-test" steps: - name: Install dependencies run: | @@ -286,10 +287,10 @@ jobs: run: cd examples && make build-us-images - name: build images - run: cd bpfd-operator && make build-images + run: cd bpfman-operator && make build-images - name: run integration tests - run: cd bpfd-operator && make test-integration + run: cd bpfman-operator && make test-integration ## Upload diagnostics if integration test step failed. - name: upload diagnostics @@ -319,8 +320,8 @@ jobs: verbose: true # Creates Release - # Copies built bpfctl + bpfd binaries to release artifacts - # Publish's bpfd, bpfctl, and bpfd-api crates to crates.io + # Copies built bpfctl + bpfman binaries to release artifacts + # Publish's bpfman, bpfctl, and bpfman-api crates to crates.io release: if: startsWith(github.ref, 'refs/tags/v') needs: ["build"] @@ -335,25 +336,25 @@ jobs: - uses: actions/download-artifact@v3 with: - name: bpfd-release + name: bpfman-release - name: release uses: softprops/action-gh-release@v1 with: body_path: ./changelogs/CHANGELOG-${{ env.RELEASE_VERSION }}.md files: | - bpfd-linux-x86_64.tar.gz + bpfman-linux-x86_64.tar.gz bpfctl-linux-x86_64.tar.gz ## TODO once we're using an aya mainline version - # - name: publish bpfd crate - # run: cargo publish -p bpfd --token ${{ secrets.BPFD_DEV_TOKEN }} + # - name: publish bpfman crate + # run: cargo publish -p bpfman --token ${{ secrets.BPFMAN_DEV_TOKEN }} - - name: publish bpfd-api crate - run: cargo publish -p bpfd-api --token ${{ secrets.BPFD_DEV_TOKEN }} + - name: publish bpfman-api crate + run: cargo publish -p bpfman-api --token ${{ secrets.BPFMAN_DEV_TOKEN }} - name: publish bpfctl crate - run: cargo publish -p bpfctl --token ${{ secrets.BPFD_DEV_TOKEN }} + run: cargo publish -p bpfctl --token ${{ secrets.BPFMAN_DEV_TOKEN }} build-workflow-complete: needs: diff --git a/.github/workflows/image-build.yaml b/.github/workflows/image-build.yaml index 3c9160c77..eea08b04e 100644 --- a/.github/workflows/image-build.yaml +++ b/.github/workflows/image-build.yaml @@ -1,4 +1,4 @@ -name: bpfd-image-build +name: bpfman-image-build on: # yamllint disable-line rule:truthy push: @@ -22,9 +22,9 @@ jobs: matrix: image: - registry: quay.io - repository: bpfd - image: bpfd - dockerfile: ./packaging/container-deployment/Containerfile.bpfd + repository: bpfman + image: bpfman + dockerfile: ./packaging/container-deployment/Containerfile.bpfman context: . tags: | type=ref,event=branch @@ -35,7 +35,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - registry: quay.io - repository: bpfd + repository: bpfman image: bpfctl dockerfile: ./packaging/container-deployment/Containerfile.bpfctl context: . @@ -48,9 +48,9 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - registry: quay.io - repository: bpfd - image: bpfd-agent - dockerfile: ./bpfd-operator/Containerfile.bpfd-agent + repository: bpfman + image: bpfman-agent + dockerfile: ./bpfman-operator/Containerfile.bpfman-agent context: . tags: | type=ref,event=branch @@ -61,9 +61,9 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - registry: quay.io - repository: bpfd - image: bpfd-operator - dockerfile: ./bpfd-operator/Containerfile.bpfd-operator + repository: bpfman + image: bpfman-operator + dockerfile: ./bpfman-operator/Containerfile.bpfman-operator context: . tags: | type=ref,event=branch @@ -74,10 +74,10 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - registry: quay.io - repository: bpfd - image: bpfd-operator-bundle - context: ./bpfd-operator - dockerfile: ./bpfd-operator/Containerfile.bundle + repository: bpfman + image: bpfman-operator-bundle + context: ./bpfman-operator + dockerfile: ./bpfman-operator/Containerfile.bundle tags: | type=ref,event=branch type=ref,event=tag @@ -87,7 +87,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - registry: quay.io - repository: bpfd-userspace + repository: bpfman-userspace image: go-xdp-counter context: . dockerfile: ./examples/go-xdp-counter/container-deployment/Containerfile.go-xdp-counter @@ -100,7 +100,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - registry: quay.io - repository: bpfd-userspace + repository: bpfman-userspace image: go-tc-counter context: . dockerfile: ./examples/go-tc-counter/container-deployment/Containerfile.go-tc-counter @@ -113,7 +113,7 @@ jobs: type=raw,value=latest,enable={{is_default_branch}} - registry: quay.io - repository: bpfd-userspace + repository: bpfman-userspace image: go-tracepoint-counter context: . dockerfile: ./examples/go-tracepoint-counter/container-deployment/Containerfile.go-tracepoint-counter @@ -127,7 +127,7 @@ jobs: - registry: quay.io bpf_build_wrapper: go - repository: bpfd-bytecode + repository: bpfman-bytecode image: go-xdp-counter context: ./examples/go-xdp-counter dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -146,7 +146,7 @@ jobs: - registry: quay.io bpf_build_wrapper: go - repository: bpfd-bytecode + repository: bpfman-bytecode image: go-tc-counter context: ./examples/go-tc-counter dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -165,7 +165,7 @@ jobs: - registry: quay.io bpf_build_wrapper: go - repository: bpfd-bytecode + repository: bpfman-bytecode image: go-tracepoint-counter context: ./examples/go-tracepoint-counter dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -184,7 +184,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: xdp_pass context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -203,7 +203,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: xdp_pass_private context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -222,7 +222,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: tc_pass context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -241,7 +241,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: tracepoint context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -260,7 +260,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: uprobe context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -279,7 +279,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: uretprobe context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -298,7 +298,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: kprobe context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -317,7 +317,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd-bytecode + repository: bpfman-bytecode image: kretprobe context: ./tests/integration-test/bpf/.output dockerfile: ./packaging/container-deployment/Containerfile.bytecode @@ -336,7 +336,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd + repository: bpfman image: xdp-dispatcher context: . dockerfile: ./Containerfile.xdp_dispatcher_v1 @@ -346,7 +346,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd + repository: bpfman image: xdp-dispatcher context: . dockerfile: ./Containerfile.xdp_dispatcher_v2 @@ -356,7 +356,7 @@ jobs: - registry: quay.io bpf_build_wrapper: rust - repository: bpfd + repository: bpfman image: tc-dispatcher context: . dockerfile: ./Containerfile.tc_dispatcher @@ -365,7 +365,6 @@ jobs: type=raw,value=v1,enable=true name: Build Image (${{ matrix.image.image }}) - environment: image-repositories steps: - uses: actions/checkout@v4 @@ -410,33 +409,33 @@ jobs: cd examples && make generate - name: Generate olm bundle on disk - if: ${{ matrix.image.image == 'bpfd-operator-bundle' }} + if: ${{ matrix.image.image == 'bpfman-operator-bundle' }} run: | - cd bpfd-operator && make bundle + cd bpfman-operator && make bundle - - name: Login to quay.io/bpfd + - name: Login to quay.io/bpfman uses: redhat-actions/podman-login@v1 - if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfd'}} + if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfman'}} with: registry: ${{ matrix.image.registry }} - username: ${{ secrets.BPFD_USERNAME }} - password: ${{ secrets.BPFD_ROBOT_TOKEN }} + username: ${{ secrets.BPFMAN_USERNAME }} + password: ${{ secrets.BPFMAN_ROBOT_TOKEN }} - - name: Login to quay.io/bpfd-userspace + - name: Login to quay.io/bpfman-userspace uses: redhat-actions/podman-login@v1 - if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfd-userspace'}} + if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfman-userspace'}} with: registry: ${{ matrix.image.registry }} - username: ${{ secrets.BPFD_USERSPACE_USERNAME }} - password: ${{ secrets.BPFD_USERSPACE_ROBOT_TOKEN }} + username: ${{ secrets.BPFMAN_USERSPACE_USERNAME }} + password: ${{ secrets.BPFMAN_USERSPACE_ROBOT_TOKEN }} - - name: Login to quay.io/bpfd-bytecode + - name: Login to quay.io/bpfman-bytecode uses: redhat-actions/podman-login@v1 - if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfd-bytecode' }} + if: ${{ github.event_name == 'push' && matrix.image.repository == 'bpfman-bytecode' }} with: registry: ${{ matrix.image.registry }} - username: ${{ secrets.BPFD_BYTECODE_USERNAME }} - password: ${{ secrets.BPFD_BYTECODE_ROBOT_TOKEN }} + username: ${{ secrets.BPFMAN_BYTECODE_USERNAME }} + password: ${{ secrets.BPFMAN_BYTECODE_ROBOT_TOKEN }} - name: Extract metadata (tags, labels) for image id: meta diff --git a/.github/workflows/put-issue-in-project.yaml b/.github/workflows/put-issue-in-project.yaml index 003774d15..c2003f943 100644 --- a/.github/workflows/put-issue-in-project.yaml +++ b/.github/workflows/put-issue-in-project.yaml @@ -1,4 +1,4 @@ -name: Add all issues to bpfd project +name: Add all issues to bpfman project on: # yamllint disable-line rule:truthy issues: @@ -14,5 +14,5 @@ jobs: with: # You can target a project in a different organization # to the issue - project-url: https://github.com/orgs/bpfd-dev/projects/4 - github-token: ${{ secrets.BPFD_PROJECT_PAT }} + project-url: https://github.com/orgs/bpfman/projects/4 + github-token: ${{ secrets.BPFMAN_PROJECT_PAT }} diff --git a/.licenserc.yaml b/.licenserc.yaml index 1bcad7a19..18f9991c0 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -3,9 +3,9 @@ header: - license: content: | SPDX-License-Identifier: Apache-2.0 - Copyright Authors of bpfd + Copyright Authors of bpfman paths: - - bpfd + - bpfman - bpfctl paths-ignore: - "**/target/**" @@ -18,7 +18,7 @@ header: - license: content: | SPDX-License-Identifier: GPL-2.0-only - Modifications Copyright Authors of bpfd + Modifications Copyright Authors of bpfman paths: - bpf/xdp_dispatcher_v1.bpf.c - bpf/xdp_dispatcher_v2.bpf.c @@ -27,7 +27,7 @@ header: - license: content: | SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) - Copyright Authors of bpfd + Copyright Authors of bpfman paths: - bpf/tc_dispatcher.bpf.c - examples/**/bpf/*.c diff --git a/.vscode/settings.json b/.vscode/settings.json index 82f50b982..dbad99688 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "rust-analyzer.check.allTargets": true, "yaml.schemas": { - "https://json.schemastore.org/github-workflow.json": "file:///home/dave/dev/bpfd/.github/workflows/build.yml" + "https://json.schemastore.org/github-workflow.json": "file:///home/dave/dev/bpfman/.github/workflows/build.yml" }, "rust-analyzer.check.command": "clippy" } diff --git a/.yamllint.yaml b/.yamllint.yaml index 1228147a6..7808dc35d 100644 --- a/.yamllint.yaml +++ b/.yamllint.yaml @@ -8,8 +8,8 @@ rules: ignore: - libbpf/* - vendor/* - - bpfd-operator/config/crd/* - - bpfd-operator/config/rbac/* + - bpfman-operator/config/crd/* + - bpfman-operator/config/rbac/* ## Kustomize automatically formats these incorrectly - - bpfd-operator/config/bpfd-deployment/kustomization.yaml - - bpfd-operator/config/bpfd-operator-deployment/kustomization.yaml + - bpfman-operator/config/bpfman-deployment/kustomization.yaml + - bpfman-operator/config/bpfman-operator-deployment/kustomization.yaml diff --git a/CODEOWNERS b/CODEOWNERS index 03f11a22a..b5a06cbea 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,11 +1,11 @@ -* @bpfd-dev/bpfd-maintainers +* @bpfman/bpfman-maintainers -./bpfd @dave-tucker -./bpfd/src/oci_utils @astoycos -./bpfd/src/multiprog/tc.rs @anfredette -./bpfd/src/certs.rs @Billy99 -./bpfd-api @dave-tucker +./bpfman @dave-tucker +./bpfman/src/oci_utils @astoycos +./bpfman/src/multiprog/tc.rs @anfredette +./bpfman/src/certs.rs @Billy99 +./bpfman-api @dave-tucker ./bpfctl @dave-tucker -./bpfd-operator @astoycos +./bpfman-operator @astoycos ./examples/go-tc-counter @anfredette ./examples/go-xdp-counter @Billy99 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b579aeab7..c067f4fc1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,8 +53,8 @@ feedback on others’ ideas, and even sharing your own ideas, and experiences. ## Find an Issue We have good first issues for new contributors and help wanted issues suitable -for any contributor. [good first issue](https://github.com/bpfd-dev/bpfd/labels/good%20first%20issue) has extra information to -help you make your first contribution. [help wanted](https://github.com/bpfd-dev/bpfd/labels/help%20wanted) are issues +for any contributor. [good first issue](https://github.com/bpfman/bpfman/labels/good%20first%20issue) has extra information to +help you make your first contribution. [help wanted](https://github.com/bpfman/bpfman/labels/help%20wanted) are issues suitable for someone who isn't a core maintainer and is good to move onto after your first pull request. @@ -87,7 +87,7 @@ In some cases, other changes may conflict with your PR. If this happens, you wil ## Development Environment Setup -[Instructions](https://bpfd.netlify.app/building-bpfd/#development-environment-setup) +[Instructions](https://bpfman.netlify.app/building-bpfman/#development-environment-setup) ## Signoff Your Commits @@ -138,7 +138,7 @@ A good commit message should describe what changed and why. Examples: - * bpfd: validate program section names + * bpfman: validate program section names * bpf: add dispatcher program test slot 2. Keep the second line blank. @@ -182,43 +182,43 @@ before you submit your code: * Verify that Rust code has been formatted and that all clippy lints have been fixed: ```console -cd src/bpfd/ +cd src/bpfman/ cargo +nightly fmt --all -- --check cargo +nightly clippy --all -- --deny warnings ``` * Verify that Go code has been formatted and linted * Verify that Yaml files have been formatted (see - [Install Yaml Formatter](https://bpfd.dev/getting-started/building-bpfd/#install-yaml-formatter)) + [Install Yaml Formatter](https://bpfman.io/getting-started/building-bpfman/#install-yaml-formatter)) * Verify that unit tests are passing locally (see - [Unit Testing](https://bpfd.dev/developer-guide/testing/#unit-testing)): + [Unit Testing](https://bpfman.io/developer-guide/testing/#unit-testing)): ```console -cd src/bpfd/ +cd src/bpfman/ cargo test ``` * Verify that integration tests are passing locally (see - [Basic Integration Tests](https://bpfd.dev/developer-guide/testing/#basic-integration-tests)): + [Basic Integration Tests](https://bpfman.io/developer-guide/testing/#basic-integration-tests)): ```console -cd src/bpfd/ +cd src/bpfman/ cargo xtask integration-test ``` -* If developing the bpfd-operator, verify that bpfd-operator unit tests +* If developing the bpfman-operator, verify that bpfman-operator unit tests are passing locally: ```console -cd src/bpfd/bpfd-operator/ +cd src/bpfman/bpfman-operator/ make test ``` -* If developing the bpfd-operator, verify that bpfd-operator integration tests +* If developing the bpfman-operator, verify that bpfman-operator integration tests are passing locally (see - [Kubernetes Integration Tests](https://bpfd.dev/developer-guide/testing/#kubernetes-integration-tests)): + [Kubernetes Integration Tests](https://bpfman.io/developer-guide/testing/#kubernetes-integration-tests)): ```console -cd src/bpfd/bpfd-operator/ +cd src/bpfman/bpfman-operator/ make test-integration ``` diff --git a/Cargo.lock b/Cargo.lock index 27047c7a4..760ba55b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "aya" version = "0.11.0" -source = "git+https://github.com/aya-rs/aya?branch=main#958931efcbfd86cab2220b36b7ebb2b34c18a842" +source = "git+https://github.com/aya-rs/aya?branch=main#33b2e45ad313f7468a7d11667f13d9c365e2a263" dependencies = [ "assert_matches", "aya-obj", @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "aya-obj" version = "0.1.0" -source = "git+https://github.com/aya-rs/aya?branch=main#958931efcbfd86cab2220b36b7ebb2b34c18a842" +source = "git+https://github.com/aya-rs/aya?branch=main#33b2e45ad313f7468a7d11667f13d9c365e2a263" dependencies = [ "bytes", "core-error", @@ -343,7 +343,7 @@ version = "0.3.1" dependencies = [ "anyhow", "base64 0.21.5", - "bpfd-api", + "bpfman-api", "clap", "comfy-table", "env_logger", @@ -358,7 +358,7 @@ dependencies = [ ] [[package]] -name = "bpfd" +name = "bpfman" version = "0.3.1" dependencies = [ "anyhow", @@ -366,8 +366,8 @@ dependencies = [ "async-trait", "aya", "base16ct", - "bpfd-api", - "bpfd-csi", + "bpfman-api", + "bpfman-csi", "caps", "chrono", "clap", @@ -396,7 +396,7 @@ dependencies = [ ] [[package]] -name = "bpfd-api" +name = "bpfman-api" version = "0.3.1" dependencies = [ "aya", @@ -412,7 +412,7 @@ dependencies = [ ] [[package]] -name = "bpfd-csi" +name = "bpfman-csi" version = "1.8.0" dependencies = [ "prost", @@ -853,9 +853,9 @@ checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" -version = "0.16.9" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der", "digest", @@ -981,9 +981,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "53a56f0780318174bad1c127063fd0c5fdfb35398e3cd79ffaab931a6c79df80" [[package]] name = "filetime" @@ -1450,7 +1450,7 @@ version = "0.1.0" dependencies = [ "anyhow", "assert_cmd", - "bpfd-api", + "bpfman-api", "env_logger", "integration-test-macros", "inventory", @@ -2353,9 +2353,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa3d084c8704911bfefb2771be2f9b6c5c0da7343a71e0021ee3c665cada738" +checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" dependencies = [ "bytes", "heck", @@ -2388,9 +2388,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8339f32236f590281e2f6368276441394fcd1b2133b549cc895d0ae80f2f9a52" +checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" dependencies = [ "prost", ] @@ -2653,9 +2653,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", "ring 0.17.5", @@ -2873,9 +2873,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ "digest", "rand_core", @@ -3981,9 +3981,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "12a3946ecfc929b583800f4629b6c25b88ac6e92a40ea5670f77112a85d40a8b" dependencies = [ "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 83affaaac..f1cb19d21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [workspace] members = [ "bpfctl", - "bpfd", - "bpfd-api", + "bpfman", + "bpfman-api", "csi", "tests/integration-test", "tests/integration-test-macros", @@ -21,8 +21,8 @@ async-trait = { version = "0.1", default-features = false } aya = { version = "0.11", default-features = false } base16ct = { version = "0.2.0", default-features = false } base64 = { version = "0.21.5", default-features = false } -bpfd-api = { version = "0.3.1", path = "./bpfd-api" } -bpfd-csi = { version = "1.8.0", path = "./csi" } +bpfman-api = { version = "0.3.1", path = "./bpfman-api" } +bpfman-csi = { version = "1.8.0", path = "./csi" } caps = { version = "0.5.4", default-features = false } chrono = { version = "0.4.31", default-features = false } clap = { version = "4", default-features = false } diff --git a/GOVERNANCE.md b/GOVERNANCE.md index bf1c6b85e..8c4238735 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -1,6 +1,6 @@ -# bpfd Project Governance +# bpfman Project Governance -The bpfd project is dedicated to creating an easy way to run eBPF programs on a single host and in clusters. This governance explains how the project is run. +The bpfman project is dedicated to creating an easy way to run eBPF programs on a single host and in clusters. This governance explains how the project is run. - [Values](#values) - [Maintainers](#maintainers) @@ -13,7 +13,7 @@ The bpfd project is dedicated to creating an easy way to run eBPF programs on a ## Values -The bpfd project and its leadership embrace the following values: +The bpfman project and its leadership embrace the following values: - Openness: Communication and decision-making happens in the open and is discoverable for future reference. As much as possible, all discussions and work take place in public @@ -35,13 +35,13 @@ The bpfd project and its leadership embrace the following values: ## Maintainers -bpfd Maintainers have write access to the [project GitHub repository](https://github.com/bpfd-dev/bpfd). +bpfman Maintainers have write access to the [project GitHub repository](https://github.com/bpfman/bpfman). They can merge their patches or patches from others. The list of current maintainers can be found at [MAINTAINERS.md](./MAINTAINERS.md). Maintainers collectively manage the project's resources and contributors. This privilege is granted with some expectation of responsibility: maintainers -are people who care about the bpfd project and want to help it grow and +are people who care about the bpfman project and want to help it grow and improve. A maintainer is not just someone who can make changes, but someone who has demonstrated their ability to collaborate with the team, get the most knowledgeable people to review code and docs, contribute high-quality code, and @@ -117,7 +117,7 @@ holes and breaches according to the [security policy](./SECURITY.md). ## Voting -While most business in bpfd is conducted by "[lazy consensus](https://community.apache.org/committers/lazyConsensus.html)", +While most business in bpfman is conducted by "[lazy consensus](https://community.apache.org/committers/lazyConsensus.html)", periodically the Maintainers may need to vote on specific actions or changes. A vote can be taken on the private developer slack channel for security or conduct matters. Votes may also be taken at [the developer meeting](./MEETINGS.md). Any Maintainer may diff --git a/LICENSE-APACHE b/LICENSE-APACHE index a0b627eba..bf9834cce 100644 --- a/LICENSE-APACHE +++ b/LICENSE-APACHE @@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work. same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright {yyyy} Authors of bpfd. +Copyright {yyyy} Authors of bpfman. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/LICENSE-BSD2 b/LICENSE-BSD2 index 21ad897f5..04413510e 100644 --- a/LICENSE-BSD2 +++ b/LICENSE-BSD2 @@ -1,4 +1,4 @@ -Copyright Authors of bpfd. All rights reserved. +Copyright Authors of bpfman. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/MAINTAINERS.md b/MAINTAINERS.md index f7dcd15d8..775efc2d3 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -7,6 +7,6 @@ See [CODEOWNERS](./CODEOWNERS) for a detailed list of owners for the various sou | Name | Employer | Responsibilities | | ---- | -------- | ---------------- | | [Dave Tucker](https://github.com/dave-tucker) | Red Hat | Catch all | -| [Andrew Stoycos](https://github.com/astoycos) | Red Hat | bpfd-operator, bpfd-agent | +| [Andrew Stoycos](https://github.com/astoycos) | Red Hat | bpfman-operator, bpfman-agent | | [Andre Fredette](https://github.com/anfredette) | Red Hat | All things tc-bpf | | [Billy McFall](https://github.com/Billy99) | Red Hat | All things systemd | diff --git a/MEETINGS.md b/MEETINGS.md index 08ff01d4a..9c2409386 100644 --- a/MEETINGS.md +++ b/MEETINGS.md @@ -1,4 +1,4 @@ -# bpfd Community Meetings +# bpfman Community Meetings ## Meeting time diff --git a/README.md b/README.md index 1d48ec60c..06ebdbe58 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,39 @@ -# [![bpfd](./docs/img/bpfd.svg)](https://bpfd.dev/) +# [![bpfman](./docs/img/bpfman.svg)](https://bpfman.io/) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![License](https://img.shields.io/badge/License-BSD_2--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause) [![License: GPL v2](https://img.shields.io/badge/License-GPL_v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) ![Build status][build-badge] [![Book][book-badge]][book-url] -[![Netlify Status](https://api.netlify.com/api/v1/badges/557ca612-4b7f-480d-a1cc-43b453502992/deploy-status)](https://app.netlify.com/sites/bpfd/deploys) +[![Netlify Status](https://api.netlify.com/api/v1/badges/557ca612-4b7f-480d-a1cc-43b453502992/deploy-status)](https://app.netlify.com/sites/bpfman/deploys) [build-badge]: - https://img.shields.io/github/actions/workflow/status/bpfd-dev/bpfd/build.yml?branch=main + https://img.shields.io/github/actions/workflow/status/bpfman/bpfman/build.yml?branch=main [book-badge]: https://img.shields.io/badge/read%20the-book-9cf.svg -[book-url]: https://bpfd.dev/ +[book-url]: https://bpfman.io/ -## Welcome to bpfd +_Formerly know as `bpfd`_ -bpfd is a system daemon aimed at simplifying the deployment and management of eBPF programs. +## Welcome to bpfman + +bpfman is a system daemon aimed at simplifying the deployment and management of eBPF programs. It's goal is to enhance the developer-experience as well as provide features to improve security, visibility and program-cooperation. -bpfd includes a Kubernetes operator to bring those same features to Kubernetes, allowing users to +bpfman includes a Kubernetes operator to bring those same features to Kubernetes, allowing users to safely deploy eBPF via custom resources across nodes in a cluster. -Here are some links to help in your bpfd journey (all links are from the bpfd website ): +Here are some links to help in your bpfman journey (all links are from the bpfman website ): -- [Welcome to bpfd](https://bpfd.dev/) for overview of bpfd. -- [Setup and Building bpfd](https://bpfd.dev/getting-started/building-bpfd/) for - instructions on setting up your development environment and building bpfd. -- [Tutorial](https://bpfd.dev/getting-started/tutorial/) for some examples of starting - `bpfd`, managing logs, and using `bpfctl`. -- [Example eBPF Programs](https://bpfd.dev/getting-started/example-bpf/) for some - examples of eBPF programs written in Go, interacting with `bpfd`. -- [How to Deploy bpfd on Kubernetes](https://bpfd.dev/developer-guide/develop-operator/) for details on launching - bpfd in a Kubernetes cluster. -- [Meet the Community](https://bpfd.dev/governance/meetings/) for details on community meeting details. +- [Welcome to bpfman](https://bpfman.io/) for overview of bpfman. +- [Setup and Building bpfman](https://bpfman.io/getting-started/building-bpfman/) for + instructions on setting up your development environment and building bpfman. +- [Tutorial](https://bpfman.io/getting-started/tutorial/) for some examples of starting + `bpfman`, managing logs, and using `bpfctl`. +- [Example eBPF Programs](https://bpfman.io/getting-started/example-bpf/) for some + examples of eBPF programs written in Go, interacting with `bpfman`. +- [How to Deploy bpfman on Kubernetes](https://bpfman.io/developer-guide/develop-operator/) for details on launching + bpfman in a Kubernetes cluster. +- [Meet the Community](https://bpfman.io/governance/meetings/) for details on community meeting details. ## License @@ -49,7 +51,7 @@ All eBPF code is distributed under either: The exact license text varies by file. Please see the SPDX-License-Identifier header in each file for details. -Files that originate from the authors of bpfd use +Files that originate from the authors of bpfman use `(GPL-2.0-only OR BSD-2-Clause)` - for example the [TC dispatcher] or our own example programs. diff --git a/RELEASE.md b/RELEASE.md index 68ee26a58..3c8682263 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,61 +2,61 @@ ## Overview -A release for the bpfd project is comprised of the following major components: +A release for the bpfman project is comprised of the following major components: -- bpfd + bpfctl binaries +- bpfman + bpfctl binaries - Core GRPC API protobuf definitions - Kubernetes Custom Resource Definitions (CRDs) -- Corresponding go pkg in the form of `github.com/bpfd-dev/bpfd` which includes the following: - - `github.com/bpfd-dev/bpfd/clients/gobpfd/v1`: The go client for the bpfd GRPC API - - `github.com/bpfd-dev/bpfd/bpfd-operator/apis`: The go bindings for the - bpfd CRD API - - `github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client`: The autogenerated - clientset for the bpfd CRD API - - `github.com/bpfd-dev/bpfd/bpfd-operator/pkg/helpers`: The provided bpfd CRD +- Corresponding go pkg in the form of `github.com/bpfman/bpfman` which includes the following: + - `github.com/bpfman/bpfman/clients/gobpfman/v1`: The go client for the bpfman GRPC API + - `github.com/bpfman/bpfman/bpfman-operator/apis`: The go bindings for the + bpfman CRD API + - `github.com/bpfman/bpfman/bpfman-operator/pkg/client`: The autogenerated + clientset for the bpfman CRD API + - `github.com/bpfman/bpfman/bpfman-operator/pkg/helpers`: The provided bpfman CRD API helpers. -- Corresponding `bpfd-api`, `bpfd`, and `bpfctl` rust crates which house the rust client for the bpfd GRPC API +- Corresponding `bpfman-api`, `bpfman`, and `bpfctl` rust crates which house the rust client for the bpfman GRPC API - The following core component container images with tag : - - `quay.io/bpfd/bpfd` - - `quay.io/bpfd/bpfctl` - - `quay.io/bpfd/bpfd-operator` - - `quay.io/bpfd/bpfd-agent` - - `quay.io/bpfd/bpfd-operator-bundle` - - `quay.io/bpfd/xdp-dispatcher` - - `quay.io/bpfd/tc-dispatcher` + - `quay.io/bpfman/bpfman` + - `quay.io/bpfman/bpfctl` + - `quay.io/bpfman/bpfman-operator` + - `quay.io/bpfman/bpfman-agent` + - `quay.io/bpfman/bpfman-operator-bundle` + - `quay.io/bpfman/xdp-dispatcher` + - `quay.io/bpfman/tc-dispatcher` - The relevant example bytecode container images with tag from source - code located in the bpfd project: - - `quay.io/bpfd-bytecode/go_xdp_counter` - - `quay.io/bpfd-bytecode/go_tc_counter` - - `quay.io/bpfd-bytecode/go_tracepoint_counter` - - `quay.io/bpfd-bytecode/xdp_pass` - - `quay.io/bpfd-bytecode/tc_pass` - - `quay.io/bpfd-bytecode/tracepoint` - - `quay.io/bpfd-bytecode/xdp_pass_private` - - `quay.io/bpfd-bytecode/uprobe` - - `quay.io/bpfd-bytecode/kprobe` - - `quay.io/bpfd-bytecode/uretprobe` - - `quay.io/bpfd-bytecode/kretprobe` + code located in the bpfman project: + - `quay.io/bpfman-bytecode/go_xdp_counter` + - `quay.io/bpfman-bytecode/go_tc_counter` + - `quay.io/bpfman-bytecode/go_tracepoint_counter` + - `quay.io/bpfman-bytecode/xdp_pass` + - `quay.io/bpfman-bytecode/tc_pass` + - `quay.io/bpfman-bytecode/tracepoint` + - `quay.io/bpfman-bytecode/xdp_pass_private` + - `quay.io/bpfman-bytecode/uprobe` + - `quay.io/bpfman-bytecode/kprobe` + - `quay.io/bpfman-bytecode/uretprobe` + - `quay.io/bpfman-bytecode/kretprobe` - The relevant example userspace container images with tag from source - code located in the bpfd project: - - `quay.io/bpfd-userspace/go_xdp_counter` - - `quay.io/bpfd-userspace/go_tc_counter` - - `quay.io/bpfd-userspace/go_tracepoint_counter` + code located in the bpfman project: + - `quay.io/bpfman-userspace/go_xdp_counter` + - `quay.io/bpfman-userspace/go_tc_counter` + - `quay.io/bpfman-userspace/go_tracepoint_counter` - The OLM (Operator Lifecycle Manager) for the Kubernetes Operator. - This includes a `bundle` directory on disk as well as the - `quay.io/bpfd/bpfd-operator-bundle` with the tag . + `quay.io/bpfman/bpfman-operator-bundle` with the tag . ## Versioning strategy ### Overview -Each new release of bpfd is defined with a "bundle version" that +Each new release of bpfman is defined with a "bundle version" that represents the Git tag of a release, such as `v0.4.0`. This contains the components described above #### Kubernetes API Versions (e.g. v1alpha2, v1beta1) -Within the bpfd-operator, API versions are primarily used to indicate the stability of +Within the bpfman-operator, API versions are primarily used to indicate the stability of a resource. For example, if a resource has not yet graduated to beta, it is still possible that it could either be removed from the API or changed in backwards incompatible ways. For more information on API versions, refer to the @@ -73,7 +73,7 @@ notes generator](https://github.com/kubernetes/release/blob/master/cmd/release-n ```bash go install k8s.io/release/cmd/release-notes@latest export GITHUB_TOKEN=your_token_here -release-notes --start-sha EXAMPLE_COMMIT --end-sha EXAMPLE_COMMIT --branch main --repo bpfd --org bpfd-dev +release-notes --start-sha EXAMPLE_COMMIT --end-sha EXAMPLE_COMMIT --branch main --repo bpfman --org bpfman ``` This output will likely need to be reorganized and cleaned up a bit, but it @@ -84,7 +84,7 @@ release. ### Release Steps -The following steps must be done by one of the [bpfd maintainers][bpfd-team]: +The following steps must be done by one of the [bpfman maintainers][bpfman-team]: For a **PATCH** release: @@ -96,17 +96,17 @@ For a **PATCH** release: - Create a pull request of the `/release-x.x.x` branch into the `release-x.x` branch upstream. Add a hold on this PR waiting for at least one maintainer/codeowner to provide a `lgtm`. This PR should: - Add a new changelog for the release - - Update the cargo.toml versions for the bpfd-api, bpfd, and bpfctl crates - - Update the bpfd-operator version in it's MAKEFILE and run `make bundle` to update the bundle version. - This will generate a new `/bpfd-operator/bundle` directory which will ONLY be tracked in the + - Update the cargo.toml versions for the bpfman-api, bpfman, and bpfctl crates + - Update the bpfman-operator version in it's MAKEFILE and run `make bundle` to update the bundle version. + This will generate a new `/bpfman-operator/bundle` directory which will ONLY be tracked in the `release-x.x` branch not `main`. - Verify the CI tests pass and merge the PR into `release-x.x`. - Create a tag using the `HEAD` of the `release-x.x.x` branch. This can be done using the `git` CLI or Github's [release][release] page. - The Release will be automatically created, after that is complete do the following: - run `make build-release-yamls` and attach the yamls for the version to the release. These will include: - - `bpfd-crds-install-vx.x.x.yaml` - - `bpfd-operator-install-vx.x.x.yaml` + - `bpfman-crds-install-vx.x.x.yaml` + - `bpfman-operator-install-vx.x.x.yaml` - `go-xdp-counter-install-vx.x.x.yaml` - `go-tc-counter-install-vx.x.x.yaml` - `go-tracepoint-counter-install-vx.x.x.yaml` @@ -120,8 +120,8 @@ For a **MAJOR** or **MINOR** release: - Open an update PR that: - Adds a new changelog for the release - - Updates the cargo.toml versions for the bpfd-api, bpfd, and bpfctl crates - - Updates the bpfd-operator version in it's MAKEFILE and run `make bundle` to update the bundle version + - Updates the cargo.toml versions for the bpfman-api, bpfman, and bpfctl crates + - Updates the bpfman-operator version in it's MAKEFILE and run `make bundle` to update the bundle version - Add's a new `examples` config directory for the release version - Make sure CI is green and merge the update PR. - Create a tag using the `HEAD` of the `main` branch. This can be done using the `git` CLI or @@ -131,11 +131,11 @@ For a **MAJOR** or **MINOR** release: page. - The Release will be automatically created, after that is complete do the following: - run `make build-release-yamls` and attach the yamls for the version to the release. These will include: - - `bpfd-crds-install-vx.x.x.yaml` - - `bpfd-operator-install-vx.x.x.yaml` + - `bpfman-crds-install-vx.x.x.yaml` + - `bpfman-operator-install-vx.x.x.yaml` - `go-xdp-counter-install-vx.x.x.yaml` - `go-tc-counter-install-vx.x.x.yaml` - `go-tracepoint-counter-install-vx.x.x.yaml` -[release]: https://github.com/bpfd-dev/bpfd/releases -[bpfd-team]: https://github.com/bpfd-dev/bpfd/blob/main/CODEOWNERS +[release]: https://github.com/bpfman/bpfman/releases +[bpfman-team]: https://github.com/bpfman/bpfman/blob/main/CODEOWNERS diff --git a/SECURITY.md b/SECURITY.md index 7bfa7d8fb..705ebf068 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Supported Versions -No released versions of bpfd, bpfctl, bpfd-agent or bpfd-operator will receive regular security updates until a mainline release has been performed. +No released versions of bpfman, bpfctl, bpfman-agent or bpfman-operator will receive regular security updates until a mainline release has been performed. A reported and fixed vulnerability will be included in the next minor release, which depending on the severity of the vulnerability may be immediate. ## Reporting a Vulnerability diff --git a/bpf/tc_dispatcher.bpf.c b/bpf/tc_dispatcher.bpf.c index 43580aa92..e32b80e28 100644 --- a/bpf/tc_dispatcher.bpf.c +++ b/bpf/tc_dispatcher.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman #include #include #include diff --git a/bpf/xdp_dispatcher_v1.bpf.c b/bpf/xdp_dispatcher_v1.bpf.c index 4f7fa5685..bd6cdf423 100644 --- a/bpf/xdp_dispatcher_v1.bpf.c +++ b/bpf/xdp_dispatcher_v1.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -// Modifications Copyright Authors of bpfd +// Modifications Copyright Authors of bpfman // Derived from: // https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/xdp-dispatcher.c.in diff --git a/bpf/xdp_dispatcher_v2.bpf.c b/bpf/xdp_dispatcher_v2.bpf.c index eedb8717f..e0ff57cb7 100644 --- a/bpf/xdp_dispatcher_v2.bpf.c +++ b/bpf/xdp_dispatcher_v2.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -// Modifications Copyright Authors of bpfd +// Modifications Copyright Authors of bpfman // Derived from: // https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/xdp-dispatcher.c.in diff --git a/bpfctl/Cargo.toml b/bpfctl/Cargo.toml index cc5785ba9..a85578ca9 100644 --- a/bpfctl/Cargo.toml +++ b/bpfctl/Cargo.toml @@ -1,9 +1,9 @@ [package] -description = "A client for working with bpfd" +description = "A client for working with bpfman" edition = "2021" license = "Apache-2.0" name = "bpfctl" -repository = "https://github.com/bpfd-dev/bpfd" +repository = "https://github.com/bpfman/bpfman" version = "0.3.1" [[bin]] @@ -13,7 +13,7 @@ path = "src/main.rs" [dependencies] anyhow = { workspace = true, features = ["std"] } base64 = { workspace = true } -bpfd-api = { workspace = true } +bpfman-api = { workspace = true } clap = { workspace = true, features = [ "color", "derive", diff --git a/bpfctl/src/main.rs b/bpfctl/src/main.rs index 7583de710..17d638979 100644 --- a/bpfctl/src/main.rs +++ b/bpfctl/src/main.rs @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{collections::HashMap, fs, str}; use anyhow::bail; use base64::{engine::general_purpose, Engine as _}; -use bpfd_api::{ +use bpfman_api::{ config::{self, Config}, util::directories::*, v1::{ - attach_info::Info, bpfd_client::BpfdClient, bytecode_location::Location, + attach_info::Info, bpfman_client::BpfmanClient, bytecode_location::Location, list_response::ListResult, AttachInfo, BytecodeImage, BytecodeLocation, GetRequest, KernelProgramInfo, KprobeAttachInfo, ListRequest, LoadRequest, ProgramInfo, PullBytecodeRequest, TcAttachInfo, TracepointAttachInfo, UnloadRequest, UprobeAttachInfo, @@ -42,7 +42,7 @@ enum Commands { LoadFromImage(LoadImageArgs), /// Unload an eBPF program using the program id. Unload(UnloadArgs), - /// List all eBPF programs loaded via bpfd. + /// List all eBPF programs loaded via bpfman. List(ListArgs), /// Get an eBPF program using the program id. Get { @@ -85,7 +85,7 @@ struct ListArgs { #[derive(Args)] struct LoadFileArgs { /// Required: Location of local bytecode file as fully qualified file path. - /// Example: --path $HOME/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o + /// Example: --path $HOME/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o #[clap(short, long, verbatim_doc_comment)] path: String, @@ -103,7 +103,7 @@ struct LoadFileArgs { global: Option>, /// Optional: Specify Key/Value metadata to be attached to a program when it - /// is loaded by bpfd. + /// is loaded by bpfman. /// Format: = /// /// This can later be used to `list` a certain subset of programs which contain @@ -143,7 +143,7 @@ struct LoadImageArgs { global: Option>, /// Optional: Specify Key/Value metadata to be attached to a program when it - /// is loaded by bpfd. + /// is loaded by bpfman. /// Format: = /// /// This can later be used to list a certain subset of programs which contain @@ -283,7 +283,7 @@ struct UnloadArgs { #[derive(Args)] struct PullBytecodeArgs { /// Required: Container Image URL. - /// Example: --image-url quay.io/bpfd-bytecode/xdp_pass:latest + /// Example: --image-url quay.io/bpfman-bytecode/xdp_pass:latest #[clap(short, long, verbatim_doc_comment)] image_url: String, @@ -334,11 +334,11 @@ struct GlobalArg { struct ProgTable(Table); impl ProgTable { - fn new_get_bpfd(r: &Option) -> Result { + fn new_get_bpfman(r: &Option) -> Result { let mut table = Table::new(); table.load_preset(comfy_table::presets::NOTHING); - table.set_header(vec![Cell::new("Bpfd State") + table.set_header(vec![Cell::new("Bpfman State") .add_attribute(comfy_table::Attribute::Bold) .add_attribute(comfy_table::Attribute::Underlined) .fg(Color::Green)]); @@ -370,7 +370,7 @@ impl ProgTable { table.add_row(vec!["Path:", &p]); } }, - // not a bpfd program + // not a bpfman program None => { table.add_row(vec!["NONE"]); return Ok(ProgTable(table)); @@ -780,7 +780,7 @@ fn parse_global_arg(global_arg: &str) -> Result { #[tokio::main] async fn main() -> anyhow::Result<()> { // For output to bpfctl commands, eprintln() should be used. This includes - // errors returned from bpfd. Every command should print some success indication + // errors returned from bpfman. Every command should print some success indication // or a meaningful error. // logs (warn!(), info!(), debug!()) can be used by developers to help debug // failure cases. Being a CLI, they will be limited in their use. To see logs @@ -790,7 +790,7 @@ async fn main() -> anyhow::Result<()> { let cli = Cli::parse(); - let mut config = if let Ok(c) = fs::read_to_string(CFGPATH_BPFD_CONFIG) { + let mut config = if let Ok(c) = fs::read_to_string(CFGPATH_BPFMAN_CONFIG) { c.parse().unwrap_or_else(|_| { warn!("Unable to parse config file, using defaults"); Config::default() @@ -833,7 +833,7 @@ fn select_channel(config: &mut Config) -> Option { } async fn execute_request(command: &Commands, channel: Channel) -> anyhow::Result<()> { - let mut client = BpfdClient::new(channel); + let mut client = BpfmanClient::new(channel); match command { Commands::LoadFromFile(l) => { let bytecode = match command.get_bytecode_location() { @@ -864,7 +864,7 @@ async fn execute_request(command: &Commands, channel: Channel) -> anyhow::Result }); let response = client.load(request).await?.into_inner(); - ProgTable::new_get_bpfd(&response.info)?.print(); + ProgTable::new_get_bpfman(&response.info)?.print(); ProgTable::new_get_unsupported(&response.kernel_info)?.print(); } @@ -897,7 +897,7 @@ async fn execute_request(command: &Commands, channel: Channel) -> anyhow::Result }); let response = client.load(request).await?.into_inner(); - ProgTable::new_get_bpfd(&response.info)?.print(); + ProgTable::new_get_bpfman(&response.info)?.print(); ProgTable::new_get_unsupported(&response.kernel_info)?.print(); } @@ -918,7 +918,7 @@ async fn execute_request(command: &Commands, channel: Channel) -> anyhow::Result .iter() .map(|(k, v)| (k.to_owned(), v.to_owned())) .collect(), - bpfd_programs_only: Some(!l.all), + bpfman_programs_only: Some(!l.all), }); let response = client.list(request).await?.into_inner(); let mut table = ProgTable::new_list(); @@ -935,7 +935,7 @@ async fn execute_request(command: &Commands, channel: Channel) -> anyhow::Result let request = tonic::Request::new(GetRequest { id: *id }); let response = client.get(request).await?.into_inner(); - ProgTable::new_get_bpfd(&response.info)?.print(); + ProgTable::new_get_bpfman(&response.info)?.print(); ProgTable::new_get_unsupported(&response.kernel_info)?.print(); } Commands::PullBytecode(l) => { diff --git a/bpfd-api/src/util.rs b/bpfd-api/src/util.rs deleted file mode 100644 index 5127f9f27..000000000 --- a/bpfd-api/src/util.rs +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd - -pub mod directories { - // The following directories are used by bpfd. They should be created by bpfd service - // via the bpfd.service settings. They will be manually created in the case where bpfd - // is not being run as a service. - // - // ConfigurationDirectory: /etc/bpfd/ - pub const CFGDIR_MODE: u32 = 0o6750; - pub const CFGDIR: &str = "/etc/bpfd"; - pub const CFGDIR_STATIC_PROGRAMS: &str = "/etc/bpfd/programs.d"; - pub const CFGPATH_BPFD_CONFIG: &str = "/etc/bpfd/bpfd.toml"; - pub const CFGPATH_CA_CERTS_PEM: &str = "/etc/bpfd/certs/ca/ca.pem"; - pub const CFGPATH_CA_CERTS_KEY: &str = "/etc/bpfd/certs/ca/ca.key"; - pub const CFGPATH_BPFD_CERTS_PEM: &str = "/etc/bpfd/certs/bpfd/bpfd.pem"; - pub const CFGPATH_BPFD_CERTS_KEY: &str = "/etc/bpfd/certs/bpfd/bpfd.key"; - pub const CFGPATH_BPFD_CLIENT_CERTS_PEM: &str = "/etc/bpfd/certs/bpfd-client/bpfd-client.pem"; - pub const CFGPATH_BPFD_CLIENT_CERTS_KEY: &str = "/etc/bpfd/certs/bpfd-client/bpfd-client.key"; - - // RuntimeDirectory: /run/bpfd/ - pub const RTDIR_MODE: u32 = 0o6770; - pub const RTDIR: &str = "/run/bpfd"; - pub const RTDIR_XDP_DISPATCHER: &str = "/run/bpfd/dispatchers/xdp"; - pub const RTDIR_TC_INGRESS_DISPATCHER: &str = "/run/bpfd/dispatchers/tc-ingress"; - pub const RTDIR_TC_EGRESS_DISPATCHER: &str = "/run/bpfd/dispatchers/tc-egress"; - pub const RTDIR_FS: &str = "/run/bpfd/fs"; - pub const RTDIR_FS_TC_INGRESS: &str = "/run/bpfd/fs/tc-ingress"; - pub const RTDIR_FS_TC_EGRESS: &str = "/run/bpfd/fs/tc-egress"; - pub const RTDIR_FS_XDP: &str = "/run/bpfd/fs/xdp"; - pub const RTDIR_FS_MAPS: &str = "/run/bpfd/fs/maps"; - pub const RTDIR_PROGRAMS: &str = "/run/bpfd/programs"; - pub const RTPATH_BPFD_SOCKET: &str = "/run/bpfd/bpfd.sock"; - // The CSI socket must be in it's own sub directory so we can easily create a dedicated - // K8s volume mount for it. - pub const RTDIR_BPFD_CSI: &str = "/run/bpfd/csi"; - pub const RTPATH_BPFD_CSI_SOCKET: &str = "/run/bpfd/csi/csi.sock"; - pub const RTDIR_BPFD_CSI_FS: &str = "/run/bpfd/csi/fs"; - - // StateDirectory: /var/lib/bpfd/ - pub const STDIR_MODE: u32 = 0o6770; - pub const STDIR: &str = "/var/lib/bpfd"; - pub const STDIR_BYTECODE_IMAGE_CONTENT_STORE: &str = "/var/lib/bpfd/io.bpfd.image.content"; -} diff --git a/bpfd-operator/config/bpfd-deployment/kustomization.yaml b/bpfd-operator/config/bpfd-deployment/kustomization.yaml deleted file mode 100644 index fca3ae712..000000000 --- a/bpfd-operator/config/bpfd-deployment/kustomization.yaml +++ /dev/null @@ -1,11 +0,0 @@ -resources: -- config.yaml -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -images: -- name: quay.io/bpfd/bpfd - newName: quay.io/bpfd/bpfd - newTag: latest -- name: quay.io/bpfd/bpfd-agent - newName: quay.io/bpfd/bpfd-agent - newTag: latest diff --git a/bpfd-operator/config/bpfd-operator-deployment/kustomization.yaml b/bpfd-operator/config/bpfd-operator-deployment/kustomization.yaml deleted file mode 100644 index 26828dd2e..000000000 --- a/bpfd-operator/config/bpfd-operator-deployment/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -resources: -- deployment.yaml -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -images: -- name: quay.io/bpfd/bpfd-operator - newName: quay.io/bpfd/bpfd-operator - newTag: v0.3.1 diff --git a/bpfd-operator/config/rbac/auth_proxy_role.yaml b/bpfd-operator/config/rbac/auth_proxy_role.yaml deleted file mode 100644 index cdc5b2e98..000000000 --- a/bpfd-operator/config/rbac/auth_proxy_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: proxy-role - app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator - app.kubernetes.io/managed-by: kustomize - name: proxy-role -rules: -- apiGroups: - - authentication.k8s.io - resources: - - tokenreviews - verbs: - - create -- apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create diff --git a/bpfd-operator/config/rbac/bpfprogram_editor_role.yaml b/bpfd-operator/config/rbac/bpfprogram_editor_role.yaml deleted file mode 100644 index 3795db571..000000000 --- a/bpfd-operator/config/rbac/bpfprogram_editor_role.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# permissions for end users to edit bpfprograms. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/name: clusterrole - app.kubernetes.io/instance: bpfprogram-editor-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator - app.kubernetes.io/managed-by: kustomize - name: bpfprogram-editor-role -rules: -- apiGroups: - - bpfd.dev - resources: - - bpfprograms - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - bpfd.dev - resources: - - bpfprograms/status - verbs: - - get diff --git a/bpfd-operator/config/rbac/kustomization.yaml b/bpfd-operator/config/rbac/kustomization.yaml deleted file mode 100644 index 42c74d5aa..000000000 --- a/bpfd-operator/config/rbac/kustomization.yaml +++ /dev/null @@ -1,21 +0,0 @@ -resources: -# All RBAC will be applied under this service account in -# the deployment namespace. You may comment out this resource -# if your manager will use a service account that exists at -# runtime. Be sure to update RoleBinding and ClusterRoleBinding -# subjects if changing service account names. -- service_account.yaml -- bpfd-agent/role.yaml -- bpfd-operator/role.yaml -- role_binding.yaml -- leader_election_role.yaml -- leader_election_role_binding.yaml -- bpfprogram_editor_role.yaml -- bpfprogram_viewer_role.yaml -# Comment the following 4 lines if you want to disable -# the auth proxy (https://github.com/brancz/kube-rbac-proxy) -# which protects your /metrics endpoint. -- auth_proxy_service.yaml -- auth_proxy_role.yaml -- auth_proxy_role_binding.yaml -- auth_proxy_client_clusterrole.yaml diff --git a/bpfd-operator/config/rbac/leader_election_role.yaml b/bpfd-operator/config/rbac/leader_election_role.yaml deleted file mode 100644 index 40797687b..000000000 --- a/bpfd-operator/config/rbac/leader_election_role.yaml +++ /dev/null @@ -1,44 +0,0 @@ -# permissions to do leader election. -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/name: role - app.kubernetes.io/instance: leader-election-role - app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator - app.kubernetes.io/managed-by: kustomize - name: leader-election-role -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch diff --git a/bpfd-operator/config/samples/kustomization.yaml b/bpfd-operator/config/samples/kustomization.yaml deleted file mode 100644 index 2a5aaa471..000000000 --- a/bpfd-operator/config/samples/kustomization.yaml +++ /dev/null @@ -1,8 +0,0 @@ -## Append samples you want in your CSV to this file as resources ## -resources: - - bpfd.io_v1alpha1_xdp_pass_xdpprogram.yaml - - bpfd.io_v1alpha1_tracepoint_tracepointprogram.yaml - - bpfd.io_v1alpha1_tc_pass_tcprogram.yaml - - bpfd.io_v1alpha1_kprobe_kprobeprogram.yaml - - bpfd.io_v1alpha1_uprobe_uprobeprogram.yaml -# +kubebuilder:scaffold:manifestskustomizesamples diff --git a/bpfd-operator/config/test/patch.yaml b/bpfd-operator/config/test/patch.yaml deleted file mode 100644 index e4b477cf4..000000000 --- a/bpfd-operator/config/test/patch.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: config - namespace: kube-system -data: - bpfd.agent.image: quay.io/bpfd/bpfd-agent:int-test - bpfd.image: quay.io/bpfd/bpfd:int-test - bpfd.log.level: debug diff --git a/bpfd-operator/controllers/bpfd-agent/internal/test-utils/fake_bpfd_client.go b/bpfd-operator/controllers/bpfd-agent/internal/test-utils/fake_bpfd_client.go deleted file mode 100644 index 728dcffdd..000000000 --- a/bpfd-operator/controllers/bpfd-agent/internal/test-utils/fake_bpfd_client.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2022. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package testutils - -import ( - "context" - "fmt" - "math/rand" - - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" - grpc "google.golang.org/grpc" -) - -type BpfdClientFake struct { - LoadRequests map[int]*gobpfd.LoadRequest - UnloadRequests map[int]*gobpfd.UnloadRequest - ListRequests []*gobpfd.ListRequest - GetRequests map[int]*gobpfd.GetRequest - Programs map[int]*gobpfd.ListResponse_ListResult - PullBytecodeRequests map[int]*gobpfd.PullBytecodeRequest -} - -func NewBpfdClientFake() *BpfdClientFake { - return &BpfdClientFake{ - LoadRequests: map[int]*gobpfd.LoadRequest{}, - UnloadRequests: map[int]*gobpfd.UnloadRequest{}, - ListRequests: []*gobpfd.ListRequest{}, - GetRequests: map[int]*gobpfd.GetRequest{}, - Programs: map[int]*gobpfd.ListResponse_ListResult{}, - PullBytecodeRequests: map[int]*gobpfd.PullBytecodeRequest{}, - } -} - -func NewBpfdClientFakeWithPrograms(programs map[int]*gobpfd.ListResponse_ListResult) *BpfdClientFake { - return &BpfdClientFake{ - LoadRequests: map[int]*gobpfd.LoadRequest{}, - UnloadRequests: map[int]*gobpfd.UnloadRequest{}, - ListRequests: []*gobpfd.ListRequest{}, - GetRequests: map[int]*gobpfd.GetRequest{}, - Programs: programs, - } -} - -func (b *BpfdClientFake) Load(ctx context.Context, in *gobpfd.LoadRequest, opts ...grpc.CallOption) (*gobpfd.LoadResponse, error) { - id := rand.Intn(100) - b.LoadRequests[id] = in - - b.Programs[id] = loadRequestToListResult(in, uint32(id)) - - return &gobpfd.LoadResponse{ - Info: b.Programs[id].Info, - KernelInfo: b.Programs[id].KernelInfo, - }, nil -} - -func (b *BpfdClientFake) Unload(ctx context.Context, in *gobpfd.UnloadRequest, opts ...grpc.CallOption) (*gobpfd.UnloadResponse, error) { - b.UnloadRequests[int(in.Id)] = in - delete(b.Programs, int(in.Id)) - - return &gobpfd.UnloadResponse{}, nil -} - -func (b *BpfdClientFake) List(ctx context.Context, in *gobpfd.ListRequest, opts ...grpc.CallOption) (*gobpfd.ListResponse, error) { - b.ListRequests = append(b.ListRequests, in) - results := &gobpfd.ListResponse{Results: []*gobpfd.ListResponse_ListResult{}} - for _, v := range b.Programs { - results.Results = append(results.Results, v) - } - return results, nil -} - -func loadRequestToListResult(loadReq *gobpfd.LoadRequest, id uint32) *gobpfd.ListResponse_ListResult { - mapOwnerId := loadReq.GetMapOwnerId() - programInfo := gobpfd.ProgramInfo{ - Name: loadReq.GetName(), - Bytecode: loadReq.GetBytecode(), - Attach: loadReq.GetAttach(), - GlobalData: loadReq.GetGlobalData(), - MapOwnerId: &mapOwnerId, - Metadata: loadReq.GetMetadata(), - } - kernelInfo := gobpfd.KernelProgramInfo{ - Id: id, - ProgramType: loadReq.GetProgramType(), - } - - return &gobpfd.ListResponse_ListResult{ - Info: &programInfo, - KernelInfo: &kernelInfo, - } -} - -func (b *BpfdClientFake) Get(ctx context.Context, in *gobpfd.GetRequest, opts ...grpc.CallOption) (*gobpfd.GetResponse, error) { - if b.Programs[int(in.Id)] != nil { - return &gobpfd.GetResponse{ - Info: b.Programs[int(in.Id)].Info, - KernelInfo: b.Programs[int(in.Id)].KernelInfo, - }, nil - } else { - return nil, fmt.Errorf("Requested program does not exist") - } -} - -func (b *BpfdClientFake) PullBytecode(ctx context.Context, in *gobpfd.PullBytecodeRequest, opts ...grpc.CallOption) (*gobpfd.PullBytecodeResponse, error) { - return &gobpfd.PullBytecodeResponse{}, nil -} diff --git a/bpfd-operator/controllers/bpfd-operator/configmap.go b/bpfd-operator/controllers/bpfd-operator/configmap.go deleted file mode 100644 index 74369243f..000000000 --- a/bpfd-operator/controllers/bpfd-operator/configmap.go +++ /dev/null @@ -1,266 +0,0 @@ -/* -Copyright 2022. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package bpfdoperator - -import ( - "context" - "io" - "os" - "reflect" - - appsv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - storagev1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/event" - "sigs.k8s.io/controller-runtime/pkg/predicate" - - "sigs.k8s.io/controller-runtime/pkg/builder" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/log" - - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" -) - -// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create -// +kubebuilder:rbac:groups=storage.k8s.io,resources=csidrivers,verbs=get;list;watch;create;delete -// +kubebuilder:rbac:groups=bpfd.dev,resources=configmaps/finalizers,verbs=update - -type BpfdConfigReconciler struct { - ReconcilerCommon - BpfdStandardDeployment string - CsiDriverDeployment string -} - -// SetupWithManager sets up the controller with the Manager. -func (r *BpfdConfigReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - // Watch the bpfd-daemon configmap to configure the bpfd deployment across the whole cluster - For(&corev1.ConfigMap{}, - builder.WithPredicates(bpfdConfigPredicate())). - // This only watches the bpfd daemonset which is stored on disk and will be created - // by this operator. We're doing a manual watch since the operator (As a controller) - // doesn't really want to have an owner-ref since we don't have a CRD for - // configuring it, only a configmap. - Owns( - &appsv1.DaemonSet{}, - builder.WithPredicates(bpfdDaemonPredicate())). - Complete(r) -} - -func (r *BpfdConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - r.Logger = log.FromContext(ctx) - - bpfdConfig := &corev1.ConfigMap{} - if err := r.Get(ctx, req.NamespacedName, bpfdConfig); err != nil { - if !errors.IsNotFound(err) { - r.Logger.Error(err, "failed getting bpfd config", "ReconcileObject", req.NamespacedName) - return ctrl.Result{}, nil - } - } else { - if updated := controllerutil.AddFinalizer(bpfdConfig, internal.BpfdOperatorFinalizer); updated { - if err := r.Update(ctx, bpfdConfig); err != nil { - r.Logger.Error(err, "failed adding bpfd-operator finalizer to bpfd config") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - } else { - return r.ReconcileBpfdConfig(ctx, req, bpfdConfig) - } - } - - return ctrl.Result{}, nil -} - -func (r *BpfdConfigReconciler) ReconcileBpfdConfig(ctx context.Context, req ctrl.Request, bpfdConfig *corev1.ConfigMap) (ctrl.Result, error) { - bpfdDeployment := &appsv1.DaemonSet{} - - staticBpfdDeployment := LoadAndConfigureBpfdDs(bpfdConfig, r.BpfdStandardDeployment) - r.Logger.V(1).Info("StaticBpfdDeployment with CSI", "DS", staticBpfdDeployment) - bpfdCsiDriver := &storagev1.CSIDriver{} - // one-shot try to create bpfd's CSIDriver object if it doesn't exist, does not re-trigger reconcile. - if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: internal.BpfdCsiDriverName}, bpfdCsiDriver); err != nil { - if errors.IsNotFound(err) { - bpfdCsiDriver = LoadCsiDriver(r.CsiDriverDeployment) - - r.Logger.Info("Creating Bpfd csi driver object") - if err := r.Create(ctx, bpfdCsiDriver); err != nil { - r.Logger.Error(err, "Failed to create Bpfd csi driver") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - } - } - - if err := r.Get(ctx, types.NamespacedName{Namespace: bpfdConfig.Namespace, Name: internal.BpfdDsName}, bpfdDeployment); err != nil { - if errors.IsNotFound(err) { - r.Logger.Info("Creating Bpfd Daemon") - // Causes Requeue - if err := r.Create(ctx, staticBpfdDeployment); err != nil { - r.Logger.Error(err, "Failed to create Bpfd Daemon") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - return ctrl.Result{}, nil - } - - r.Logger.Error(err, "Failed to get bpfd daemon") - return ctrl.Result{}, nil - } - - if !bpfdConfig.DeletionTimestamp.IsZero() { - r.Logger.Info("Deleting bpfd daemon and config") - controllerutil.RemoveFinalizer(bpfdDeployment, internal.BpfdOperatorFinalizer) - - err := r.Update(ctx, bpfdDeployment) - if err != nil { - r.Logger.Error(err, "failed removing bpfd-operator finalizer from bpfdDs") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - - bpfdCsiDriver := &storagev1.CSIDriver{} - - // one-shot try to delete bpfd's CSIDriver object only if it exists. - if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: internal.BpfdCsiDriverName}, bpfdCsiDriver); err == nil { - r.Logger.Info("Deleting Bpfd csi driver object") - if err := r.Delete(ctx, bpfdCsiDriver); err != nil { - r.Logger.Error(err, "Failed to delete Bpfd csi driver") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - } - - if err = r.Delete(ctx, bpfdDeployment); err != nil { - r.Logger.Error(err, "failed deleting bpfd DS") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - - controllerutil.RemoveFinalizer(bpfdConfig, internal.BpfdOperatorFinalizer) - err = r.Update(ctx, bpfdConfig) - if err != nil { - r.Logger.Error(err, "failed removing bpfd-operator finalizer from bpfd config") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - - return ctrl.Result{}, nil - } - - if !reflect.DeepEqual(staticBpfdDeployment.Spec, bpfdDeployment.Spec) { - r.Logger.Info("Reconciling bpfd") - - // Causes Requeue - if err := r.Update(ctx, staticBpfdDeployment); err != nil { - r.Logger.Error(err, "failed reconciling bpfd deployment") - return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil - } - } - - return ctrl.Result{}, nil -} - -// Only reconcile on bpfd-daemon Daemonset events. -func bpfdDaemonPredicate() predicate.Funcs { - return predicate.Funcs{ - GenericFunc: func(e event.GenericEvent) bool { - return e.Object.GetName() == internal.BpfdDsName - }, - CreateFunc: func(e event.CreateEvent) bool { - return e.Object.GetName() == internal.BpfdDsName - }, - UpdateFunc: func(e event.UpdateEvent) bool { - return e.ObjectNew.GetName() == internal.BpfdDsName - }, - DeleteFunc: func(e event.DeleteEvent) bool { - return e.Object.GetName() == internal.BpfdDsName - }, - } -} - -// Only reconcile on bpfd-config configmap events. -func bpfdConfigPredicate() predicate.Funcs { - return predicate.Funcs{ - GenericFunc: func(e event.GenericEvent) bool { - return e.Object.GetName() == internal.BpfdConfigName - }, - CreateFunc: func(e event.CreateEvent) bool { - return e.Object.GetName() == internal.BpfdConfigName - }, - UpdateFunc: func(e event.UpdateEvent) bool { - return e.ObjectNew.GetName() == internal.BpfdConfigName - }, - DeleteFunc: func(e event.DeleteEvent) bool { - return e.Object.GetName() == internal.BpfdConfigName - }, - } -} - -func LoadCsiDriver(path string) *storagev1.CSIDriver { - // Load static bpfd deployment from disk - file, err := os.Open(path) - if err != nil { - panic(err) - } - - b, err := io.ReadAll(file) - if err != nil { - panic(err) - } - - decode := scheme.Codecs.UniversalDeserializer().Decode - obj, _, _ := decode(b, nil, nil) - - return obj.(*storagev1.CSIDriver) -} - -func LoadAndConfigureBpfdDs(config *corev1.ConfigMap, path string) *appsv1.DaemonSet { - // Load static bpfd deployment from disk - file, err := os.Open(path) - if err != nil { - panic(err) - } - - b, err := io.ReadAll(file) - if err != nil { - panic(err) - } - - decode := scheme.Codecs.UniversalDeserializer().Decode - obj, _, _ := decode(b, nil, nil) - - staticBpfdDeployment := obj.(*appsv1.DaemonSet) - - // Runtime Configurable fields - bpfdImage := config.Data["bpfd.image"] - bpfdAgentImage := config.Data["bpfd.agent.image"] - bpfdLogLevel := config.Data["bpfd.log.level"] - bpfdAgentLogLevel := config.Data["bpfd.agent.log.level"] - - // Annotate the log level on the ds so we get automatic restarts on changes. - if staticBpfdDeployment.Spec.Template.ObjectMeta.Annotations == nil { - staticBpfdDeployment.Spec.Template.ObjectMeta.Annotations = make(map[string]string) - } - - staticBpfdDeployment.Spec.Template.ObjectMeta.Annotations["bpfd.dev.bpfd.loglevel"] = bpfdLogLevel - staticBpfdDeployment.Spec.Template.ObjectMeta.Annotations["bpfd.dev.bpfd.agent.loglevel"] = bpfdAgentLogLevel - staticBpfdDeployment.Name = "bpfd-daemon" - staticBpfdDeployment.Namespace = config.Namespace - staticBpfdDeployment.Spec.Template.Spec.Containers[0].Image = bpfdImage - staticBpfdDeployment.Spec.Template.Spec.Containers[1].Image = bpfdAgentImage - controllerutil.AddFinalizer(staticBpfdDeployment, internal.BpfdOperatorFinalizer) - - return staticBpfdDeployment -} diff --git a/bpfd-api/Cargo.toml b/bpfman-api/Cargo.toml similarity index 82% rename from bpfd-api/Cargo.toml rename to bpfman-api/Cargo.toml index 8f2c73f52..3502e9fe8 100644 --- a/bpfd-api/Cargo.toml +++ b/bpfman-api/Cargo.toml @@ -1,9 +1,9 @@ [package] -description = "gRPC bindings to the bpfd API" +description = "gRPC bindings to the bpfman API" edition = "2021" license = "Apache-2.0" -name = "bpfd-api" -repository = "https://github.com/bpfd-dev/bpfd" +name = "bpfman-api" +repository = "https://github.com/bpfman/bpfman" version = "0.3.1" [dependencies] diff --git a/bpfd-api/src/bpfd.v1.rs b/bpfman-api/src/bpfman.v1.rs similarity index 78% rename from bpfd-api/src/bpfd.v1.rs rename to bpfman-api/src/bpfman.v1.rs index bb1a77752..835f8d3ff 100644 --- a/bpfd-api/src/bpfd.v1.rs +++ b/bpfman-api/src/bpfman.v1.rs @@ -73,10 +73,8 @@ pub struct ProgramInfo { #[prost(message, optional, tag = "3")] pub attach: ::core::option::Option, #[prost(map = "string, bytes", tag = "4")] - pub global_data: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::vec::Vec, - >, + pub global_data: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::vec::Vec>, #[prost(uint32, optional, tag = "5")] pub map_owner_id: ::core::option::Option, #[prost(string, tag = "6")] @@ -84,10 +82,8 @@ pub struct ProgramInfo { #[prost(string, repeated, tag = "7")] pub map_used_by: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, #[prost(map = "string, string", tag = "8")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, + pub metadata: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -184,15 +180,11 @@ pub struct LoadRequest { #[prost(message, optional, tag = "4")] pub attach: ::core::option::Option, #[prost(map = "string, string", tag = "5")] - pub metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, + pub metadata: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, #[prost(map = "string, bytes", tag = "6")] - pub global_data: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::vec::Vec, - >, + pub global_data: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::vec::Vec>, #[prost(string, optional, tag = "7")] pub uuid: ::core::option::Option<::prost::alloc::string::String>, #[prost(uint32, optional, tag = "8")] @@ -221,12 +213,10 @@ pub struct ListRequest { #[prost(uint32, optional, tag = "1")] pub program_type: ::core::option::Option, #[prost(bool, optional, tag = "2")] - pub bpfd_programs_only: ::core::option::Option, + pub bpfman_programs_only: ::core::option::Option, #[prost(map = "string, string", tag = "3")] - pub match_metadata: ::std::collections::HashMap< - ::prost::alloc::string::String, - ::prost::alloc::string::String, - >, + pub match_metadata: + ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -269,15 +259,15 @@ pub struct GetResponse { pub kernel_info: ::core::option::Option, } /// Generated client implementations. -pub mod bpfd_client { +pub mod bpfman_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; use tonic::codegen::http::Uri; + use tonic::codegen::*; #[derive(Debug, Clone)] - pub struct BpfdClient { + pub struct BpfmanClient { inner: tonic::client::Grpc, } - impl BpfdClient + impl BpfmanClient where T: tonic::client::GrpcService, T::Error: Into, @@ -295,7 +285,7 @@ pub mod bpfd_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> BpfdClient> + ) -> BpfmanClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -305,11 +295,10 @@ pub mod bpfd_client { >::ResponseBody, >, >, - , - >>::Error: Into + Send + Sync, + >>::Error: + Into + Send + Sync, { - BpfdClient::new(InterceptedService::new(inner, interceptor)) + BpfmanClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -346,111 +335,97 @@ pub mod bpfd_client { &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/bpfd.v1.Bpfd/Load"); + let path = http::uri::PathAndQuery::from_static("/bpfman.v1.Bpfman/Load"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("bpfd.v1.Bpfd", "Load")); + req.extensions_mut() + .insert(GrpcMethod::new("bpfman.v1.Bpfman", "Load")); self.inner.unary(req, path, codec).await } pub async fn unload( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/bpfd.v1.Bpfd/Unload"); + let path = http::uri::PathAndQuery::from_static("/bpfman.v1.Bpfman/Unload"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("bpfd.v1.Bpfd", "Unload")); + req.extensions_mut() + .insert(GrpcMethod::new("bpfman.v1.Bpfman", "Unload")); self.inner.unary(req, path, codec).await } pub async fn list( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/bpfd.v1.Bpfd/List"); + let path = http::uri::PathAndQuery::from_static("/bpfman.v1.Bpfman/List"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("bpfd.v1.Bpfd", "List")); + req.extensions_mut() + .insert(GrpcMethod::new("bpfman.v1.Bpfman", "List")); self.inner.unary(req, path, codec).await } pub async fn pull_bytecode( &mut self, request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/bpfd.v1.Bpfd/PullBytecode", - ); + let path = http::uri::PathAndQuery::from_static("/bpfman.v1.Bpfman/PullBytecode"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("bpfd.v1.Bpfd", "PullBytecode")); + req.extensions_mut() + .insert(GrpcMethod::new("bpfman.v1.Bpfman", "PullBytecode")); self.inner.unary(req, path, codec).await } pub async fn get( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/bpfd.v1.Bpfd/Get"); + let path = http::uri::PathAndQuery::from_static("/bpfman.v1.Bpfman/Get"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("bpfd.v1.Bpfd", "Get")); + req.extensions_mut() + .insert(GrpcMethod::new("bpfman.v1.Bpfman", "Get")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. -pub mod bpfd_server { +pub mod bpfman_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with BpfdServer. + /// Generated trait containing gRPC methods that should be implemented for use with BpfmanServer. #[async_trait] - pub trait Bpfd: Send + Sync + 'static { + pub trait Bpfman: Send + Sync + 'static { async fn load( &self, request: tonic::Request, @@ -466,17 +441,14 @@ pub mod bpfd_server { async fn pull_bytecode( &self, request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; + ) -> std::result::Result, tonic::Status>; async fn get( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct BpfdServer { + pub struct BpfmanServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -484,7 +456,7 @@ pub mod bpfd_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl BpfdServer { + impl BpfmanServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -498,10 +470,7 @@ pub mod bpfd_server { max_encoding_message_size: None, } } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { @@ -536,9 +505,9 @@ pub mod bpfd_server { self } } - impl tonic::codegen::Service> for BpfdServer + impl tonic::codegen::Service> for BpfmanServer where - T: Bpfd, + T: Bpfman, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -554,24 +523,18 @@ pub mod bpfd_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/bpfd.v1.Bpfd/Load" => { + "/bpfman.v1.Bpfman/Load" => { #[allow(non_camel_case_types)] - struct LoadSvc(pub Arc); - impl tonic::server::UnaryService - for LoadSvc { + struct LoadSvc(pub Arc); + impl tonic::server::UnaryService for LoadSvc { type Response = super::LoadResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::load(&inner, request).await - }; + let fut = async move { ::load(&inner, request).await }; Box::pin(fut) } } @@ -598,24 +561,18 @@ pub mod bpfd_server { }; Box::pin(fut) } - "/bpfd.v1.Bpfd/Unload" => { + "/bpfman.v1.Bpfman/Unload" => { #[allow(non_camel_case_types)] - struct UnloadSvc(pub Arc); - impl tonic::server::UnaryService - for UnloadSvc { + struct UnloadSvc(pub Arc); + impl tonic::server::UnaryService for UnloadSvc { type Response = super::UnloadResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::unload(&inner, request).await - }; + let fut = async move { ::unload(&inner, request).await }; Box::pin(fut) } } @@ -642,24 +599,18 @@ pub mod bpfd_server { }; Box::pin(fut) } - "/bpfd.v1.Bpfd/List" => { + "/bpfman.v1.Bpfman/List" => { #[allow(non_camel_case_types)] - struct ListSvc(pub Arc); - impl tonic::server::UnaryService - for ListSvc { + struct ListSvc(pub Arc); + impl tonic::server::UnaryService for ListSvc { type Response = super::ListResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::list(&inner, request).await - }; + let fut = async move { ::list(&inner, request).await }; Box::pin(fut) } } @@ -686,24 +637,19 @@ pub mod bpfd_server { }; Box::pin(fut) } - "/bpfd.v1.Bpfd/PullBytecode" => { + "/bpfman.v1.Bpfman/PullBytecode" => { #[allow(non_camel_case_types)] - struct PullBytecodeSvc(pub Arc); - impl tonic::server::UnaryService - for PullBytecodeSvc { + struct PullBytecodeSvc(pub Arc); + impl tonic::server::UnaryService for PullBytecodeSvc { type Response = super::PullBytecodeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::pull_bytecode(&inner, request).await - }; + let fut = + async move { ::pull_bytecode(&inner, request).await }; Box::pin(fut) } } @@ -730,24 +676,18 @@ pub mod bpfd_server { }; Box::pin(fut) } - "/bpfd.v1.Bpfd/Get" => { + "/bpfman.v1.Bpfman/Get" => { #[allow(non_camel_case_types)] - struct GetSvc(pub Arc); - impl tonic::server::UnaryService - for GetSvc { + struct GetSvc(pub Arc); + impl tonic::server::UnaryService for GetSvc { type Response = super::GetResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; + type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get(&inner, request).await - }; + let fut = async move { ::get(&inner, request).await }; Box::pin(fut) } } @@ -774,22 +714,18 @@ pub mod bpfd_server { }; Box::pin(fut) } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), } } } - impl Clone for BpfdServer { + impl Clone for BpfmanServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -801,7 +737,7 @@ pub mod bpfd_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -811,7 +747,7 @@ pub mod bpfd_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for BpfdServer { - const NAME: &'static str = "bpfd.v1.Bpfd"; + impl tonic::server::NamedService for BpfmanServer { + const NAME: &'static str = "bpfman.v1.Bpfman"; } } diff --git a/bpfd-api/src/config.rs b/bpfman-api/src/config.rs similarity index 95% rename from bpfd-api/src/config.rs rename to bpfman-api/src/config.rs index 8c9cc731e..eeb64aa7c 100644 --- a/bpfd-api/src/config.rs +++ b/bpfman-api/src/config.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{collections::HashMap, str::FromStr}; @@ -113,7 +113,7 @@ impl Default for Endpoint { } fn default_unix() -> String { - RTPATH_BPFD_SOCKET.to_string() + RTPATH_BPFMAN_SOCKET.to_string() } fn default_enabled() -> bool { @@ -234,21 +234,21 @@ mod test { [[grpc.endpoints]] type = "unix" enabled = true - path = "/run/bpfd/bpfd.sock" + path = "/run/bpfman/bpfman.sock" [[grpc.endpoints]] type = "unix" enabled = true - path = "/run/bpfd/bpfd2.sock" + path = "/run/bpfman/bpfman2.sock" "#; let expected_endpoints: Vec = vec![ Endpoint::Unix { - path: String::from("/run/bpfd/bpfd.sock"), + path: String::from("/run/bpfman/bpfman.sock"), enabled: true, }, Endpoint::Unix { - path: String::from("/run/bpfd/bpfd2.sock"), + path: String::from("/run/bpfman/bpfman2.sock"), enabled: true, }, ]; diff --git a/bpfd-api/src/lib.rs b/bpfman-api/src/lib.rs similarity index 99% rename from bpfd-api/src/lib.rs rename to bpfman-api/src/lib.rs index e01020f0c..c706bbd3a 100644 --- a/bpfd-api/src/lib.rs +++ b/bpfman-api/src/lib.rs @@ -1,9 +1,9 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman pub mod config; pub mod util; -#[path = "bpfd.v1.rs"] +#[path = "bpfman.v1.rs"] #[rustfmt::skip] #[allow(clippy::all)] pub mod v1; diff --git a/bpfman-api/src/util.rs b/bpfman-api/src/util.rs new file mode 100644 index 000000000..cf6dcad3a --- /dev/null +++ b/bpfman-api/src/util.rs @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright Authors of bpfman + +pub mod directories { + // The following directories are used by bpfman. They should be created by bpfman service + // via the bpfman.service settings. They will be manually created in the case where bpfman + // is not being run as a service. + // + // ConfigurationDirectory: /etc/bpfman/ + pub const CFGDIR_MODE: u32 = 0o6750; + pub const CFGDIR: &str = "/etc/bpfman"; + pub const CFGDIR_STATIC_PROGRAMS: &str = "/etc/bpfman/programs.d"; + pub const CFGPATH_BPFMAN_CONFIG: &str = "/etc/bpfman/bpfman.toml"; + pub const CFGPATH_CA_CERTS_PEM: &str = "/etc/bpfman/certs/ca/ca.pem"; + pub const CFGPATH_CA_CERTS_KEY: &str = "/etc/bpfman/certs/ca/ca.key"; + pub const CFGPATH_BPFMAN_CERTS_PEM: &str = "/etc/bpfman/certs/bpfman/bpfman.pem"; + pub const CFGPATH_BPFMAN_CERTS_KEY: &str = "/etc/bpfman/certs/bpfman/bpfman.key"; + pub const CFGPATH_BPFMAN_CLIENT_CERTS_PEM: &str = + "/etc/bpfman/certs/bpfman-client/bpfman-client.pem"; + pub const CFGPATH_BPFMAN_CLIENT_CERTS_KEY: &str = + "/etc/bpfman/certs/bpfman-client/bpfman-client.key"; + + // RuntimeDirectory: /run/bpfman/ + pub const RTDIR_MODE: u32 = 0o6770; + pub const RTDIR: &str = "/run/bpfman"; + pub const RTDIR_XDP_DISPATCHER: &str = "/run/bpfman/dispatchers/xdp"; + pub const RTDIR_TC_INGRESS_DISPATCHER: &str = "/run/bpfman/dispatchers/tc-ingress"; + pub const RTDIR_TC_EGRESS_DISPATCHER: &str = "/run/bpfman/dispatchers/tc-egress"; + pub const RTDIR_FS: &str = "/run/bpfman/fs"; + pub const RTDIR_FS_TC_INGRESS: &str = "/run/bpfman/fs/tc-ingress"; + pub const RTDIR_FS_TC_EGRESS: &str = "/run/bpfman/fs/tc-egress"; + pub const RTDIR_FS_XDP: &str = "/run/bpfman/fs/xdp"; + pub const RTDIR_FS_MAPS: &str = "/run/bpfman/fs/maps"; + pub const RTDIR_PROGRAMS: &str = "/run/bpfman/programs"; + pub const RTPATH_BPFMAN_SOCKET: &str = "/run/bpfman/bpfman.sock"; + // The CSI socket must be in it's own sub directory so we can easily create a dedicated + // K8s volume mount for it. + pub const RTDIR_BPFMAN_CSI: &str = "/run/bpfman/csi"; + pub const RTPATH_BPFMAN_CSI_SOCKET: &str = "/run/bpfman/csi/csi.sock"; + pub const RTDIR_BPFMAN_CSI_FS: &str = "/run/bpfman/csi/fs"; + + // StateDirectory: /var/lib/bpfman/ + pub const STDIR_MODE: u32 = 0o6770; + pub const STDIR: &str = "/var/lib/bpfman"; + pub const STDIR_BYTECODE_IMAGE_CONTENT_STORE: &str = "/var/lib/bpfman/io.bpfman.image.content"; +} diff --git a/bpfd-operator/.dockerignore b/bpfman-operator/.dockerignore similarity index 100% rename from bpfd-operator/.dockerignore rename to bpfman-operator/.dockerignore diff --git a/bpfd-operator/.gitignore b/bpfman-operator/.gitignore similarity index 100% rename from bpfd-operator/.gitignore rename to bpfman-operator/.gitignore diff --git a/bpfd-operator/Containerfile.bpfd-agent b/bpfman-operator/Containerfile.bpfman-agent similarity index 80% rename from bpfd-operator/Containerfile.bpfd-agent rename to bpfman-operator/Containerfile.bpfman-agent index f10f04b14..00e26730c 100644 --- a/bpfd-operator/Containerfile.bpfd-agent +++ b/bpfman-operator/Containerfile.bpfman-agent @@ -1,9 +1,9 @@ # Build the manager binary -FROM golang:1.19 as bpfd-agent-build +FROM golang:1.19 as bpfman-agent-build ARG TARGETOS ARG TARGETARCH -WORKDIR /usr/src/bpfd/ +WORKDIR /usr/src/bpfman/ # Copy the Go Modules manifests COPY go.mod go.mod @@ -21,8 +21,8 @@ COPY . . # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -WORKDIR /usr/src/bpfd/bpfd-operator -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bpfd-agent ./cmd/bpfd-agent/main.go +WORKDIR /usr/src/bpfman/bpfman-operator +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bpfman-agent ./cmd/bpfman-agent/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details @@ -31,7 +31,7 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bp FROM gcr.io/distroless/static:nonroot WORKDIR / -COPY --from=bpfd-agent-build /usr/src/bpfd/bpfd-operator/bpfd-agent . +COPY --from=bpfman-agent-build /usr/src/bpfman/bpfman-operator/bpfman-agent . USER 65532:65532 -ENTRYPOINT ["/bpfd-agent"] +ENTRYPOINT ["/bpfman-agent"] diff --git a/bpfd-operator/Containerfile.bpfd-operator b/bpfman-operator/Containerfile.bpfman-operator similarity index 65% rename from bpfd-operator/Containerfile.bpfd-operator rename to bpfman-operator/Containerfile.bpfman-operator index b160329a4..275fbc2d5 100644 --- a/bpfd-operator/Containerfile.bpfd-operator +++ b/bpfman-operator/Containerfile.bpfman-operator @@ -1,9 +1,9 @@ # Build the manager binary -FROM golang:1.19 as bpfd-operator-build +FROM golang:1.19 as bpfman-operator-build ARG TARGETOS ARG TARGETARCH -WORKDIR /usr/src/bpfd/ +WORKDIR /usr/src/bpfman/ # Copy the Go Modules manifests COPY go.mod go.mod @@ -21,8 +21,8 @@ COPY . . # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -WORKDIR /usr/src/bpfd/bpfd-operator -RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bpfd-operator ./cmd/bpfd-operator/main.go +WORKDIR /usr/src/bpfman/bpfman-operator +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bpfman-operator ./cmd/bpfman-operator/main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details @@ -31,9 +31,9 @@ RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bp FROM gcr.io/distroless/static:nonroot WORKDIR / -COPY --from=bpfd-operator-build /usr/src/bpfd/bpfd-operator/config/bpfd-deployment/daemonset.yaml ./config/bpfd-deployment/daemonset.yaml -COPY --from=bpfd-operator-build /usr/src/bpfd/bpfd-operator/config/bpfd-deployment/csidriverinfo.yaml ./config/bpfd-deployment/csidriverinfo.yaml -COPY --from=bpfd-operator-build /usr/src/bpfd/bpfd-operator/bpfd-operator . +COPY --from=bpfman-operator-build /usr/src/bpfman/bpfman-operator/config/bpfman-deployment/daemonset.yaml ./config/bpfman-deployment/daemonset.yaml +COPY --from=bpfman-operator-build /usr/src/bpfman/bpfman-operator/config/bpfman-deployment/csidriverinfo.yaml ./config/bpfman-deployment/csidriverinfo.yaml +COPY --from=bpfman-operator-build /usr/src/bpfman/bpfman-operator/bpfman-operator . USER 65532:65532 -ENTRYPOINT ["/bpfd-operator"] +ENTRYPOINT ["/bpfman-operator"] diff --git a/bpfd-operator/Containerfile.bundle b/bpfman-operator/Containerfile.bundle similarity index 92% rename from bpfd-operator/Containerfile.bundle rename to bpfman-operator/Containerfile.bundle index 7042bcb29..8b60c6cb5 100644 --- a/bpfd-operator/Containerfile.bundle +++ b/bpfman-operator/Containerfile.bundle @@ -4,7 +4,7 @@ FROM scratch LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ -LABEL operators.operatorframework.io.bundle.package.v1=bpfd-operator +LABEL operators.operatorframework.io.bundle.package.v1=bpfman-operator LABEL operators.operatorframework.io.bundle.channels.v1=alpha LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.26.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 diff --git a/bpfd-operator/Makefile b/bpfman-operator/Makefile similarity index 78% rename from bpfd-operator/Makefile rename to bpfman-operator/Makefile index 5c5703bf8..a07f74d8e 100644 --- a/bpfd-operator/Makefile +++ b/bpfman-operator/Makefile @@ -28,8 +28,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL) # This variable is used to construct full image tags for bundle and catalog images. # # For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both -# bpfd.dev/bpfd-operator-bundle:$VERSION and bpfd.dev/bpfd-operator-catalog:$VERSION. -IMAGE_TAG_BASE ?= bpfd.dev/bpfd-operator +# bpfman.io/bpfman-operator-bundle:$VERSION and bpfman.io/bpfman-operator-catalog:$VERSION. +IMAGE_TAG_BASE ?= bpfman.io/bpfman-operator # BUNDLE_IMG defines the image:tag used for the bundle. # You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=/:) @@ -47,11 +47,11 @@ ifeq ($(USE_IMAGE_DIGESTS), true) endif # Image URL to use all building/pushing image targets -BPFD_IMG ?= quay.io/bpfd/bpfd:latest -BPFD_AGENT_IMG ?= quay.io/bpfd/bpfd-agent:latest -BPFD_OPERATOR_IMG ?= quay.io/bpfd/bpfd-operator:latest -BPFD_OPERATOR_BUNDLE_IMG ?= quay.io/bpfd/bpfd-operator-bundle:latest -KIND_CLUSTER_NAME ?= bpfd-deployment +BPFMAN_IMG ?= quay.io/bpfman/bpfman:latest +BPFMAN_AGENT_IMG ?= quay.io/bpfman/bpfman-agent:latest +BPFMAN_OPERATOR_IMG ?= quay.io/bpfman/bpfman-operator:latest +BPFMAN_OPERATOR_BUNDLE_IMG ?= quay.io/bpfman/bpfman-operator-bundle:latest +KIND_CLUSTER_NAME ?= bpfman-deployment # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.25.0 @@ -156,8 +156,8 @@ ifeq ($(VERIFY_CODEGEN), true) VERIFY_FLAG=--verify-only endif -OUTPUT_PKG ?= github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client -APIS_PKG ?= github.com/bpfd-dev/bpfd/bpfd-operator +OUTPUT_PKG ?= github.com/bpfman/bpfman/bpfman-operator/pkg/client +APIS_PKG ?= github.com/bpfman/bpfman/bpfman-operator CLIENTSET_NAME ?= versioned CLIENTSET_PKG_NAME ?= clientset COMMON_FLAGS ?= ${VERIFY_FLAG} --go-header-file $(shell pwd)/hack/boilerplate.go.txt @@ -165,8 +165,8 @@ COMMON_FLAGS ?= ${VERIFY_FLAG} --go-header-file $(shell pwd)/hack/boilerplate.go .PHONY: manifests manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects. $(CONTROLLER_GEN) crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases - $(CONTROLLER_GEN) rbac:roleName=agent-role paths="./controllers/bpfd-agent/..." output:rbac:artifacts:config=config/rbac/bpfd-agent - $(CONTROLLER_GEN) rbac:roleName=operator-role paths="./controllers/bpfd-operator" output:rbac:artifacts:config=config/rbac/bpfd-operator + $(CONTROLLER_GEN) rbac:roleName=agent-role paths="./controllers/bpfman-agent/..." output:rbac:artifacts:config=config/rbac/bpfman-agent + $(CONTROLLER_GEN) rbac:roleName=operator-role paths="./controllers/bpfman-operator" output:rbac:artifacts:config=config/rbac/bpfman-operator .PHONY: generate generate: manifests generate-register generate-deepcopy generate-typed-clients generate-typed-listers generate-typed-informers ## Generate ALL auto-generated code. @@ -217,7 +217,7 @@ fmt: ## Run go fmt against code. verify: ## Verify all the autogenerated code ./hack/verify-codegen.sh -# Use bpfd/scripts/verify-golint.sh for local linting verification +# Use bpfman/scripts/verify-golint.sh for local linting verification # .PHONY: lint # lint: ## Run golang-ci linter # ./hack/verify-golint.sh @@ -238,8 +238,8 @@ test-integration: ## Run Integration tests. ## See https://github.com/operator-framework/operator-sdk/issues/6285. .PHONY: bundle bundle: operator-sdk generate kustomize manifests ## Generate bundle manifests and metadata, then validate generated files. - cd config/bpfd-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd-operator=${BPFD_OPERATOR_IMG} - cd config/bpfd-deployment && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd=${BPFD_IMG} && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd-agent=${BPFD_AGENT_IMG} + cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG} + cd config/bpfman-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman=${BPFMAN_IMG} && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-agent=${BPFMAN_AGENT_IMG} $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) $(OPERATOR_SDK) bundle validate ./bundle @@ -250,36 +250,36 @@ build-release-yamls: generate kustomize ## Generate the crd install bundle for a ##@ Build .PHONY: build -build: fmt ## Build bpfd-operator and bpfd-agent binaries. - go build -o bin/bpfd-operator cmd/bpfd-operator/main.go - go build -o bin/bpfd-agent cmd/bpfd-agent/main.go +build: fmt ## Build bpfman-operator and bpfman-agent binaries. + go build -o bin/bpfman-operator cmd/bpfman-operator/main.go + go build -o bin/bpfman-agent cmd/bpfman-agent/main.go # If you wish built the manager image targeting other platforms you can use the --platform flag. # (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it. # More info: https://docs.docker.com/develop/develop-images/build_enhancements/ .PHONY: build-images -build-images: ## Build bpfd, bpfd-agent, and bpfd-operator images. - docker build -t ${BPFD_OPERATOR_IMG} -f Containerfile.bpfd-operator ../ - docker build -t ${BPFD_AGENT_IMG} -f Containerfile.bpfd-agent ../ - DOCKER_BUILDKIT=1 docker build -t ${BPFD_IMG} -f ../packaging/container-deployment/Containerfile.bpfd.local ../ +build-images: ## Build bpfman, bpfman-agent, and bpfman-operator images. + docker build -t ${BPFMAN_OPERATOR_IMG} -f Containerfile.bpfman-operator ../ + docker build -t ${BPFMAN_AGENT_IMG} -f Containerfile.bpfman-agent ../ + DOCKER_BUILDKIT=1 docker build -t ${BPFMAN_IMG} -f ../packaging/container-deployment/Containerfile.bpfman.local ../ .PHONY: push-images -push-images: ## Push bpfd, bpfd-agent, bpfd-operator images. - docker push ${BPFD_OPERATOR_IMG} - docker push ${BPFD_AGENT_IMG} - docker push ${BPFD_IMG} +push-images: ## Push bpfman, bpfman-agent, bpfman-operator images. + docker push ${BPFMAN_OPERATOR_IMG} + docker push ${BPFMAN_AGENT_IMG} + docker push ${BPFMAN_IMG} .PHONY: load-images-kind -load-images-kind: ## Load bpfd, bpfd-agent, and bpfd-operator images into the running local kind devel cluster. - kind load docker-image ${BPFD_IMG} ${BPFD_OPERATOR_IMG} ${BPFD_AGENT_IMG} --name ${KIND_CLUSTER_NAME} +load-images-kind: ## Load bpfman, bpfman-agent, and bpfman-operator images into the running local kind devel cluster. + kind load docker-image ${BPFMAN_IMG} ${BPFMAN_OPERATOR_IMG} ${BPFMAN_AGENT_IMG} --name ${KIND_CLUSTER_NAME} .PHONY: bundle-build bundle-build: ## Build the bundle image. - docker build -f Containerfile.bundle -t $(BPFD_OPERATOR_BUNDLE_IMG) . + docker build -f Containerfile.bundle -t $(BPFMAN_OPERATOR_BUNDLE_IMG) . .PHONY: bundle-push bundle-push: ## Push the bundle image. - docker push $(BPFD_OPERATOR_BUNDLE_IMG) + docker push $(BPFMAN_OPERATOR_BUNDLE_IMG) # A comma-separated list of bundle images (e.g. make catalog-build BUNDLE_IMGS=example.com/operator-bundle:v0.1.0,example.com/operator-bundle:v0.2.0). # These images MUST exist in a registry and be pull-able. @@ -325,31 +325,31 @@ setup-kind: ## Setup Kind cluster ## Default deploy target is KIND based with its CSI driver initialized. .PHONY: deploy -deploy: manifests kustomize ## Deploy bpfd-operator to the K8s cluster specified in ~/.kube/config with the csi driver initialized. - cd config/bpfd-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd-operator=${BPFD_OPERATOR_IMG} - cd config/bpfd-deployment && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd=${BPFD_IMG} && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd-agent=${BPFD_AGENT_IMG} +deploy: manifests kustomize ## Deploy bpfman-operator to the K8s cluster specified in ~/.kube/config with the csi driver initialized. + cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG} + cd config/bpfman-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman=${BPFMAN_IMG} && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-agent=${BPFMAN_AGENT_IMG} $(KUSTOMIZE) build config/default | kubectl apply -f - .PHONY: undeploy -undeploy: ## Undeploy bpfd-operator from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. +undeploy: ## Undeploy bpfman-operator from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. $(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f - .PHONY: kind-reload-images kind-reload-images: load-images-kind ## Reload locally build images into a kind cluster and restart the ds and deployment so they're picked up. - kubectl rollout restart daemonset bpfd-daemon -n bpfd - kubectl rollout restart deployment bpfd-operator -n bpfd + kubectl rollout restart daemonset bpfman-daemon -n bpfman + kubectl rollout restart deployment bpfman-operator -n bpfman .PHONY: run-on-kind -run-on-kind: kustomize setup-kind build-images load-images-kind deploy ## Kind Deploy runs the bpfd-operator on a local kind cluster using local builds of bpfd, bpfd-agent, and bpfd-operator +run-on-kind: kustomize setup-kind build-images load-images-kind deploy ## Kind Deploy runs the bpfman-operator on a local kind cluster using local builds of bpfman, bpfman-agent, and bpfman-operator ##@ Openshift Deployment .PHONY: deploy-openshift -deploy-openshift: manifests kustomize ## Deploy bpfd-operator to the Openshift cluster specified in ~/.kube/config. - cd config/bpfd-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd-operator=${BPFD_OPERATOR_IMG} - cd config/bpfd-deployment && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd=${BPFD_IMG} && $(KUSTOMIZE) edit set image quay.io/bpfd/bpfd-agent=${BPFD_AGENT_IMG} +deploy-openshift: manifests kustomize ## Deploy bpfman-operator to the Openshift cluster specified in ~/.kube/config. + cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG} + cd config/bpfman-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman=${BPFMAN_IMG} && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-agent=${BPFMAN_AGENT_IMG} $(KUSTOMIZE) build config/openshift | kubectl apply -f - .PHONY: undeploy-openshift -undeploy-openshift: ## Undeploy bpfd-operator from the Openshift cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. +undeploy-openshift: ## Undeploy bpfman-operator from the Openshift cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. $(KUSTOMIZE) build config/openshift | kubectl delete --ignore-not-found=$(ignore-not-found) -f - diff --git a/bpfd-operator/PROJECT b/bpfman-operator/PROJECT similarity index 62% rename from bpfd-operator/PROJECT rename to bpfman-operator/PROJECT index 616f84c73..566139902 100644 --- a/bpfd-operator/PROJECT +++ b/bpfman-operator/PROJECT @@ -1,58 +1,58 @@ -domain: bpfd.dev +domain: bpfman.io layout: - go.kubebuilder.io/v3 plugins: manifests.sdk.operatorframework.io/v2: {} scorecard.sdk.operatorframework.io/v2: {} -projectName: bpfd-operator -repo: github.com/bpfd-dev/bpfd +projectName: bpfman-operator +repo: github.com/bpfman/bpfman resources: - api: crdVersion: v1 namespaced: true controller: true - domain: bpfd.dev + domain: bpfman.io kind: BpfProgram - path: github.com/bpfd-dev/bpfd/api/v1alpha1 + path: github.com/bpfman/bpfman/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 namespaced: false controller: true - domain: bpfd.dev + domain: bpfman.io kind: XdpProgram - path: github.com/bpfd-dev/bpfd/api/v1alpha1 + path: github.com/bpfman/bpfman/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 namespaced: false controller: true - domain: bpfd.dev + domain: bpfman.io kind: TcProgram - path: github.com/bpfd-dev/bpfd/api/v1alpha1 + path: github.com/bpfman/bpfman/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 namespaced: false controller: true - domain: bpfd.dev + domain: bpfman.io kind: TracePointProgram - path: github.com/bpfd-dev/bpfd/api/v1alpha1 + path: github.com/bpfman/bpfman/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 namespaced: false controller: true - domain: bpfd.dev + domain: bpfman.io kind: KprobeProgram - path: github.com/bpfd-dev/bpfd/api/v1alpha1 + path: github.com/bpfman/bpfman/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 namespaced: false controller: true - domain: bpfd.dev + domain: bpfman.io kind: UprobeProgram - path: github.com/bpfd-dev/bpfd/api/v1alpha1 + path: github.com/bpfman/bpfman/api/v1alpha1 version: v1alpha1 version: "3" diff --git a/bpfd-operator/apis/doc.go b/bpfman-operator/apis/doc.go similarity index 100% rename from bpfd-operator/apis/doc.go rename to bpfman-operator/apis/doc.go diff --git a/bpfd-operator/apis/v1alpha1/bpfprogram_types.go b/bpfman-operator/apis/v1alpha1/bpfprogram_types.go similarity index 100% rename from bpfd-operator/apis/v1alpha1/bpfprogram_types.go rename to bpfman-operator/apis/v1alpha1/bpfprogram_types.go diff --git a/bpfd-operator/apis/v1alpha1/doc.go b/bpfman-operator/apis/v1alpha1/doc.go similarity index 93% rename from bpfd-operator/apis/v1alpha1/doc.go rename to bpfman-operator/apis/v1alpha1/doc.go index affe689b4..18313d2cf 100644 --- a/bpfd-operator/apis/v1alpha1/doc.go +++ b/bpfman-operator/apis/v1alpha1/doc.go @@ -15,7 +15,7 @@ limitations under the License. */ // Package v1alpha1 contains API Schema definitions for the -// bpfd.dev API group. +// bpfman.io API group. // +kubebuilder:object:generate=true -// +groupName=bpfd.dev +// +groupName=bpfman.io package v1alpha1 diff --git a/bpfd-operator/apis/v1alpha1/kprobeProgram_types.go b/bpfman-operator/apis/v1alpha1/kprobeProgram_types.go similarity index 99% rename from bpfd-operator/apis/v1alpha1/kprobeProgram_types.go rename to bpfman-operator/apis/v1alpha1/kprobeProgram_types.go index cff577dff..500bb72ee 100644 --- a/bpfd-operator/apis/v1alpha1/kprobeProgram_types.go +++ b/bpfman-operator/apis/v1alpha1/kprobeProgram_types.go @@ -65,7 +65,7 @@ type KprobeProgramSpec struct { // +kubebuilder:default:=false RetProbe bool `json:"retprobe"` - // // Namespace to attach the uprobe in. (Not supported yet by bpfd.) + // // Namespace to attach the uprobe in. (Not supported yet by bpfman.) // // +optional // Namespace string `json:"namespace"` } diff --git a/bpfd-operator/apis/v1alpha1/shared_types.go b/bpfman-operator/apis/v1alpha1/shared_types.go similarity index 92% rename from bpfd-operator/apis/v1alpha1/shared_types.go rename to bpfman-operator/apis/v1alpha1/shared_types.go index fe2876d36..ddefc597c 100644 --- a/bpfd-operator/apis/v1alpha1/shared_types.go +++ b/bpfman-operator/apis/v1alpha1/shared_types.go @@ -70,11 +70,11 @@ type BpfProgramCommon struct { type PullPolicy string const ( - // PullAlways means that bpfd always attempts to pull the latest bytecode image. Container will fail If the pull fails. + // PullAlways means that bpfman always attempts to pull the latest bytecode image. Container will fail If the pull fails. PullAlways PullPolicy = "Always" - // PullNever means that bpfd never pulls an image, but only uses a local image. Container will fail if the image isn't present + // PullNever means that bpfman never pulls an image, but only uses a local image. Container will fail if the image isn't present PullNever PullPolicy = "Never" - // PullIfNotPresent means that bpfd pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. + // PullIfNotPresent means that bpfman pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails. PullIfNotPresent PullPolicy = "IfNotPresent" ) @@ -97,7 +97,7 @@ type BytecodeImage struct { // +optional ImagePullPolicy PullPolicy `json:"imagepullpolicy"` - // ImagePullSecret is the name of the secret bpfd should use to get remote image + // ImagePullSecret is the name of the secret bpfman should use to get remote image // repository secrets. // +optional ImagePullSecret *ImagePullSecretSelector `json:"imagepullsecret,omitempty"` @@ -129,14 +129,14 @@ const ( // occurred in the controller logic, and the controller will retry. ProgramReconcileError ProgramConditionType = "ReconcileError" - // BpfdProgConfigReconcileSuccess indicates that the BPF program has been + // BpfmanProgConfigReconcileSuccess indicates that the BPF program has been // successfully reconciled. // // TODO: we should consider removing "reconciled" type logic from the // public API as it's an implementation detail of our use of controller // runtime, but not necessarily relevant to human users or integrations. // - // See: https://github.com/bpfd-dev/bpfd/issues/430 + // See: https://github.com/bpfman/bpfman/issues/430 ProgramReconcileSuccess ProgramConditionType = "ReconcileSuccess" // ProgramDeleteError indicates that the BPF program was marked for @@ -151,7 +151,7 @@ const ( // information to the user, but the hardcoded messages need to be replaced // in the future with dynamic and situation-aware messages later. // -// See: https://github.com/bpfd-dev/bpfd/issues/430 +// See: https://github.com/bpfman/bpfman/issues/430 func (b ProgramConditionType) Condition(message string) metav1.Condition { cond := metav1.Condition{} @@ -257,21 +257,21 @@ func (b BpfProgramConditionType) Condition() metav1.Condition { cond = metav1.Condition{ Type: string(BpfProgCondLoaded), Status: metav1.ConditionTrue, - Reason: "bpfdLoaded", + Reason: "bpfmanLoaded", Message: "Successfully loaded bpfProgram", } case BpfProgCondNotLoaded: cond = metav1.Condition{ Type: string(BpfProgCondNotLoaded), Status: metav1.ConditionTrue, - Reason: "bpfdNotLoaded", + Reason: "bpfmanNotLoaded", Message: "Failed to load bpfProgram", } case BpfProgCondNotUnloaded: cond = metav1.Condition{ Type: string(BpfProgCondNotUnloaded), Status: metav1.ConditionTrue, - Reason: "bpfdNotUnloaded", + Reason: "bpfmanNotUnloaded", Message: "Failed to unload bpfProgram", } case BpfProgCondNotSelected: @@ -285,8 +285,8 @@ func (b BpfProgramConditionType) Condition() metav1.Condition { cond = metav1.Condition{ Type: string(BpfProgCondUnloaded), Status: metav1.ConditionTrue, - Reason: "bpfdUnloaded", - Message: "This BpfProgram object and all it's bpfd programs have been unloaded", + Reason: "bpfmanUnloaded", + Message: "This BpfProgram object and all it's bpfman programs have been unloaded", } case BpfProgCondMapOwnerNotFound: cond = metav1.Condition{ diff --git a/bpfd-operator/apis/v1alpha1/tcProgram_types.go b/bpfman-operator/apis/v1alpha1/tcProgram_types.go similarity index 100% rename from bpfd-operator/apis/v1alpha1/tcProgram_types.go rename to bpfman-operator/apis/v1alpha1/tcProgram_types.go diff --git a/bpfd-operator/apis/v1alpha1/tracepointProgram_types.go b/bpfman-operator/apis/v1alpha1/tracepointProgram_types.go similarity index 100% rename from bpfd-operator/apis/v1alpha1/tracepointProgram_types.go rename to bpfman-operator/apis/v1alpha1/tracepointProgram_types.go diff --git a/bpfd-operator/apis/v1alpha1/uprobeProgram_types.go b/bpfman-operator/apis/v1alpha1/uprobeProgram_types.go similarity index 99% rename from bpfd-operator/apis/v1alpha1/uprobeProgram_types.go rename to bpfman-operator/apis/v1alpha1/uprobeProgram_types.go index 041e45923..6afddb6e2 100644 --- a/bpfd-operator/apis/v1alpha1/uprobeProgram_types.go +++ b/bpfman-operator/apis/v1alpha1/uprobeProgram_types.go @@ -76,7 +76,7 @@ type UprobeProgramSpec struct { // +optional Pid int32 `json:"pid"` - // // Namespace to attach the uprobe in. (Not supported yet by bpfd.) + // // Namespace to attach the uprobe in. (Not supported yet by bpfman.) // // +optional // Namespace string `json:"namespace"` } diff --git a/bpfd-operator/apis/v1alpha1/xdpProgram_types.go b/bpfman-operator/apis/v1alpha1/xdpProgram_types.go similarity index 100% rename from bpfd-operator/apis/v1alpha1/xdpProgram_types.go rename to bpfman-operator/apis/v1alpha1/xdpProgram_types.go diff --git a/bpfd-operator/apis/v1alpha1/zz_generated.deepcopy.go b/bpfman-operator/apis/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from bpfd-operator/apis/v1alpha1/zz_generated.deepcopy.go rename to bpfman-operator/apis/v1alpha1/zz_generated.deepcopy.go index 3f37199c2..8cab3d441 100644 --- a/bpfd-operator/apis/v1alpha1/zz_generated.deepcopy.go +++ b/bpfman-operator/apis/v1alpha1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/apis/v1alpha1/zz_generated.register.go b/bpfman-operator/apis/v1alpha1/zz_generated.register.go similarity index 97% rename from bpfd-operator/apis/v1alpha1/zz_generated.register.go rename to bpfman-operator/apis/v1alpha1/zz_generated.register.go index 058a62713..6589989de 100644 --- a/bpfd-operator/apis/v1alpha1/zz_generated.register.go +++ b/bpfman-operator/apis/v1alpha1/zz_generated.register.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import ( ) // GroupName specifies the group name used to register the objects. -const GroupName = "bpfd.dev" +const GroupName = "bpfman.io" // GroupVersion specifies the group and the version used to register the objects. var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"} diff --git a/bpfd-operator/bundle.Dockerfile b/bpfman-operator/bundle.Dockerfile similarity index 92% rename from bpfd-operator/bundle.Dockerfile rename to bpfman-operator/bundle.Dockerfile index 6f9cb2f75..f060e2fa8 100644 --- a/bpfd-operator/bundle.Dockerfile +++ b/bpfman-operator/bundle.Dockerfile @@ -4,7 +4,7 @@ FROM scratch LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ -LABEL operators.operatorframework.io.bundle.package.v1=bpfd-operator +LABEL operators.operatorframework.io.bundle.package.v1=bpfman-operator LABEL operators.operatorframework.io.bundle.channels.v1=alpha LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.27.0 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 diff --git a/bpfd-operator/cmd/bpfd-agent/main.go b/bpfman-operator/cmd/bpfman-agent/main.go similarity index 77% rename from bpfd-operator/cmd/bpfd-agent/main.go rename to bpfman-operator/cmd/bpfman-agent/main.go index 01efd01fa..da13b43d9 100644 --- a/bpfd-operator/cmd/bpfd-agent/main.go +++ b/bpfman-operator/cmd/bpfman-agent/main.go @@ -34,11 +34,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagent "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagent "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal/conn" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + "github.com/bpfman/bpfman/bpfman-operator/internal/conn" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" v1 "k8s.io/api/core/v1" //+kubebuilder:scaffold:imports ) @@ -50,7 +50,7 @@ var ( func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - utilruntime.Must(bpfdiov1alpha1.AddToScheme(scheme)) + utilruntime.Must(bpfmaniov1alpha1.AddToScheme(scheme)) utilruntime.Must(v1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } @@ -63,7 +63,7 @@ func main() { flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.") flag.Parse() - // Get the Log level for bpfd deployment where this pod is running + // Get the Log level for bpfman deployment where this pod is running logLevel := os.Getenv("GO_LOG") switch logLevel { case "info": @@ -101,68 +101,68 @@ func main() { os.Exit(1) } - // Setup bpfd Client + // Setup bpfman Client configFileData := conn.LoadConfig() - setupLog.Info("Connecting over UNIX socket to bpfd") + setupLog.Info("Connecting over UNIX socket to bpfman") - // Set up a connection to bpfd, block until bpfd is up. - setupLog.Info("Waiting for active connection to bpfd", "endpoints", configFileData.Grpc.Endpoints) + // Set up a connection to bpfman, block until bpfman is up. + setupLog.Info("Waiting for active connection to bpfman", "endpoints", configFileData.Grpc.Endpoints) conn, err := conn.CreateConnection(configFileData.Grpc.Endpoints, context.Background(), insecure.NewCredentials()) if err != nil { - setupLog.Error(err, "unable to connect to bpfd") + setupLog.Error(err, "unable to connect to bpfman") os.Exit(1) } nodeName := os.Getenv("KUBE_NODE_NAME") if nodeName == "" { - setupLog.Error(fmt.Errorf("KUBE_NODE_NAME env var not set"), "Couldn't determine bpfd-agent's node") + setupLog.Error(fmt.Errorf("KUBE_NODE_NAME env var not set"), "Couldn't determine bpfman-agent's node") os.Exit(1) } - common := bpfdagent.ReconcilerCommon{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - GrpcConn: conn, - BpfdClient: gobpfd.NewBpfdClient(conn), - NodeName: nodeName, + common := bpfmanagent.ReconcilerCommon{ + Client: mgr.GetClient(), + Scheme: mgr.GetScheme(), + GrpcConn: conn, + BpfmanClient: gobpfman.NewBpfmanClient(conn), + NodeName: nodeName, } - if err = (&bpfdagent.XdpProgramReconciler{ + if err = (&bpfmanagent.XdpProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create xdpProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdagent.TcProgramReconciler{ + if err = (&bpfmanagent.TcProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create tcProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdagent.TracepointProgramReconciler{ + if err = (&bpfmanagent.TracepointProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create tracepointProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdagent.KprobeProgramReconciler{ + if err = (&bpfmanagent.KprobeProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create kprobeProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdagent.UprobeProgramReconciler{ + if err = (&bpfmanagent.UprobeProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create uprobeProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdagent.DiscoveredProgramReconciler{ + if err = (&bpfmanagent.DiscoveredProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create discoveredProgram controller", "controller", "BpfProgram") @@ -180,7 +180,7 @@ func main() { os.Exit(1) } - setupLog.Info("starting Bpfd-Agent") + setupLog.Info("starting Bpfman-Agent") if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { setupLog.Error(err, "problem running manager") os.Exit(1) diff --git a/bpfd-operator/cmd/bpfd-operator/main.go b/bpfman-operator/cmd/bpfman-operator/main.go similarity index 82% rename from bpfd-operator/cmd/bpfd-operator/main.go rename to bpfman-operator/cmd/bpfman-operator/main.go index d1428ff3c..3527791d1 100644 --- a/bpfd-operator/cmd/bpfd-operator/main.go +++ b/bpfman-operator/cmd/bpfman-operator/main.go @@ -30,9 +30,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdoperator "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-operator" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanoperator "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-operator" + "github.com/bpfman/bpfman/bpfman-operator/internal" //+kubebuilder:scaffold:imports ) @@ -43,7 +43,7 @@ var ( func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - utilruntime.Must(bpfdiov1alpha1.AddToScheme(scheme)) + utilruntime.Must(bpfmaniov1alpha1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } @@ -59,7 +59,7 @@ func main() { "Enabling this will ensure there is only one active controller manager.") flag.Parse() - // Get the Log level for bpfd deployment where this pod is running + // Get the Log level for bpfman deployment where this pod is running logLevel := os.Getenv("GO_LOG") switch logLevel { case "info": @@ -89,7 +89,7 @@ func main() { Port: 9443, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "8730d955.bpfd.dev", + LeaderElectionID: "8730d955.bpfman.io", // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily // when the Manager ends. This requires the binary to immediately end when the // Manager is stopped, otherwise, this setting is unsafe. Setting this significantly @@ -107,49 +107,49 @@ func main() { os.Exit(1) } - common := bpfdoperator.ReconcilerCommon{ + common := bpfmanoperator.ReconcilerCommon{ Client: mgr.GetClient(), Scheme: mgr.GetScheme(), } - if err = (&bpfdoperator.BpfdConfigReconciler{ - ReconcilerCommon: common, - BpfdStandardDeployment: internal.BpfdDaemonManifestPath, - CsiDriverDeployment: internal.BpfdCsiDriverPath, + if err = (&bpfmanoperator.BpfmanConfigReconciler{ + ReconcilerCommon: common, + BpfmanStandardDeployment: internal.BpfmanDaemonManifestPath, + CsiDriverDeployment: internal.BpfmanCsiDriverPath, }).SetupWithManager(mgr); err != nil { - setupLog.Error(err, "unable to create bpfdCofig controller", "controller", "BpfProgram") + setupLog.Error(err, "unable to create bpfmanCofig controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdoperator.XdpProgramReconciler{ + if err = (&bpfmanoperator.XdpProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create xdpProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdoperator.TcProgramReconciler{ + if err = (&bpfmanoperator.TcProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create tcProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdoperator.TracepointProgramReconciler{ + if err = (&bpfmanoperator.TracepointProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create tracepointProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdoperator.KprobeProgramReconciler{ + if err = (&bpfmanoperator.KprobeProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create kprobeProgram controller", "controller", "BpfProgram") os.Exit(1) } - if err = (&bpfdoperator.UprobeProgramReconciler{ + if err = (&bpfmanoperator.UprobeProgramReconciler{ ReconcilerCommon: common, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "unable to create uprobeProgram controller", "controller", "BpfProgram") diff --git a/bpfd-operator/config/bpfd-deployment/config.yaml b/bpfman-operator/config/bpfman-deployment/config.yaml similarity index 61% rename from bpfd-operator/config/bpfd-deployment/config.yaml rename to bpfman-operator/config/bpfman-deployment/config.yaml index c0e690187..407fec3c8 100644 --- a/bpfd-operator/config/bpfd-deployment/config.yaml +++ b/bpfman-operator/config/bpfman-deployment/config.yaml @@ -5,15 +5,15 @@ metadata: namespace: kube-system data: ## Can be configured at runtime - bpfd.agent.image: quay.io/bpfd/bpfd-agent:latest - bpfd.image: quay.io/bpfd/bpfd:latest + bpfman.agent.image: quay.io/bpfman/bpfman-agent:latest + bpfman.image: quay.io/bpfman/bpfman:latest ## Can be set to "info", "debug", or "trace" - bpfd.agent.log.level: "info" + bpfman.agent.log.level: "info" ## See https://docs.rs/env_logger/latest/env_logger/ for configuration options - bpfd.log.level: "info" + bpfman.log.level: "info" ## Must be configured at startup - bpfd.toml: | + bpfman.toml: | [[grpc.endpoints]] type = "unix" - path = "/bpfd-sock/bpfd.sock" + path = "/bpfman-sock/bpfman.sock" enabled = true diff --git a/bpfd-operator/config/bpfd-deployment/csidriverinfo.yaml b/bpfman-operator/config/bpfman-deployment/csidriverinfo.yaml similarity index 59% rename from bpfd-operator/config/bpfd-deployment/csidriverinfo.yaml rename to bpfman-operator/config/bpfman-deployment/csidriverinfo.yaml index a243ab4d7..7e6d9f25f 100644 --- a/bpfd-operator/config/bpfd-deployment/csidriverinfo.yaml +++ b/bpfman-operator/config/bpfman-deployment/csidriverinfo.yaml @@ -1,8 +1,8 @@ -## This is part of the payload deployed by the bpfd-operator NOT kustomize. +## This is part of the payload deployed by the bpfman-operator NOT kustomize. apiVersion: storage.k8s.io/v1 kind: CSIDriver metadata: - name: csi.bpfd.dev + name: csi.bpfman.io spec: attachRequired: false podInfoOnMount: true diff --git a/bpfd-operator/config/bpfd-deployment/daemonset.yaml b/bpfman-operator/config/bpfman-deployment/daemonset.yaml similarity index 76% rename from bpfd-operator/config/bpfd-deployment/daemonset.yaml rename to bpfman-operator/config/bpfman-deployment/daemonset.yaml index 6afaa3b3f..0a2574b10 100644 --- a/bpfd-operator/config/bpfd-deployment/daemonset.yaml +++ b/bpfman-operator/config/bpfman-deployment/daemonset.yaml @@ -1,24 +1,24 @@ --- -## This is part of the payload deployed by the bpfd-operator NOT kustomize. +## This is part of the payload deployed by the bpfman-operator NOT kustomize. apiVersion: apps/v1 kind: DaemonSet metadata: name: daemon namespace: kube-system labels: - k8s-app: bpfd + k8s-app: bpfman spec: selector: matchLabels: - name: bpfd-daemon + name: bpfman-daemon template: metadata: labels: - name: bpfd-daemon + name: bpfman-daemon spec: hostNetwork: true dnsPolicy: ClusterFirstWithHostNet - serviceAccountName: bpfd-daemon + serviceAccountName: bpfman-daemon tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods @@ -28,7 +28,7 @@ spec: - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule - # Specify FS group so that the agent can use the bpfd socket + # Specify FS group so that the agent can use the bpfman socket # without needing to be root. securityContext: fsGroup: 2000 @@ -57,8 +57,8 @@ spec: mountPath: /sys/fs/bpf mountPropagation: Bidirectional containers: - - name: bpfd - image: quay.io/bpfd/bpfd:latest + - name: bpfman + image: quay.io/bpfman/bpfman:latest args: [--csi-support] securityContext: privileged: true @@ -67,43 +67,43 @@ spec: - name: RUST_LOG valueFrom: configMapKeyRef: - name: bpfd-config - key: bpfd.log.level + name: bpfman-config + key: bpfman.log.level - name: KUBE_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName volumeMounts: - - name: bpfd-sock - mountPath: /bpfd-sock + - name: bpfman-sock + mountPath: /bpfman-sock - name: runtime - mountPath: /run/bpfd + mountPath: /run/bpfman mountPropagation: Bidirectional - - name: bpfd-config - mountPath: /etc/bpfd/bpfd.toml - subPath: bpfd.toml + - name: bpfman-config + mountPath: /etc/bpfman/bpfman.toml + subPath: bpfman.toml readOnly: true # This mount is needed to attach tracepoint programs - name: host-debug mountPath: /sys/kernel/debug # Needed to ensure images are persisted to disk across restarts - - name: bpfd-content-store - mountPath: /var/lib/bpfd + - name: bpfman-content-store + mountPath: /var/lib/bpfman mountPropagation: Bidirectional # Needed for the aya PIN_BY_NAME feature to function correctly - name: default-bpf-fs mountPath: /sys/fs/bpf mountPropagation: Bidirectional - - mountPath: /run/bpfd/csi + - mountPath: /run/bpfman/csi name: socket-dir - mountPath: /var/lib/kubelet/pods mountPropagation: Bidirectional name: mountpoint-dir - mountPath: /tmp name: tmp-dir - - name: bpfd-agent - command: [/bpfd-agent] - image: quay.io/bpfd/bpfd-agent:latest + - name: bpfman-agent + command: [/bpfman-agent] + image: quay.io/bpfman/bpfman-agent:latest imagePullPolicy: IfNotPresent env: - name: KUBE_NODE_NAME @@ -113,17 +113,17 @@ spec: - name: GO_LOG valueFrom: configMapKeyRef: - name: bpfd-config - key: bpfd.agent.log.level + name: bpfman-config + key: bpfman.agent.log.level volumeMounts: - - name: bpfd-sock - mountPath: /bpfd-sock - - name: bpfd-config - mountPath: /etc/bpfd/bpfd.toml - subPath: bpfd.toml + - name: bpfman-sock + mountPath: /bpfman-sock + - name: bpfman-config + mountPath: /etc/bpfman/bpfman.toml + subPath: bpfman.toml readOnly: true - name: node-driver-registrar - image: quay.io/bpfd/csi-node-driver-registrar:v2.9.0 + image: quay.io/bpfman/csi-node-driver-registrar:v2.9.0 imagePullPolicy: IfNotPresent lifecycle: preStop: @@ -131,11 +131,11 @@ spec: command: - /bin/sh - -c - - rm -rf /registration/csi-bpfd /registration/csi-bpfd-reg.sock + - rm -rf /registration/csi-bpfman /registration/csi-bpfman-reg.sock args: - --v=5 - --csi-address=/csi/csi.sock - - --kubelet-registration-path=/var/lib/kubelet/plugins/csi-bpfd/csi.sock + - --kubelet-registration-path=/var/lib/kubelet/plugins/csi-bpfman/csi.sock env: - name: KUBE_NODE_NAME valueFrom: @@ -149,28 +149,28 @@ spec: name: registration-dir terminationGracePeriodSeconds: 15 volumes: - - name: bpfd-sock + - name: bpfman-sock emptyDir: {} - name: runtime hostPath: - path: /run/bpfd - - name: bpfd-config + path: /run/bpfman + - name: bpfman-config configMap: - name: bpfd-config + name: bpfman-config optional: false - name: host-debug hostPath: path: /sys/kernel/debug - - name: bpfd-content-store + - name: bpfman-content-store hostPath: - path: /var/lib/bpfd + path: /var/lib/bpfman - name: default-bpf-fs hostPath: path: /sys/fs/bpf type: DirectoryOrCreate # This volume is where the socket for kubelet->driver communication is held - hostPath: - path: /var/lib/kubelet/plugins/csi-bpfd + path: /var/lib/kubelet/plugins/csi-bpfman type: DirectoryOrCreate name: socket-dir # This volume is where the driver mounts volumes diff --git a/bpfman-operator/config/bpfman-deployment/kustomization.yaml b/bpfman-operator/config/bpfman-deployment/kustomization.yaml new file mode 100644 index 000000000..7c92df273 --- /dev/null +++ b/bpfman-operator/config/bpfman-deployment/kustomization.yaml @@ -0,0 +1,11 @@ +resources: + - config.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: + - name: quay.io/bpfman/bpfman + newName: quay.io/bpfman/bpfman + newTag: latest + - name: quay.io/bpfman/bpfman-agent + newName: quay.io/bpfman/bpfman-agent + newTag: latest diff --git a/bpfd-operator/config/bpfd-operator-deployment/deployment.yaml b/bpfman-operator/config/bpfman-operator-deployment/deployment.yaml similarity index 90% rename from bpfd-operator/config/bpfd-operator-deployment/deployment.yaml rename to bpfman-operator/config/bpfman-operator-deployment/deployment.yaml index d4bd046eb..a3e7e7ae0 100644 --- a/bpfd-operator/config/bpfd-operator-deployment/deployment.yaml +++ b/bpfman-operator/config/bpfman-operator-deployment/deployment.yaml @@ -6,8 +6,8 @@ metadata: app.kubernetes.io/name: namespace app.kubernetes.io/instance: system app.kubernetes.io/component: manager - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: system --- @@ -21,8 +21,8 @@ metadata: app.kubernetes.io/name: deployment app.kubernetes.io/instance: controller-manager app.kubernetes.io/component: manager - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize spec: selector: @@ -67,15 +67,15 @@ spec: # type: RuntimeDefault containers: - command: - - /bpfd-operator + - /bpfman-operator args: - --leader-elect - image: quay.io/bpfd/bpfd-operator:latest + image: quay.io/bpfman/bpfman-operator:latest imagePullPolicy: IfNotPresent env: - name: GO_LOG value: "debug" - name: bpfd-operator + name: bpfman-operator securityContext: allowPrivilegeEscalation: false capabilities: @@ -102,5 +102,5 @@ spec: requests: cpu: 10m memory: 64Mi - serviceAccountName: bpfd-operator + serviceAccountName: bpfman-operator terminationGracePeriodSeconds: 10 diff --git a/bpfman-operator/config/bpfman-operator-deployment/kustomization.yaml b/bpfman-operator/config/bpfman-operator-deployment/kustomization.yaml new file mode 100644 index 000000000..4b7384134 --- /dev/null +++ b/bpfman-operator/config/bpfman-operator-deployment/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - deployment.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: + - name: quay.io/bpfman/bpfman-operator + newName: quay.io/bpfman/bpfman-operator + newTag: v0.3.1 diff --git a/bpfd-operator/config/crd/bases/bpfd.dev_bpfprograms.yaml b/bpfman-operator/config/crd/bases/bpfman.io_bpfprograms.yaml similarity index 99% rename from bpfd-operator/config/crd/bases/bpfd.dev_bpfprograms.yaml rename to bpfman-operator/config/crd/bases/bpfman.io_bpfprograms.yaml index 2218b39de..d93d3bb65 100644 --- a/bpfd-operator/config/crd/bases/bpfd.dev_bpfprograms.yaml +++ b/bpfman-operator/config/crd/bases/bpfman.io_bpfprograms.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: bpfprograms.bpfd.dev + name: bpfprograms.bpfman.io spec: - group: bpfd.dev + group: bpfman.io names: kind: BpfProgram listKind: BpfProgramList diff --git a/bpfd-operator/config/crd/bases/bpfd.dev_kprobeprograms.yaml b/bpfman-operator/config/crd/bases/bpfman.io_kprobeprograms.yaml similarity index 99% rename from bpfd-operator/config/crd/bases/bpfd.dev_kprobeprograms.yaml rename to bpfman-operator/config/crd/bases/bpfman.io_kprobeprograms.yaml index 6807a7534..5ac7ee8f8 100644 --- a/bpfd-operator/config/crd/bases/bpfd.dev_kprobeprograms.yaml +++ b/bpfman-operator/config/crd/bases/bpfman.io_kprobeprograms.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: kprobeprograms.bpfd.dev + name: kprobeprograms.bpfman.io spec: - group: bpfd.dev + group: bpfman.io names: kind: KprobeProgram listKind: KprobeProgramList @@ -75,7 +75,7 @@ spec: - IfNotPresent type: string imagepullsecret: - description: ImagePullSecret is the name of the secret bpfd + description: ImagePullSecret is the name of the secret bpfman should use to get remote image repository secrets. properties: name: diff --git a/bpfd-operator/config/crd/bases/bpfd.dev_tcprograms.yaml b/bpfman-operator/config/crd/bases/bpfman.io_tcprograms.yaml similarity index 99% rename from bpfd-operator/config/crd/bases/bpfd.dev_tcprograms.yaml rename to bpfman-operator/config/crd/bases/bpfman.io_tcprograms.yaml index 3d9e34079..a6803ea06 100644 --- a/bpfd-operator/config/crd/bases/bpfd.dev_tcprograms.yaml +++ b/bpfman-operator/config/crd/bases/bpfman.io_tcprograms.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: tcprograms.bpfd.dev + name: tcprograms.bpfman.io spec: - group: bpfd.dev + group: bpfman.io names: kind: TcProgram listKind: TcProgramList @@ -79,7 +79,7 @@ spec: - IfNotPresent type: string imagepullsecret: - description: ImagePullSecret is the name of the secret bpfd + description: ImagePullSecret is the name of the secret bpfman should use to get remote image repository secrets. properties: name: diff --git a/bpfd-operator/config/crd/bases/bpfd.dev_tracepointprograms.yaml b/bpfman-operator/config/crd/bases/bpfman.io_tracepointprograms.yaml similarity index 99% rename from bpfd-operator/config/crd/bases/bpfd.dev_tracepointprograms.yaml rename to bpfman-operator/config/crd/bases/bpfman.io_tracepointprograms.yaml index c71f64429..f1d159132 100644 --- a/bpfd-operator/config/crd/bases/bpfd.dev_tracepointprograms.yaml +++ b/bpfman-operator/config/crd/bases/bpfman.io_tracepointprograms.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: tracepointprograms.bpfd.dev + name: tracepointprograms.bpfman.io spec: - group: bpfd.dev + group: bpfman.io names: kind: TracepointProgram listKind: TracepointProgramList @@ -67,7 +67,7 @@ spec: - IfNotPresent type: string imagepullsecret: - description: ImagePullSecret is the name of the secret bpfd + description: ImagePullSecret is the name of the secret bpfman should use to get remote image repository secrets. properties: name: diff --git a/bpfd-operator/config/crd/bases/bpfd.dev_uprobeprograms.yaml b/bpfman-operator/config/crd/bases/bpfman.io_uprobeprograms.yaml similarity index 99% rename from bpfd-operator/config/crd/bases/bpfd.dev_uprobeprograms.yaml rename to bpfman-operator/config/crd/bases/bpfman.io_uprobeprograms.yaml index 5321ab236..2eea1d820 100644 --- a/bpfd-operator/config/crd/bases/bpfd.dev_uprobeprograms.yaml +++ b/bpfman-operator/config/crd/bases/bpfman.io_uprobeprograms.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: uprobeprograms.bpfd.dev + name: uprobeprograms.bpfman.io spec: - group: bpfd.dev + group: bpfman.io names: kind: UprobeProgram listKind: UprobeProgramList @@ -83,7 +83,7 @@ spec: - IfNotPresent type: string imagepullsecret: - description: ImagePullSecret is the name of the secret bpfd + description: ImagePullSecret is the name of the secret bpfman should use to get remote image repository secrets. properties: name: diff --git a/bpfd-operator/config/crd/bases/bpfd.dev_xdpprograms.yaml b/bpfman-operator/config/crd/bases/bpfman.io_xdpprograms.yaml similarity index 99% rename from bpfd-operator/config/crd/bases/bpfd.dev_xdpprograms.yaml rename to bpfman-operator/config/crd/bases/bpfman.io_xdpprograms.yaml index 1f89423c1..4e9baa431 100644 --- a/bpfd-operator/config/crd/bases/bpfd.dev_xdpprograms.yaml +++ b/bpfman-operator/config/crd/bases/bpfman.io_xdpprograms.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: xdpprograms.bpfd.dev + name: xdpprograms.bpfman.io spec: - group: bpfd.dev + group: bpfman.io names: kind: XdpProgram listKind: XdpProgramList @@ -75,7 +75,7 @@ spec: - IfNotPresent type: string imagepullsecret: - description: ImagePullSecret is the name of the secret bpfd + description: ImagePullSecret is the name of the secret bpfman should use to get remote image repository secrets. properties: name: diff --git a/bpfd-operator/config/crd/kustomization.yaml b/bpfman-operator/config/crd/kustomization.yaml similarity index 83% rename from bpfd-operator/config/crd/kustomization.yaml rename to bpfman-operator/config/crd/kustomization.yaml index cb8acb20d..4d26488ac 100644 --- a/bpfd-operator/config/crd/kustomization.yaml +++ b/bpfman-operator/config/crd/kustomization.yaml @@ -2,12 +2,12 @@ # since it depends on service name and namespace that are out of this kustomize package. # It should be run by config/default resources: -- bases/bpfd.dev_bpfprograms.yaml -- bases/bpfd.dev_tcprograms.yaml -- bases/bpfd.dev_tracepointprograms.yaml -- bases/bpfd.dev_xdpprograms.yaml -- bases/bpfd.dev_kprobeprograms.yaml -- bases/bpfd.dev_uprobeprograms.yaml + - bases/bpfman.io_bpfprograms.yaml + - bases/bpfman.io_tcprograms.yaml + - bases/bpfman.io_tracepointprograms.yaml + - bases/bpfman.io_xdpprograms.yaml + - bases/bpfman.io_kprobeprograms.yaml + - bases/bpfman.io_uprobeprograms.yaml #+kubebuilder:scaffold:crdkustomizeresource @@ -34,4 +34,4 @@ patchesStrategicMerge: # the following config is for teaching kustomize how to do kustomization for CRDs. configurations: -- kustomizeconfig.yaml + - kustomizeconfig.yaml diff --git a/bpfd-operator/config/crd/kustomizeconfig.yaml b/bpfman-operator/config/crd/kustomizeconfig.yaml similarity index 100% rename from bpfd-operator/config/crd/kustomizeconfig.yaml rename to bpfman-operator/config/crd/kustomizeconfig.yaml diff --git a/bpfd-operator/config/crd/patches/cainjection_in_bpfprograms.yaml b/bpfman-operator/config/crd/patches/cainjection_in_bpfprograms.yaml similarity index 89% rename from bpfd-operator/config/crd/patches/cainjection_in_bpfprograms.yaml rename to bpfman-operator/config/crd/patches/cainjection_in_bpfprograms.yaml index 6008371d2..f5a245d44 100644 --- a/bpfd-operator/config/crd/patches/cainjection_in_bpfprograms.yaml +++ b/bpfman-operator/config/crd/patches/cainjection_in_bpfprograms.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: bpfprograms.bpfd.dev + name: bpfprograms.bpfman.io diff --git a/bpfd-operator/config/crd/patches/cainjection_in_kprobeprograms.yaml b/bpfman-operator/config/crd/patches/cainjection_in_kprobeprograms.yaml similarity index 88% rename from bpfd-operator/config/crd/patches/cainjection_in_kprobeprograms.yaml rename to bpfman-operator/config/crd/patches/cainjection_in_kprobeprograms.yaml index 939470d1a..0e5599719 100644 --- a/bpfd-operator/config/crd/patches/cainjection_in_kprobeprograms.yaml +++ b/bpfman-operator/config/crd/patches/cainjection_in_kprobeprograms.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: kprobeprograms.bpfd.dev + name: kprobeprograms.bpfman.io diff --git a/bpfd-operator/config/crd/patches/cainjection_in_tcprograms.yaml b/bpfman-operator/config/crd/patches/cainjection_in_tcprograms.yaml similarity index 89% rename from bpfd-operator/config/crd/patches/cainjection_in_tcprograms.yaml rename to bpfman-operator/config/crd/patches/cainjection_in_tcprograms.yaml index 927d3ccd2..5f0ab0f41 100644 --- a/bpfd-operator/config/crd/patches/cainjection_in_tcprograms.yaml +++ b/bpfman-operator/config/crd/patches/cainjection_in_tcprograms.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: tcprograms.bpfd.dev + name: tcprograms.bpfman.io diff --git a/bpfd-operator/config/crd/patches/cainjection_in_tracepointprograms.yaml b/bpfman-operator/config/crd/patches/cainjection_in_tracepointprograms.yaml similarity index 87% rename from bpfd-operator/config/crd/patches/cainjection_in_tracepointprograms.yaml rename to bpfman-operator/config/crd/patches/cainjection_in_tracepointprograms.yaml index 393bbf669..f7c296ff7 100644 --- a/bpfd-operator/config/crd/patches/cainjection_in_tracepointprograms.yaml +++ b/bpfman-operator/config/crd/patches/cainjection_in_tracepointprograms.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: tracepointprograms.bpfd.dev + name: tracepointprograms.bpfman.io diff --git a/bpfd-operator/config/crd/patches/cainjection_in_uprobeprograms.yaml b/bpfman-operator/config/crd/patches/cainjection_in_uprobeprograms.yaml similarity index 88% rename from bpfd-operator/config/crd/patches/cainjection_in_uprobeprograms.yaml rename to bpfman-operator/config/crd/patches/cainjection_in_uprobeprograms.yaml index 362c617b6..88d4e231b 100644 --- a/bpfd-operator/config/crd/patches/cainjection_in_uprobeprograms.yaml +++ b/bpfman-operator/config/crd/patches/cainjection_in_uprobeprograms.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: uprobeprograms.bpfd.dev + name: uprobeprograms.bpfman.io diff --git a/bpfd-operator/config/crd/patches/cainjection_in_xdpprograms.yaml b/bpfman-operator/config/crd/patches/cainjection_in_xdpprograms.yaml similarity index 89% rename from bpfd-operator/config/crd/patches/cainjection_in_xdpprograms.yaml rename to bpfman-operator/config/crd/patches/cainjection_in_xdpprograms.yaml index db825a374..76f9a7ca5 100644 --- a/bpfd-operator/config/crd/patches/cainjection_in_xdpprograms.yaml +++ b/bpfman-operator/config/crd/patches/cainjection_in_xdpprograms.yaml @@ -4,4 +4,4 @@ kind: CustomResourceDefinition metadata: annotations: cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: xdpprograms.bpfd.dev + name: xdpprograms.bpfman.io diff --git a/bpfd-operator/config/crd/patches/webhook_in_bpfprograms.yaml b/bpfman-operator/config/crd/patches/webhook_in_bpfprograms.yaml similarity index 89% rename from bpfd-operator/config/crd/patches/webhook_in_bpfprograms.yaml rename to bpfman-operator/config/crd/patches/webhook_in_bpfprograms.yaml index 3c65a2afe..479948a0f 100644 --- a/bpfd-operator/config/crd/patches/webhook_in_bpfprograms.yaml +++ b/bpfman-operator/config/crd/patches/webhook_in_bpfprograms.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: bpfprograms.bpfd.dev + name: bpfprograms.bpfman.io spec: conversion: strategy: Webhook @@ -13,4 +13,4 @@ spec: name: webhook-service path: /convert conversionReviewVersions: - - v1 + - v1 diff --git a/bpfd-operator/config/crd/patches/webhook_in_kprobeprograms.yaml b/bpfman-operator/config/crd/patches/webhook_in_kprobeprograms.yaml similarity index 88% rename from bpfd-operator/config/crd/patches/webhook_in_kprobeprograms.yaml rename to bpfman-operator/config/crd/patches/webhook_in_kprobeprograms.yaml index 14961290a..060fd9213 100644 --- a/bpfd-operator/config/crd/patches/webhook_in_kprobeprograms.yaml +++ b/bpfman-operator/config/crd/patches/webhook_in_kprobeprograms.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: kprobeprograms.bpfd.dev + name: kprobeprograms.bpfman.io spec: conversion: strategy: Webhook @@ -13,4 +13,4 @@ spec: name: webhook-service path: /convert conversionReviewVersions: - - v1 + - v1 diff --git a/bpfd-operator/config/crd/patches/webhook_in_tcprograms.yaml b/bpfman-operator/config/crd/patches/webhook_in_tcprograms.yaml similarity index 89% rename from bpfd-operator/config/crd/patches/webhook_in_tcprograms.yaml rename to bpfman-operator/config/crd/patches/webhook_in_tcprograms.yaml index 3377967fa..5adeeab9a 100644 --- a/bpfd-operator/config/crd/patches/webhook_in_tcprograms.yaml +++ b/bpfman-operator/config/crd/patches/webhook_in_tcprograms.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: tcprograms.bpfd.dev + name: tcprograms.bpfman.io spec: conversion: strategy: Webhook @@ -13,4 +13,4 @@ spec: name: webhook-service path: /convert conversionReviewVersions: - - v1 + - v1 diff --git a/bpfd-operator/config/crd/patches/webhook_in_tracepointprograms.yaml b/bpfman-operator/config/crd/patches/webhook_in_tracepointprograms.yaml similarity index 87% rename from bpfd-operator/config/crd/patches/webhook_in_tracepointprograms.yaml rename to bpfman-operator/config/crd/patches/webhook_in_tracepointprograms.yaml index 2c25eb4de..25ff36d4c 100644 --- a/bpfd-operator/config/crd/patches/webhook_in_tracepointprograms.yaml +++ b/bpfman-operator/config/crd/patches/webhook_in_tracepointprograms.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: tracepointprograms.bpfd.dev + name: tracepointprograms.bpfman.io spec: conversion: strategy: Webhook @@ -13,4 +13,4 @@ spec: name: webhook-service path: /convert conversionReviewVersions: - - v1 + - v1 diff --git a/bpfd-operator/config/crd/patches/webhook_in_uprobeprograms.yaml b/bpfman-operator/config/crd/patches/webhook_in_uprobeprograms.yaml similarity index 88% rename from bpfd-operator/config/crd/patches/webhook_in_uprobeprograms.yaml rename to bpfman-operator/config/crd/patches/webhook_in_uprobeprograms.yaml index 2ab223a2e..90e8e2fba 100644 --- a/bpfd-operator/config/crd/patches/webhook_in_uprobeprograms.yaml +++ b/bpfman-operator/config/crd/patches/webhook_in_uprobeprograms.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: uprobeprograms.bpfd.dev + name: uprobeprograms.bpfman.io spec: conversion: strategy: Webhook @@ -13,4 +13,4 @@ spec: name: webhook-service path: /convert conversionReviewVersions: - - v1 + - v1 diff --git a/bpfd-operator/config/crd/patches/webhook_in_xdpprograms.yaml b/bpfman-operator/config/crd/patches/webhook_in_xdpprograms.yaml similarity index 89% rename from bpfd-operator/config/crd/patches/webhook_in_xdpprograms.yaml rename to bpfman-operator/config/crd/patches/webhook_in_xdpprograms.yaml index 2ae2bfa6a..321aaa4a8 100644 --- a/bpfd-operator/config/crd/patches/webhook_in_xdpprograms.yaml +++ b/bpfman-operator/config/crd/patches/webhook_in_xdpprograms.yaml @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: xdpprograms.bpfd.dev + name: xdpprograms.bpfman.io spec: conversion: strategy: Webhook @@ -13,4 +13,4 @@ spec: name: webhook-service path: /convert conversionReviewVersions: - - v1 + - v1 diff --git a/bpfd-operator/config/default/kustomization.yaml b/bpfman-operator/config/default/kustomization.yaml similarity index 94% rename from bpfd-operator/config/default/kustomization.yaml rename to bpfman-operator/config/default/kustomization.yaml index 4028890f5..2aa8034a6 100644 --- a/bpfd-operator/config/default/kustomization.yaml +++ b/bpfman-operator/config/default/kustomization.yaml @@ -1,12 +1,12 @@ # Adds namespace to all resources. -namespace: bpfd +namespace: bpfman # Value of this field is prepended to the # names of all resources, e.g. a deployment named # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: bpfd- +namePrefix: bpfman- # Labels to add to all resources and selectors. # commonLabels: @@ -40,5 +40,5 @@ kind: Kustomization resources: - ../crd - ../rbac - - ../bpfd-deployment - - ../bpfd-operator-deployment + - ../bpfman-deployment + - ../bpfman-operator-deployment diff --git a/bpfd-operator/config/default/manager_auth_proxy_patch.yaml b/bpfman-operator/config/default/manager_auth_proxy_patch.yaml similarity index 98% rename from bpfd-operator/config/default/manager_auth_proxy_patch.yaml rename to bpfman-operator/config/default/manager_auth_proxy_patch.yaml index 0b932de23..61acfd03f 100644 --- a/bpfd-operator/config/default/manager_auth_proxy_patch.yaml +++ b/bpfman-operator/config/default/manager_auth_proxy_patch.yaml @@ -48,7 +48,7 @@ spec: requests: cpu: 5m memory: 64Mi - - name: bpfd-operator + - name: bpfman-operator args: - "--health-probe-bind-address=:8081" - "--metrics-bind-address=127.0.0.1:8080" diff --git a/bpfd-operator/config/default/manager_config_patch.yaml b/bpfman-operator/config/default/manager_config_patch.yaml similarity index 80% rename from bpfd-operator/config/default/manager_config_patch.yaml rename to bpfman-operator/config/default/manager_config_patch.yaml index 12d12f087..7d4b43391 100644 --- a/bpfd-operator/config/default/manager_config_patch.yaml +++ b/bpfman-operator/config/default/manager_config_patch.yaml @@ -7,4 +7,4 @@ spec: template: spec: containers: - - name: bpfd-operator + - name: bpfman-operator diff --git a/bpfd-operator/config/manifests/bases/bpfd-operator.clusterserviceversion.yaml b/bpfman-operator/config/manifests/bases/bpfman-operator.clusterserviceversion.yaml similarity index 92% rename from bpfd-operator/config/manifests/bases/bpfd-operator.clusterserviceversion.yaml rename to bpfman-operator/config/manifests/bases/bpfman-operator.clusterserviceversion.yaml index ad21e5b36..76bc2de64 100644 --- a/bpfd-operator/config/manifests/bases/bpfd-operator.clusterserviceversion.yaml +++ b/bpfman-operator/config/manifests/bases/bpfman-operator.clusterserviceversion.yaml @@ -4,9 +4,9 @@ metadata: annotations: alm-examples: "[]" capabilities: Basic Install - containerImage: quay.io/bpfd/bpfd-operator:v0.0.0 - repository: https://github.com/bpfd-dev/bpfd - name: bpfd-operator.v0.0.0 + containerImage: quay.io/bpfman/bpfman-operator:v0.0.0 + repository: https://github.com/bpfman/bpfman + name: bpfman-operator.v0.0.0 namespace: placeholder spec: apiservicedefinitions: {} @@ -15,52 +15,52 @@ spec: - description: BpfProgram is the Schema for the BpfProgram API displayName: Bpf Program kind: BpfProgram - name: bpfprograms.bpfd.dev + name: bpfprograms.bpfman.io version: v1alpha1 - description: XdpProgram is the Schema for the Xdpprograms API displayName: Xdp Program kind: XdpProgram - name: xdpprograms.bpfd.dev + name: xdpprograms.bpfman.io version: v1alpha1 - description: TcProgram is the Schema for the Tcprograms API displayName: Tc Program kind: TcProgram - name: tcprograms.bpfd.dev + name: tcprograms.bpfman.io version: v1alpha1 - description: TracepointProgram is the Schema for the Tracepointprograms API displayName: Tracepoint Program kind: TracepointProgram - name: tracepointprograms.bpfd.dev + name: tracepointprograms.bpfman.io version: v1alpha1 - description: KprobeProgram is the Schema for the Kprobeprograms API displayName: Kprobe Program kind: KprobeProgram - name: kprobeprograms.bpfd.dev + name: kprobeprograms.bpfman.io version: v1alpha1 - description: UprobeProgram is the Schema for the Uprobeprograms API displayName: Uprobe Program kind: UprobeProgram - name: uprobeprograms.bpfd.dev + name: uprobeprograms.bpfman.io version: v1alpha1 description: - "The bpfd Operator is a Kubernetes Operator for deploying [bpfd](https://bpfd.netlify.app/), - a system daemon\nfor managing eBPF programs. It deploys bpfd itself along with + "The bpfman Operator is a Kubernetes Operator for deploying [bpfman](https://bpfman.netlify.app/), + a system daemon\nfor managing eBPF programs. It deploys bpfman itself along with CRDs to make deploying\neBPF programs in Kubernetes much easier.\n\n## - Quick Start\n\nTo get bpfd up and running quickly with self signed certificates - simply do \nthe following.\n\n```bash\nkubectl create namespace openshift-bpfd\n```\n After creating the namespace simply install - the bpfd-operator in the desired namespace from operator-hub\n## - Configuration\n\nThe `bpfd-config` configmap is automatically created in the `bpfd` - namespace and used to configure the bpfd deployment.\n\nTo edit the config simply - run\n\n```bash\nkubectl edit cm bpfd-config\n```\n\nThe following fields are adjustable\n\n- - `bpfd.agent.image`: The image used for the bpfd-agent, defaults to `quay.io/bpfd/bpfd-agent:latest`\n- - `bpfd.image`: The image used for bpfd, defaults to `quay.io/bpfd/bpfd:latest`\n- - `bpfd.log.level`: the log level for bpfd, currently supports - `debug`, `info`, `warn`, `error`, and `fatal`, defaults to `info`\n- `bpfd.agent.log.level`: the log level for the bpfd-agent currently supports `info`, `debug`, and `trace` \n-`bpfd.toml`: - bpfd's custom configuration file.\n\n## Deploying eBPF Programs\n\nThe bpfd operator + Quick Start\n\nTo get bpfman up and running quickly with self signed certificates + simply do \nthe following.\n\n```bash\nkubectl create namespace openshift-bpfman\n```\n After creating the namespace simply install + the bpfman-operator in the desired namespace from operator-hub\n## + Configuration\n\nThe `bpfman-config` configmap is automatically created in the `bpfman` + namespace and used to configure the bpfman deployment.\n\nTo edit the config simply + run\n\n```bash\nkubectl edit cm bpfman-config\n```\n\nThe following fields are adjustable\n\n- + `bpfman.agent.image`: The image used for the bpfman-agent, defaults to `quay.io/bpfman/bpfman-agent:latest`\n- + `bpfman.image`: The image used for bpfman, defaults to `quay.io/bpfman/bpfman:latest`\n- + `bpfman.log.level`: the log level for bpfman, currently supports + `debug`, `info`, `warn`, `error`, and `fatal`, defaults to `info`\n- `bpfman.agent.log.level`: the log level for the bpfman-agent currently supports `info`, `debug`, and `trace` \n-`bpfman.toml`: + bpfman's custom configuration file.\n\n## Deploying eBPF Programs\n\nThe bpfman operator deploys eBPF programs via CRDs. The following CRDs are currently avaliable, \n\n- XdpProgram\n- TcProgram\n- TracepointProgram\n- KprobeProgram\n- UprobeProgram\n\n## More information\n\nPlease - checkout the [bpfd community website](https://bpfd.dev/) for more information." - displayName: Bpfd Operator + checkout the [bpfman community website](https://bpfman.io/) for more information." + displayName: Bpfman Operator icon: - base64data: PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy8pIC0tPgoKPHN2ZwogICB3aWR0aD0iNTEyIgogICBoZWlnaHQ9IjEyOCIKICAgdmlld0JveD0iMCAwIDUxMiAxMjgiCiAgIHZlcnNpb249IjEuMSIKICAgaWQ9InN2ZzUiCiAgIGlua3NjYXBlOnZlcnNpb249IjEuMiAoZGMyYWVkYWYwMywgMjAyMi0wNS0xNSkiCiAgIHNvZGlwb2RpOmRvY25hbWU9ImJwZmQuc3ZnIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxzb2RpcG9kaTpuYW1lZHZpZXcKICAgICBpZD0ibmFtZWR2aWV3NyIKICAgICBwYWdlY29sb3I9IiM1MDUwNTAiCiAgICAgYm9yZGVyY29sb3I9IiNmZmZmZmYiCiAgICAgYm9yZGVyb3BhY2l0eT0iMSIKICAgICBpbmtzY2FwZTpzaG93cGFnZXNoYWRvdz0iMCIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBpbmtzY2FwZTpwYWdlY2hlY2tlcmJvYXJkPSIxIgogICAgIGlua3NjYXBlOmRlc2tjb2xvcj0iIzUwNTA1MCIKICAgICBpbmtzY2FwZTpkb2N1bWVudC11bml0cz0icHgiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjEuNTM1IgogICAgIGlua3NjYXBlOmN4PSIxNjkuNzA2ODQiCiAgICAgaW5rc2NhcGU6Y3k9Ii01Mi40NDI5OTciCiAgICAgaW5rc2NhcGU6d2luZG93LXdpZHRoPSIxOTIwIgogICAgIGlua3NjYXBlOndpbmRvdy1oZWlnaHQ9IjEwMjYiCiAgICAgaW5rc2NhcGU6d2luZG93LXg9IjAiCiAgICAgaW5rc2NhcGU6d2luZG93LXk9IjAiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMSIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJsYXllcjEiIC8+CiAgPGRlZnMKICAgICBpZD0iZGVmczIiPgogICAgPGlua3NjYXBlOnBlcnNwZWN0aXZlCiAgICAgICBzb2RpcG9kaTp0eXBlPSJpbmtzY2FwZTpwZXJzcDNkIgogICAgICAgaW5rc2NhcGU6dnBfeD0iMCA6IDY0IDogMSIKICAgICAgIGlua3NjYXBlOnZwX3k9IjAgOiAxMDAwIDogMCIKICAgICAgIGlua3NjYXBlOnZwX3o9IjUxMiA6IDY0IDogMSIKICAgICAgIGlua3NjYXBlOnBlcnNwM2Qtb3JpZ2luPSIyNTYgOiA0Mi42NjY2NjcgOiAxIgogICAgICAgaWQ9InBlcnNwZWN0aXZlMTc5MjkiIC8+CiAgICA8Y2xpcFBhdGgKICAgICAgIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIgogICAgICAgaWQ9ImNsaXBQYXRoMjcyNjAiPgogICAgICA8cmVjdAogICAgICAgICBzdHlsZT0iZmlsbDpub25lO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDo0LjM2MjgxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxO3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2Utb3BhY2l0eToxIgogICAgICAgICBpZD0icmVjdDI3MjYyIgogICAgICAgICB3aWR0aD0iMTA3LjE1MTg0IgogICAgICAgICBoZWlnaHQ9IjEwNy4xNTE4NCIKICAgICAgICAgeD0iMjMuMTAzNDE2IgogICAgICAgICB5PSIzMS41MzM0MjgiCiAgICAgICAgIHJ5PSIyMC4xNzk3OSIgLz4KICAgIDwvY2xpcFBhdGg+CiAgPC9kZWZzPgogIDxnCiAgICAgaW5rc2NhcGU6bGFiZWw9IkxheWVyIDEiCiAgICAgaW5rc2NhcGU6Z3JvdXBtb2RlPSJsYXllciIKICAgICBpZD0ibGF5ZXIxIj4KICAgIDxnCiAgICAgICBpZD0iZzI3MzA0IgogICAgICAgdHJhbnNmb3JtPSJtYXRyaXgoMS4wNzAxMDM3LDAsMCwxLjA3MDEwMzcsMTkuMTA3MDU0LC04LjY5MjY1NzcpIj4KICAgICAgPGcKICAgICAgICAgaWQ9ImcyNzI1OCIKICAgICAgICAgY2xpcC1wYXRoPSJ1cmwoI2NsaXBQYXRoMjcyNjApIgogICAgICAgICB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtOCwtMTgpIj4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJlbGxpcHNlMTU2ODAiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2YzYjYyNjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC4yOTk4NTI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgdHJhbnNmb3JtPSJzY2FsZSgtMSkiCiAgICAgICAgICAgZD0ibSAtNjYuMDgzNjQsMjQuMTYzNTc4IGEgMTIuMzcyNTI5LDMuOTcyMjMyOCAwIDAgMSAtMTIuMzcyNTI5LDMuOTcyMjMzIDEyLjM3MjUyOSwzLjk3MjIzMjggMCAwIDEgLTEyLjM3MjUyOSwtMy45NzIyMzMgMTIuMzcyNTI5LDMuOTcyMjMyOCAwIDAgMSAxMi4zNzI1MjksLTMuOTcyMjMzIDEyLjM3MjUyOSwzLjk3MjIzMjggMCAwIDEgMTIuMzcyNTI5LDMuOTcyMjMzIHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0iZWxsaXBzZTE1Njc4IgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNmM2I2MjY7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjAuNDg5NDA3O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIHRyYW5zZm9ybT0ic2NhbGUoLTEpIgogICAgICAgICAgIGQ9Im0gLTU4LjI2MjIyNCwzMC4xNjM1NzggYSAyMC4xOTM5NDUsNi40ODMzMTg4IDAgMCAxIC0yMC4xOTM5NDUsNi40ODMzMTkgMjAuMTkzOTQ1LDYuNDgzMzE4OCAwIDAgMSAtMjAuMTkzOTQ1LC02LjQ4MzMxOSAyMC4xOTM5NDUsNi40ODMzMTg4IDAgMCAxIDIwLjE5Mzk0NSwtNi40ODMzMTkgMjAuMTkzOTQ1LDYuNDgzMzE4OCAwIDAgMSAyMC4xOTM5NDUsNi40ODMzMTkgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJlbGxpcHNlMTU2NzYiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2YzYjYyNjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC43O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIHRyYW5zZm9ybT0ic2NhbGUoLTEpIgogICAgICAgICAgIGQ9Im0gLTQ5LjU3MjczMywzOC4xNjM1NzggYSAyOC44ODM0MzYsOS4yNzMxMDI4IDAgMCAxIC0yOC44ODM0MzYsOS4yNzMxMDMgMjguODgzNDM2LDkuMjczMTAyOCAwIDAgMSAtMjguODgzNDQxLC05LjI3MzEwMyAyOC44ODM0MzYsOS4yNzMxMDI4IDAgMCAxIDI4Ljg4MzQ0MSwtOS4yNzMxMDMgMjguODgzNDM2LDkuMjczMTAyOCAwIDAgMSAyOC44ODM0MzYsOS4yNzMxMDMgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJlbGxpcHNlMTU2NzQiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2YzYjYyNjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC43O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIHRyYW5zZm9ybT0ic2NhbGUoLTEpIgogICAgICAgICAgIGQ9Ik0gLTQwLjEyNjQ4LDQ4LjE2MzU4NiBBIDM4LjMyOTY4OSwxMi4zMDU4NDcgMCAwIDEgLTc4LjQ1NjE2OSw2MC40Njk0MzMgMzguMzI5Njg5LDEyLjMwNTg0NyAwIDAgMSAtMTE2Ljc4NTg2LDQ4LjE2MzU4NiAzOC4zMjk2ODksMTIuMzA1ODQ3IDAgMCAxIC03OC40NTYxNjksMzUuODU3NzM4IDM4LjMyOTY4OSwxMi4zMDU4NDcgMCAwIDEgLTQwLjEyNjQ4LDQ4LjE2MzU4NiBaIiAvPgogICAgICAgIDxwYXRoCiAgICAgICAgICAgaWQ9ImVsbGlwc2UxNTY3MiIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZjNiNjI2O3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDowLjc7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgdHJhbnNmb3JtPSJzY2FsZSgtMSkiCiAgICAgICAgICAgZD0iTSAtMzQuOTE0NzUzLDU4LjE2MzU4NiBBIDQzLjU0MTQxNiwxMy45NzkwODYgMCAwIDEgLTc4LjQ1NjE2OSw3Mi4xNDI2NzIgNDMuNTQxNDE2LDEzLjk3OTA4NiAwIDAgMSAtMTIxLjk5NzU5LDU4LjE2MzU4NiA0My41NDE0MTYsMTMuOTc5MDg2IDAgMCAxIC03OC40NTYxNjksNDQuMTg0NSA0My41NDE0MTYsMTMuOTc5MDg2IDAgMCAxIC0zNC45MTQ3NTMsNTguMTYzNTg2IFoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0icmVjdDE1NjcwIgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNmM2I2MjY7ZmlsbC1vcGFjaXR5OjE7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjAuNjI1MDE4O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Im0gNDEuNTY4NTc0LC03MS43MDQ1MzEgaCA3My44NTU1MDYgYyAzLjY5ODc5LDAgNi42NzY1MSwyLjk3NzcyNyA2LjY3NjUxLDYuNjc2NTE5IHYgOS4xMTYwODIgYyAtMTAuMTY0MDQsMjEuMDE4ODc1IC04NC43OTIyMzksMTQuOTc1Nzk5IC04Ny4yMDg1MzQsMCB2IC05LjExNjA4MiBjIDAsLTMuNjk4NzkyIDIuOTc3NzI3LC02LjY3NjUxOSA2LjY3NjUxOCwtNi42NzY1MTkgeiIKICAgICAgICAgICBzb2RpcG9kaTpub2RldHlwZXM9InNzc2Njc3MiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0iZWxsaXBzZTE0ODIyIgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNmM2I2MjY7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjAuNztzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMSIKICAgICAgICAgICBkPSJNIDEyMS45OTc1OSwtNzQuMzcwNTE0IEEgNDMuNTQxNDE2LDEzLjk3OTA4NiAwIDAgMSA3OC40NTYxNjksLTYwLjM5MTQyOCA0My41NDE0MTYsMTMuOTc5MDg2IDAgMCAxIDM0LjkxNDc1MywtNzQuMzcwNTE0IDQzLjU0MTQxNiwxMy45NzkwODYgMCAwIDEgNzguNDU2MTY5LC04OC4zNDk2IDQzLjU0MTQxNiwxMy45NzkwODYgMCAwIDEgMTIxLjk5NzU5LC03NC4zNzA1MTQgWiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJlbGxpcHNlMTQ4MjAiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2YzYjYyNjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC43O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gMTE2Ljc4NTg2LC04NC4zNzA1MTQgQSAzOC4zMjk2ODksMTIuMzA1ODQ3IDAgMCAxIDc4LjQ1NjE2OSwtNzIuMDY0NjY3IDM4LjMyOTY4OSwxMi4zMDU4NDcgMCAwIDEgNDAuMTI2NDgsLTg0LjM3MDUxNCAzOC4zMjk2ODksMTIuMzA1ODQ3IDAgMCAxIDc4LjQ1NjE2OSwtOTYuNjc2MzYxIDM4LjMyOTY4OSwxMi4zMDU4NDcgMCAwIDEgMTE2Ljc4NTg2LC04NC4zNzA1MTQgWiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJwYXRoMTQ4MTgiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2YzYjYyNjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC43O3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Im0gMTA3LjMzOTYxLC05NC4zNzA1MTQgYSAyOC44ODM0MzYsOS4yNzMxMDI4IDAgMCAxIC0yOC44ODM0NDEsOS4yNzMxMDMgMjguODgzNDM2LDkuMjczMTAyOCAwIDAgMSAtMjguODgzNDM2LC05LjI3MzEwMyAyOC44ODM0MzYsOS4yNzMxMDI4IDAgMCAxIDI4Ljg4MzQzNiwtOS4yNzMxMDYgMjguODgzNDM2LDkuMjczMTAyOCAwIDAgMSAyOC44ODM0NDEsOS4yNzMxMDYgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJlbGxpcHNlMTQ4ODgiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2YzYjYyNjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC40ODk0MDc7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0ibSA5OC42NTAxMTQsLTEwMi4zNzA1MSBhIDIwLjE5Mzk0NSw2LjQ4MzMxODggMCAwIDEgLTIwLjE5Mzk0NSw2LjQ4MzMyMyAyMC4xOTM5NDUsNi40ODMzMTg4IDAgMCAxIC0yMC4xOTM5NDUsLTYuNDgzMzIzIDIwLjE5Mzk0NSw2LjQ4MzMxODggMCAwIDEgMjAuMTkzOTQ1LC02LjQ4MzMyIDIwLjE5Mzk0NSw2LjQ4MzMxODggMCAwIDEgMjAuMTkzOTQ1LDYuNDgzMzIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJlbGxpcHNlMTQ4OTAiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2YzYjYyNjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC4yOTk4NTI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0ibSA5MC44Mjg2OTgsLTEwOC4zNzA1MSBhIDEyLjM3MjUyOSwzLjk3MjIzMjggMCAwIDEgLTEyLjM3MjUyOSwzLjk3MjI0IDEyLjM3MjUyOSwzLjk3MjIzMjggMCAwIDEgLTEyLjM3MjUyOSwtMy45NzIyNCAxMi4zNzI1MjksMy45NzIyMzI4IDAgMCAxIDEyLjM3MjUyOSwtMy45NzIyMyAxMi4zNzI1MjksMy45NzIyMzI4IDAgMCAxIDEyLjM3MjUyOSwzLjk3MjIzIHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0icGF0aDE1Njg3IgogICAgICAgICAgIHN0eWxlPSJzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC40OTQ3MDc7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0ibSA4OS4wNDg0ODMsLTUxLjI1ODI0NCBhIDEwLjExODkzMyw3Ljg3OTUxOSAwIDAgMSAtMTAuMTE4OTMzLDcuODc5NTE5IDEwLjExODkzMyw3Ljg3OTUxOSAwIDAgMSAtMTAuMTE4OTMzLC03Ljg3OTUxOSAxMC4xMTg5MzMsNy44Nzk1MTkgMCAwIDEgMTAuMTE4OTMzLC03Ljg3OTUxOSAxMC4xMTg5MzMsNy44Nzk1MTkgMCAwIDEgMTAuMTE4OTMzLDcuODc5NTE5IHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0icGF0aDIxNjgxIgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNlM2I5MDA7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjEuMDAwMTk7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgdHJhbnNmb3JtPSJtYXRyaXgoMC45OTk2MTU3MiwwLDAsMS4wMDAwMTE1LDUuMDczMTUyNiwzLjQ1NDU3MTMpIgogICAgICAgICAgIGQ9Ik0gNDMuOTQ4MjAxLDM4LjI1OTA3OSAyOS45NDI2MzMsNDYuMzQ1MTk4IDE1LjkzNzA2NCwzOC4yNTkwNzkgViAyMi4wODY4NDIgbCAxNC4wMDU1NjksLTguMDg2MTE5IDE0LjAwNTU2OCw4LjA4NjExOSB6IiAvPgogICAgICAgIDxwYXRoCiAgICAgICAgICAgaWQ9InVzZTI0MDg4IgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjE7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0ibSA2My41MDQ1NTMsMTY2Ljc1Nzk1IC0xNC4wMDAxODYsOC4wODYyMSAtMTQuMDAwMTg3LC04LjA4NjIxIHYgLTE2LjE3MjQyIGwgMTQuMDAwMTg3LC04LjA4NjIyIDE0LjAwMDE4Niw4LjA4NjIyIHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0idXNlMjQxMDAiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMSIKICAgICAgICAgICBkPSJtIDkyLjUwNDcyOCwxNjYuNzU3OTUgLTE0LjAwMDE4Niw4LjA4NjIxIC0xNC4wMDAxODcsLTguMDg2MjEgdiAtMTYuMTcyNDIgbCAxNC4wMDAxODcsLTguMDg2MjIgMTQuMDAwMTg2LDguMDg2MjIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA0MiIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gNDkuMDA0NDY1LDQxLjcxNDA5IDM1LjAwNDI3OSw0OS44MDAzMDIgMjEuMDA0MDkyLDQxLjcxNDA5IFYgMjUuNTQxNjY3IGwgMTQuMDAwMTg3LC04LjA4NjIxMiAxNC4wMDAxODYsOC4wODYyMTIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA0NCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gMzQuNTA0Mzc4LDY2LjcyMjg2MiAyMC41MDQxOTIsNzQuODA5MDc0IDYuNTA0MDA1Myw2Ni43MjI4NjIgViA1MC41NTA0MzkgbCAxNC4wMDAxODY3LC04LjA4NjIxMiAxNC4wMDAxODYsOC4wODYyMTIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA1NCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZjYzAwO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gNzguMDA0NjQxLDQxLjcxNDA5IDY0LjAwNDQ1NSw0OS44MDAzMDIgNTAuMDA0MjY4LDQxLjcxNDA5IFYgMjUuNTQxNjY3IGwgMTQuMDAwMTg3LC04LjA4NjIxMiAxNC4wMDAxODYsOC4wODYyMTIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA1NiIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gNjMuNTA0NTUzLDY2LjcyMjg2MiA0OS41MDQzNjcsNzQuODA5MDc0IDM1LjUwNDE4LDY2LjcyMjg2MiBWIDUwLjU1MDQzOSBsIDE0LjAwMDE4NywtOC4wODYyMTIgMTQuMDAwMTg2LDguMDg2MjEyIHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0idXNlMjQwNTgiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMSIKICAgICAgICAgICBkPSJNIDQ5LjAwNDQ2NSw5MS43MzE2MzQgMzUuMDA0Mjc5LDk5LjgxNzg0NiAyMS4wMDQwOTIsOTEuNzMxNjM0IFYgNzUuNTU5MjExIGwgMTQuMDAwMTg3LC04LjA4NjIxMiAxNC4wMDAxODYsOC4wODYyMTIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA2MCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gMzQuNTA0Mzc4LDExNi43NDA0MSAyMC41MDQxOTIsMTI0LjgyNjYyIDYuNTA0MDA1MywxMTYuNzQwNDEgViAxMDAuNTY3OTggTCAyMC41MDQxOTIsOTIuNDgxNzcxIDM0LjUwNDM3OCwxMDAuNTY3OTggWiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA2NiIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gMTA3LjAwNDgyLDQxLjcxNDA5IDkzLjAwNDYzLDQ5LjgwMDMwMiA3OS4wMDQ0NDMsNDEuNzE0MDkgViAyNS41NDE2NjcgbCAxNC4wMDAxODcsLTguMDg2MjEyIDE0LjAwMDE5LDguMDg2MjEyIHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0idXNlMjQwNjgiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2ZmY2MwMDtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMSIKICAgICAgICAgICBkPSJNIDkyLjUwNDcyOCw2Ni43MjI4NjIgNzguNTA0NTQyLDc0LjgwOTA3NCA2NC41MDQzNTUsNjYuNzIyODYyIFYgNTAuNTUwNDM5IGwgMTQuMDAwMTg3LC04LjA4NjIxMiAxNC4wMDAxODYsOC4wODYyMTIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA3MCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZjYzAwO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gNzguMDA0NjQxLDkxLjczMTYzNCA2NC4wMDQ0NTUsOTkuODE3ODQ2IDUwLjAwNDI2OCw5MS43MzE2MzQgViA3NS41NTkyMTEgbCAxNC4wMDAxODcsLTguMDg2MjEyIDE0LjAwMDE4Niw4LjA4NjIxMiB6IiAvPgogICAgICAgIDxwYXRoCiAgICAgICAgICAgaWQ9InVzZTI0MDcyIgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNjODM3Mzc7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjE7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0ibSA2My41MDQ1NTMsMTE2Ljc0MDQxIC0xNC4wMDAxODYsOC4wODYyMSAtMTQuMDAwMTg3LC04LjA4NjIxIHYgLTE2LjE3MjQzIGwgMTQuMDAwMTg3LC04LjA4NjIwOSAxNC4wMDAxODYsOC4wODYyMDkgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA3NCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Im0gNDkuMDA0NDY1LDE0MS43NDkxOCAtMTQuMDAwMTg2LDguMDg2MjEgLTE0LjAwMDE4NywtOC4wODYyMSB2IC0xNi4xNzI0MiBsIDE0LjAwMDE4NywtOC4wODYyMiAxNC4wMDAxODYsOC4wODYyMiB6IiAvPgogICAgICAgIDxwYXRoCiAgICAgICAgICAgaWQ9InVzZTI0MDc4IgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNjODM3Mzc7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjE7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0iTSAxMzYuMDA0OTksNDEuNzE0MDkgMTIyLjAwNDgsNDkuODAwMzAyIDEwOC4wMDQ2Miw0MS43MTQwOSBWIDI1LjU0MTY2NyBsIDE0LjAwMDE4LC04LjA4NjIxMiAxNC4wMDAxOSw4LjA4NjIxMiB6IiAvPgogICAgICAgIDxwYXRoCiAgICAgICAgICAgaWQ9InVzZTI0MDgwIgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjE7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0iTSAxMjEuNTA0OSw2Ni43MjI4NjIgMTA3LjUwNDcyLDc0LjgwOTA3NCA5My41MDQ1Myw2Ni43MjI4NjIgViA1MC41NTA0MzkgbCAxNC4wMDAxOSwtOC4wODYyMTIgMTQuMDAwMTgsOC4wODYyMTIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA4MiIKICAgICAgICAgICBzdHlsZT0iZmlsbDojYzgzNzM3O3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gMTA3LjAwNDgyLDkxLjczMTYzNCA5My4wMDQ2Myw5OS44MTc4NDYgNzkuMDA0NDQzLDkxLjczMTYzNCBWIDc1LjU1OTIxMSBsIDE0LjAwMDE4NywtOC4wODYyMTIgMTQuMDAwMTksOC4wODYyMTIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA4NCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Im0gOTIuNTA0NzI4LDExNi43NDA0MSAtMTQuMDAwMTg2LDguMDg2MjEgLTE0LjAwMDE4NywtOC4wODYyMSB2IC0xNi4xNzI0MyBsIDE0LjAwMDE4NywtOC4wODYyMDkgMTQuMDAwMTg2LDguMDg2MjA5IHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0idXNlMjQwODYiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2ZmY2MwMDtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMSIKICAgICAgICAgICBkPSJtIDc4LjAwNDY0MSwxNDEuNzQ5MTggLTE0LjAwMDE4Niw4LjA4NjIxIC0xNC4wMDAxODcsLTguMDg2MjEgdiAtMTYuMTcyNDIgbCAxNC4wMDAxODcsLTguMDg2MjIgMTQuMDAwMTg2LDguMDg2MjIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA5MiIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZjYzAwO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Ik0gMTUwLjUwNTA3LDY2LjcyMjg2MiAxMzYuNTA0ODksNzQuODA5MDc0IDEyMi41MDQ3LDY2LjcyMjg2MiBWIDUwLjU1MDQzOSBsIDE0LjAwMDE5LC04LjA4NjIxMiAxNC4wMDAxOCw4LjA4NjIxMiB6IiAvPgogICAgICAgIDxwYXRoCiAgICAgICAgICAgaWQ9InVzZTI0MDk0IgogICAgICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjE7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEuNDE0MjEiCiAgICAgICAgICAgZD0iTSAxMzYuMDA0OTksOTEuNzMxNjM0IDEyMi4wMDQ4LDk5LjgxNzg0NiAxMDguMDA0NjIsOTEuNzMxNjM0IFYgNzUuNTU5MjExIGwgMTQuMDAwMTgsLTguMDg2MjEyIDE0LjAwMDE5LDguMDg2MjEyIHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0idXNlMjQwOTYiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2ZmY2MwMDtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMSIKICAgICAgICAgICBkPSJtIDEyMS41MDQ5LDExNi43NDA0MSAtMTQuMDAwMTgsOC4wODYyMSAtMTQuMDAwMTksLTguMDg2MjEgdiAtMTYuMTcyNDMgbCAxNC4wMDAxOSwtOC4wODYyMDkgMTQuMDAwMTgsOC4wODYyMDkgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDA5OCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojYzgzNzM3O3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Im0gMTA3LjAwNDgyLDE0MS43NDkxOCAtMTQuMDAwMTksOC4wODYyMSAtMTQuMDAwMTg3LC04LjA4NjIxIHYgLTE2LjE3MjQyIGwgMTQuMDAwMTg3LC04LjA4NjIyIDE0LjAwMDE5LDguMDg2MjIgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDEwOCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Im0gMTUwLjUwNTA3LDExNi43NDA0MSAtMTQuMDAwMTgsOC4wODYyMSAtMTQuMDAwMTksLTguMDg2MjEgdiAtMTYuMTcyNDMgbCAxNC4wMDAxOSwtOC4wODYyMDkgMTQuMDAwMTgsOC4wODYyMDkgeiIgLz4KICAgICAgICA8cGF0aAogICAgICAgICAgIGlkPSJ1c2UyNDExMCIKICAgICAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxLjQxNDIxIgogICAgICAgICAgIGQ9Im0gMTM2LjAwNDk5LDE0MS43NDkxOCAtMTQuMDAwMTksOC4wODYyMSAtMTQuMDAwMTgsLTguMDg2MjEgdiAtMTYuMTcyNDIgbCAxNC4wMDAxOCwtOC4wODYyMiAxNC4wMDAxOSw4LjA4NjIyIHoiIC8+CiAgICAgICAgPHBhdGgKICAgICAgICAgICBpZD0idXNlMjQxMTIiCiAgICAgICAgICAgc3R5bGU9ImZpbGw6I2ZmZmZmZjtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMSIKICAgICAgICAgICBkPSJtIDEyMS41MDQ5LDE2Ni43NTc5NSAtMTQuMDAwMTgsOC4wODYyMSAtMTQuMDAwMTksLTguMDg2MjEgdiAtMTYuMTcyNDIgbCAxNC4wMDAxOSwtOC4wODYyMiAxNC4wMDAxOCw4LjA4NjIyIHoiIC8+CiAgICAgIDwvZz4KICAgICAgPHJlY3QKICAgICAgICAgc3R5bGU9ImZpbGw6bm9uZTtmaWxsLW9wYWNpdHk6MTtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6NC4zNjI4MTtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS40MTQyMTtzdHJva2UtZGFzaGFycmF5Om5vbmU7c3Ryb2tlLW9wYWNpdHk6MSIKICAgICAgICAgaWQ9InJlY3QyNDU4MiIKICAgICAgICAgd2lkdGg9IjEwNy4xNTE4NCIKICAgICAgICAgaGVpZ2h0PSIxMDcuMTUxODQiCiAgICAgICAgIHg9IjE2LjIxOTkxIgogICAgICAgICB5PSIxMy4zNjI4ODMiCiAgICAgICAgIHJ5PSIyMC4xNzk3OSIgLz4KICAgIDwvZz4KICAgIDx0ZXh0CiAgICAgICB4bWw6c3BhY2U9InByZXNlcnZlIgogICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6bm9ybWFsO2ZvbnQtd2VpZ2h0Om5vcm1hbDtmb250LXNpemU6MTEzLjM4M3B4O2xpbmUtaGVpZ2h0OjEuMjU7Zm9udC1mYW1pbHk6c2Fucy1zZXJpZjtmaWxsOiMwMDAwMDA7ZmlsbC1vcGFjaXR5OjE7c3Ryb2tlOm5vbmU7c3Ryb2tlLXdpZHRoOjE7c3Ryb2tlLWRhc2hhcnJheTpub25lIgogICAgICAgeD0iMTc3LjcxMDM5IgogICAgICAgeT0iOTUuODk5MTc4IgogICAgICAgaWQ9InRleHQ2MyI+PHRzcGFuCiAgICAgICAgIHNvZGlwb2RpOnJvbGU9ImxpbmUiCiAgICAgICAgIGlkPSJ0c3BhbjYxIgogICAgICAgICB4PSIxNzcuNzEwMzkiCiAgICAgICAgIHk9Ijk1Ljg5OTE3OCIKICAgICAgICAgc3R5bGU9ImZvbnQtc3R5bGU6bm9ybWFsO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6bm9ybWFsO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1zaXplOjExMy4zODNweDtmb250LWZhbWlseTonTm90byBTYW5zIE1vbm8nOy1pbmtzY2FwZS1mb250LXNwZWNpZmljYXRpb246J05vdG8gU2FucyBNb25vJztmaWxsOiMwMDAwMDA7c3Ryb2tlOiNmZmZmZmY7c3Ryb2tlLXdpZHRoOjE7c3Ryb2tlLWRhc2hhcnJheTpub25lIj5icGY8dHNwYW4KICAgc3R5bGU9ImZvbnQtc3R5bGU6bm9ybWFsO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6bm9ybWFsO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1mYW1pbHk6J05vdG8gU2FucyBNb25vJzstaW5rc2NhcGUtZm9udC1zcGVjaWZpY2F0aW9uOidOb3RvIFNhbnMgTW9ubyc7ZmlsbDojMDAwMDAwO3N0cm9rZTojZmZmZmZmO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1kYXNoYXJyYXk6bm9uZSIKICAgaWQ9InRzcGFuMTI5NzUiPmQ8dHNwYW4KICAgc3R5bGU9ImZvbnQtc3R5bGU6bm9ybWFsO2ZvbnQtdmFyaWFudDpub3JtYWw7Zm9udC13ZWlnaHQ6bm9ybWFsO2ZvbnQtc3RyZXRjaDpub3JtYWw7Zm9udC1mYW1pbHk6J05vdG8gU2FucyBNb25vJzstaW5rc2NhcGUtZm9udC1zcGVjaWZpY2F0aW9uOidOb3RvIFNhbnMgTW9ubyc7ZmlsbDojMDAwMDAwO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1kYXNoYXJyYXk6bm9uZSIKICAgaWQ9InRzcGFuMTMwMzEiIC8+PC90c3Bhbj48L3RzcGFuPjwvdGV4dD4KICA8L2c+Cjwvc3ZnPgo= mediatype: image/svg+xml @@ -81,13 +81,13 @@ spec: - ebpf - kubernetes links: - - name: bpfd website - url: https://bpfd.dev/ + - name: bpfman website + url: https://bpfman.io/ maintainers: - email: astoycos@redhat.com name: Andrew Stoycos maturity: alpha provider: - name: The bpfd Community - url: https://bpfd.dev/ + name: The bpfman Community + url: https://bpfman.io/ version: 0.0.0 diff --git a/bpfd-operator/config/manifests/kustomization.yaml b/bpfman-operator/config/manifests/kustomization.yaml similarity index 95% rename from bpfd-operator/config/manifests/kustomization.yaml rename to bpfman-operator/config/manifests/kustomization.yaml index 68b9bdf77..0d15302c6 100644 --- a/bpfd-operator/config/manifests/kustomization.yaml +++ b/bpfman-operator/config/manifests/kustomization.yaml @@ -1,7 +1,7 @@ # These resources constitute the fully configured set of manifests # used to generate the 'manifests/' directory in a bundle. resources: - - bases/bpfd-operator.clusterserviceversion.yaml + - bases/bpfman-operator.clusterserviceversion.yaml - ../openshift - ../samples - ../scorecard diff --git a/bpfd-operator/config/openshift/kustomization.yaml b/bpfman-operator/config/openshift/kustomization.yaml similarity index 91% rename from bpfd-operator/config/openshift/kustomization.yaml rename to bpfman-operator/config/openshift/kustomization.yaml index 0ee02e5f3..f19671590 100644 --- a/bpfd-operator/config/openshift/kustomization.yaml +++ b/bpfman-operator/config/openshift/kustomization.yaml @@ -1,12 +1,12 @@ # Adds namespace to all resources. -namespace: openshift-bpfd +namespace: openshift-bpfman # Value of this field is prepended to the # names of all resources, e.g. a deployment named # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: bpfd- +namePrefix: bpfman- # Protect the /metrics endpoint by putting it behind auth. # If you want your controller-manager to expose the /metrics @@ -30,6 +30,6 @@ kind: Kustomization resources: - ../crd - ../rbac - - ../bpfd-operator-deployment - - ../bpfd-deployment + - ../bpfman-operator-deployment + - ../bpfman-deployment - rbac.yaml diff --git a/bpfd-operator/config/openshift/manager_auth_proxy_patch.yaml b/bpfman-operator/config/openshift/manager_auth_proxy_patch.yaml similarity index 98% rename from bpfd-operator/config/openshift/manager_auth_proxy_patch.yaml rename to bpfman-operator/config/openshift/manager_auth_proxy_patch.yaml index 0b932de23..61acfd03f 100644 --- a/bpfd-operator/config/openshift/manager_auth_proxy_patch.yaml +++ b/bpfman-operator/config/openshift/manager_auth_proxy_patch.yaml @@ -48,7 +48,7 @@ spec: requests: cpu: 5m memory: 64Mi - - name: bpfd-operator + - name: bpfman-operator args: - "--health-probe-bind-address=:8081" - "--metrics-bind-address=127.0.0.1:8080" diff --git a/bpfd-operator/config/openshift/manager_config_patch.yaml b/bpfman-operator/config/openshift/manager_config_patch.yaml similarity index 80% rename from bpfd-operator/config/openshift/manager_config_patch.yaml rename to bpfman-operator/config/openshift/manager_config_patch.yaml index 12d12f087..7d4b43391 100644 --- a/bpfd-operator/config/openshift/manager_config_patch.yaml +++ b/bpfman-operator/config/openshift/manager_config_patch.yaml @@ -7,4 +7,4 @@ spec: template: spec: containers: - - name: bpfd-operator + - name: bpfman-operator diff --git a/bpfd-operator/config/openshift/patch.yaml b/bpfman-operator/config/openshift/patch.yaml similarity index 80% rename from bpfd-operator/config/openshift/patch.yaml rename to bpfman-operator/config/openshift/patch.yaml index 9b1c7c7e3..61b8be2ab 100644 --- a/bpfd-operator/config/openshift/patch.yaml +++ b/bpfman-operator/config/openshift/patch.yaml @@ -8,7 +8,7 @@ metadata: pod-security.kubernetes.io/warn: privileged annotations: openshift.io/node-selector: "" - openshift.io/description: "Openshift bpfd components" + openshift.io/description: "Openshift bpfman components" workload.openshift.io/allowed: "management" name: system --- @@ -19,5 +19,5 @@ metadata: namespace: kube-system data: ## Can be configured at runtime - bpfd.log.level: "info" - bpfd.agent.log.level: "info" + bpfman.log.level: "info" + bpfman.agent.log.level: "info" diff --git a/bpfd-operator/config/openshift/rbac.yaml b/bpfman-operator/config/openshift/rbac.yaml similarity index 81% rename from bpfd-operator/config/openshift/rbac.yaml rename to bpfman-operator/config/openshift/rbac.yaml index d41b21bc0..cbb231004 100644 --- a/bpfd-operator/config/openshift/rbac.yaml +++ b/bpfman-operator/config/openshift/rbac.yaml @@ -8,5 +8,5 @@ roleRef: name: system:openshift:scc:privileged subjects: - kind: ServiceAccount - name: bpfd-daemon - namespace: openshift-bpfd + name: bpfman-daemon + namespace: openshift-bpfman diff --git a/bpfd-operator/config/prometheus/kustomization.yaml b/bpfman-operator/config/prometheus/kustomization.yaml similarity index 100% rename from bpfd-operator/config/prometheus/kustomization.yaml rename to bpfman-operator/config/prometheus/kustomization.yaml diff --git a/bpfd-operator/config/prometheus/monitor.yaml b/bpfman-operator/config/prometheus/monitor.yaml similarity index 87% rename from bpfd-operator/config/prometheus/monitor.yaml rename to bpfman-operator/config/prometheus/monitor.yaml index b578cc34f..ec8e60022 100644 --- a/bpfd-operator/config/prometheus/monitor.yaml +++ b/bpfman-operator/config/prometheus/monitor.yaml @@ -7,8 +7,8 @@ metadata: app.kubernetes.io/name: servicemonitor app.kubernetes.io/instance: controller-manager-metrics-monitor app.kubernetes.io/component: metrics - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: controller-manager-metrics-monitor namespace: system diff --git a/bpfd-operator/config/rbac/auth_proxy_client_clusterrole.yaml b/bpfman-operator/config/rbac/auth_proxy_client_clusterrole.yaml similarity index 64% rename from bpfd-operator/config/rbac/auth_proxy_client_clusterrole.yaml rename to bpfman-operator/config/rbac/auth_proxy_client_clusterrole.yaml index 62c15727f..1e7d25d67 100644 --- a/bpfd-operator/config/rbac/auth_proxy_client_clusterrole.yaml +++ b/bpfman-operator/config/rbac/auth_proxy_client_clusterrole.yaml @@ -5,12 +5,12 @@ metadata: app.kubernetes.io/name: clusterrole app.kubernetes.io/instance: metrics-reader app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: metrics-reader rules: -- nonResourceURLs: - - "/metrics" - verbs: - - get + - nonResourceURLs: + - "/metrics" + verbs: + - get diff --git a/bpfman-operator/config/rbac/auth_proxy_role.yaml b/bpfman-operator/config/rbac/auth_proxy_role.yaml new file mode 100644 index 000000000..66d416f26 --- /dev/null +++ b/bpfman-operator/config/rbac/auth_proxy_role.yaml @@ -0,0 +1,24 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: proxy-role + app.kubernetes.io/component: kube-rbac-proxy + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator + app.kubernetes.io/managed-by: kustomize + name: proxy-role +rules: + - apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create + - apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create diff --git a/bpfd-operator/config/rbac/auth_proxy_role_binding.yaml b/bpfman-operator/config/rbac/auth_proxy_role_binding.yaml similarity index 70% rename from bpfd-operator/config/rbac/auth_proxy_role_binding.yaml rename to bpfman-operator/config/rbac/auth_proxy_role_binding.yaml index 90e092382..8b3bce3b2 100644 --- a/bpfd-operator/config/rbac/auth_proxy_role_binding.yaml +++ b/bpfman-operator/config/rbac/auth_proxy_role_binding.yaml @@ -5,8 +5,8 @@ metadata: app.kubernetes.io/name: clusterrolebinding app.kubernetes.io/instance: proxy-rolebinding app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: proxy-rolebinding roleRef: @@ -14,6 +14,6 @@ roleRef: kind: ClusterRole name: proxy-role subjects: -- kind: ServiceAccount - name: operator - namespace: system + - kind: ServiceAccount + name: operator + namespace: system diff --git a/bpfd-operator/config/rbac/auth_proxy_service.yaml b/bpfman-operator/config/rbac/auth_proxy_service.yaml similarity index 70% rename from bpfd-operator/config/rbac/auth_proxy_service.yaml rename to bpfman-operator/config/rbac/auth_proxy_service.yaml index d003e31bf..9cdd5dac1 100644 --- a/bpfd-operator/config/rbac/auth_proxy_service.yaml +++ b/bpfman-operator/config/rbac/auth_proxy_service.yaml @@ -6,16 +6,16 @@ metadata: app.kubernetes.io/name: service app.kubernetes.io/instance: controller-manager-metrics-service app.kubernetes.io/component: kube-rbac-proxy - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: controller-manager-metrics-service namespace: system spec: ports: - - name: https - port: 8443 - protocol: TCP - targetPort: https + - name: https + port: 8443 + protocol: TCP + targetPort: https selector: control-plane: controller-manager diff --git a/bpfd-operator/config/rbac/bpfd-agent/role.yaml b/bpfman-operator/config/rbac/bpfman-agent/role.yaml similarity index 87% rename from bpfd-operator/config/rbac/bpfd-agent/role.yaml rename to bpfman-operator/config/rbac/bpfman-agent/role.yaml index 05a290dcb..db7f89e55 100644 --- a/bpfd-operator/config/rbac/bpfd-agent/role.yaml +++ b/bpfman-operator/config/rbac/bpfman-agent/role.yaml @@ -6,7 +6,7 @@ metadata: name: agent-role rules: - apiGroups: - - bpfd.dev + - bpfman.io resources: - bpfprograms verbs: @@ -18,13 +18,13 @@ rules: - update - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - bpfprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - bpfprograms/status verbs: @@ -32,7 +32,7 @@ rules: - patch - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - kprobeprograms verbs: @@ -40,13 +40,13 @@ rules: - list - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - kprobeprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - tcprograms verbs: @@ -54,13 +54,13 @@ rules: - list - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - tcprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - tracepointprograms verbs: @@ -68,13 +68,13 @@ rules: - list - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - tracepointprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - uprobeprograms verbs: @@ -82,13 +82,13 @@ rules: - list - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - uprobeprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - xdpprograms verbs: @@ -96,7 +96,7 @@ rules: - list - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - xdpprograms/finalizers verbs: diff --git a/bpfd-operator/config/rbac/bpfd-operator/role.yaml b/bpfman-operator/config/rbac/bpfman-operator/role.yaml similarity index 89% rename from bpfd-operator/config/rbac/bpfd-operator/role.yaml rename to bpfman-operator/config/rbac/bpfman-operator/role.yaml index 461c13e20..270feceeb 100644 --- a/bpfd-operator/config/rbac/bpfd-operator/role.yaml +++ b/bpfman-operator/config/rbac/bpfman-operator/role.yaml @@ -18,7 +18,7 @@ rules: - update - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - bpfprograms verbs: @@ -26,13 +26,13 @@ rules: - list - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - configmaps/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - kprobeprograms verbs: @@ -44,13 +44,13 @@ rules: - update - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - kprobeprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - kprobeprograms/status verbs: @@ -58,7 +58,7 @@ rules: - patch - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - tcprograms verbs: @@ -70,13 +70,13 @@ rules: - update - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - tcprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - tcprograms/status verbs: @@ -84,7 +84,7 @@ rules: - patch - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - tracepointprograms verbs: @@ -96,13 +96,13 @@ rules: - update - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - tracepointprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - tracepointprograms/status verbs: @@ -110,7 +110,7 @@ rules: - patch - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - uprobeprograms verbs: @@ -122,13 +122,13 @@ rules: - update - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - uprobeprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - uprobeprograms/status verbs: @@ -136,7 +136,7 @@ rules: - patch - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - xdpprograms verbs: @@ -148,13 +148,13 @@ rules: - update - watch - apiGroups: - - bpfd.dev + - bpfman.io resources: - xdpprograms/finalizers verbs: - update - apiGroups: - - bpfd.dev + - bpfman.io resources: - xdpprograms/status verbs: diff --git a/bpfman-operator/config/rbac/bpfprogram_editor_role.yaml b/bpfman-operator/config/rbac/bpfprogram_editor_role.yaml new file mode 100644 index 000000000..787cb4e4d --- /dev/null +++ b/bpfman-operator/config/rbac/bpfprogram_editor_role.yaml @@ -0,0 +1,31 @@ +# permissions for end users to edit bpfprograms. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/name: clusterrole + app.kubernetes.io/instance: bpfprogram-editor-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator + app.kubernetes.io/managed-by: kustomize + name: bpfprogram-editor-role +rules: + - apiGroups: + - bpfman.io + resources: + - bpfprograms + verbs: + - create + - delete + - get + - list + - patch + - update + - watch + - apiGroups: + - bpfman.io + resources: + - bpfprograms/status + verbs: + - get diff --git a/bpfd-operator/config/rbac/bpfprogram_viewer_role.yaml b/bpfman-operator/config/rbac/bpfprogram_viewer_role.yaml similarity index 52% rename from bpfd-operator/config/rbac/bpfprogram_viewer_role.yaml rename to bpfman-operator/config/rbac/bpfprogram_viewer_role.yaml index 2f648a306..ceb2ef4d2 100644 --- a/bpfd-operator/config/rbac/bpfprogram_viewer_role.yaml +++ b/bpfman-operator/config/rbac/bpfprogram_viewer_role.yaml @@ -6,22 +6,22 @@ metadata: app.kubernetes.io/name: clusterrole app.kubernetes.io/instance: bpfprogram-viewer-role app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: bpfprogram-viewer-role rules: -- apiGroups: - - bpfd.dev - resources: - - bpfprograms - verbs: - - get - - list - - watch -- apiGroups: - - bpfd.dev - resources: - - bpfprograms/status - verbs: - - get + - apiGroups: + - bpfman.io + resources: + - bpfprograms + verbs: + - get + - list + - watch + - apiGroups: + - bpfman.io + resources: + - bpfprograms/status + verbs: + - get diff --git a/bpfman-operator/config/rbac/kustomization.yaml b/bpfman-operator/config/rbac/kustomization.yaml new file mode 100644 index 000000000..ad78ce73a --- /dev/null +++ b/bpfman-operator/config/rbac/kustomization.yaml @@ -0,0 +1,21 @@ +resources: + # All RBAC will be applied under this service account in + # the deployment namespace. You may comment out this resource + # if your manager will use a service account that exists at + # runtime. Be sure to update RoleBinding and ClusterRoleBinding + # subjects if changing service account names. + - service_account.yaml + - bpfman-agent/role.yaml + - bpfman-operator/role.yaml + - role_binding.yaml + - leader_election_role.yaml + - leader_election_role_binding.yaml + - bpfprogram_editor_role.yaml + - bpfprogram_viewer_role.yaml + # Comment the following 4 lines if you want to disable + # the auth proxy (https://github.com/brancz/kube-rbac-proxy) + # which protects your /metrics endpoint. + - auth_proxy_service.yaml + - auth_proxy_role.yaml + - auth_proxy_role_binding.yaml + - auth_proxy_client_clusterrole.yaml diff --git a/bpfman-operator/config/rbac/leader_election_role.yaml b/bpfman-operator/config/rbac/leader_election_role.yaml new file mode 100644 index 000000000..84ae6cf75 --- /dev/null +++ b/bpfman-operator/config/rbac/leader_election_role.yaml @@ -0,0 +1,44 @@ +# permissions to do leader election. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/name: role + app.kubernetes.io/instance: leader-election-role + app.kubernetes.io/component: rbac + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator + app.kubernetes.io/managed-by: kustomize + name: leader-election-role +rules: + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - "" + resources: + - events + verbs: + - create + - patch diff --git a/bpfd-operator/config/rbac/leader_election_role_binding.yaml b/bpfman-operator/config/rbac/leader_election_role_binding.yaml similarity index 70% rename from bpfd-operator/config/rbac/leader_election_role_binding.yaml rename to bpfman-operator/config/rbac/leader_election_role_binding.yaml index ac886769b..5104530d6 100644 --- a/bpfd-operator/config/rbac/leader_election_role_binding.yaml +++ b/bpfman-operator/config/rbac/leader_election_role_binding.yaml @@ -5,8 +5,8 @@ metadata: app.kubernetes.io/name: rolebinding app.kubernetes.io/instance: leader-election-rolebinding app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: leader-election-rolebinding roleRef: @@ -14,6 +14,6 @@ roleRef: kind: Role name: leader-election-role subjects: -- kind: ServiceAccount - name: operator - namespace: system + - kind: ServiceAccount + name: operator + namespace: system diff --git a/bpfd-operator/config/rbac/role_binding.yaml b/bpfman-operator/config/rbac/role_binding.yaml similarity index 60% rename from bpfd-operator/config/rbac/role_binding.yaml rename to bpfman-operator/config/rbac/role_binding.yaml index e29f6844f..a1791f6f9 100644 --- a/bpfd-operator/config/rbac/role_binding.yaml +++ b/bpfman-operator/config/rbac/role_binding.yaml @@ -4,18 +4,18 @@ metadata: labels: app.kubernetes.io/name: clusterrolebinding app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize - name: bpfd-operator-rolebinding + name: bpfman-operator-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: operator-role subjects: -- kind: ServiceAccount - name: operator - namespace: system + - kind: ServiceAccount + name: operator + namespace: system --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -23,35 +23,35 @@ metadata: labels: app.kubernetes.io/name: clusterrolebinding app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: agent-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: bpfd-agent-role + name: bpfman-agent-role subjects: -- kind: ServiceAccount - name: daemon - namespace: system ---- + - kind: ServiceAccount + name: daemon + namespace: system +--- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: app.kubernetes.io/name: rolebinding app.kubernetes.io/component: rbac - app.kubernetes.io/created-by: bpfd-operator - app.kubernetes.io/part-of: bpfd-operator + app.kubernetes.io/created-by: bpfman-operator + app.kubernetes.io/part-of: bpfman-operator app.kubernetes.io/managed-by: kustomize name: agent-rolebinding - namespace: bpfd + namespace: bpfman roleRef: apiGroup: rbac.authorization.k8s.io kind: Role - name: bpfd-agent-role + name: bpfman-agent-role subjects: -- kind: ServiceAccount - name: daemon - namespace: system \ No newline at end of file + - kind: ServiceAccount + name: daemon + namespace: system diff --git a/bpfd-operator/config/rbac/service_account.yaml b/bpfman-operator/config/rbac/service_account.yaml similarity index 100% rename from bpfd-operator/config/rbac/service_account.yaml rename to bpfman-operator/config/rbac/service_account.yaml diff --git a/bpfd-operator/config/samples/bpfd.io_v1alpha1_go_counter_xdpprogram.yaml b/bpfman-operator/config/samples/bpfman.io_v1alpha1_go_counter_xdpprogram.yaml similarity index 74% rename from bpfd-operator/config/samples/bpfd.io_v1alpha1_go_counter_xdpprogram.yaml rename to bpfman-operator/config/samples/bpfman.io_v1alpha1_go_counter_xdpprogram.yaml index 87b8e7c84..e6e756d4c 100644 --- a/bpfd-operator/config/samples/bpfd.io_v1alpha1_go_counter_xdpprogram.yaml +++ b/bpfman-operator/config/samples/bpfman.io_v1alpha1_go_counter_xdpprogram.yaml @@ -1,4 +1,4 @@ -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -13,4 +13,4 @@ spec: priority: 5 bytecode: image: - url: quay.io/bpfd-bytecode/go-xdp-counter:latest + url: quay.io/bpfman-bytecode/go-xdp-counter:latest diff --git a/bpfd-operator/config/samples/bpfd.io_v1alpha1_kprobe_kprobeprogram.yaml b/bpfman-operator/config/samples/bpfman.io_v1alpha1_kprobe_kprobeprogram.yaml similarity index 82% rename from bpfd-operator/config/samples/bpfd.io_v1alpha1_kprobe_kprobeprogram.yaml rename to bpfman-operator/config/samples/bpfman.io_v1alpha1_kprobe_kprobeprogram.yaml index bc593094d..3c605b8b4 100644 --- a/bpfd-operator/config/samples/bpfd.io_v1alpha1_kprobe_kprobeprogram.yaml +++ b/bpfman-operator/config/samples/bpfman.io_v1alpha1_kprobe_kprobeprogram.yaml @@ -1,4 +1,4 @@ -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: KprobeProgram metadata: labels: @@ -14,7 +14,7 @@ spec: retprobe: false bytecode: image: - url: quay.io/bpfd-bytecode/kprobe:latest + url: quay.io/bpfman-bytecode/kprobe:latest globaldata: GLOBAL_u8: - 0x01 diff --git a/bpfd-operator/config/samples/bpfd.io_v1alpha1_tc_pass_tcprogram.yaml b/bpfman-operator/config/samples/bpfman.io_v1alpha1_tc_pass_tcprogram.yaml similarity index 82% rename from bpfd-operator/config/samples/bpfd.io_v1alpha1_tc_pass_tcprogram.yaml rename to bpfman-operator/config/samples/bpfman.io_v1alpha1_tc_pass_tcprogram.yaml index 72a68e471..35476e5e9 100644 --- a/bpfd-operator/config/samples/bpfd.io_v1alpha1_tc_pass_tcprogram.yaml +++ b/bpfman-operator/config/samples/bpfman.io_v1alpha1_tc_pass_tcprogram.yaml @@ -1,4 +1,4 @@ -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: TcProgram metadata: labels: @@ -14,7 +14,7 @@ spec: direction: ingress bytecode: image: - url: quay.io/bpfd-bytecode/tc_pass:latest + url: quay.io/bpfman-bytecode/tc_pass:latest globaldata: GLOBAL_u8: - 0x01 diff --git a/bpfd-operator/config/samples/bpfd.io_v1alpha1_tracepoint_tracepointprogram.yaml b/bpfman-operator/config/samples/bpfman.io_v1alpha1_tracepoint_tracepointprogram.yaml similarity index 81% rename from bpfd-operator/config/samples/bpfd.io_v1alpha1_tracepoint_tracepointprogram.yaml rename to bpfman-operator/config/samples/bpfman.io_v1alpha1_tracepoint_tracepointprogram.yaml index 707d69286..899bcfb85 100644 --- a/bpfd-operator/config/samples/bpfd.io_v1alpha1_tracepoint_tracepointprogram.yaml +++ b/bpfman-operator/config/samples/bpfman.io_v1alpha1_tracepoint_tracepointprogram.yaml @@ -1,4 +1,4 @@ -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: TracepointProgram metadata: labels: @@ -12,7 +12,7 @@ spec: - syscalls/sys_enter_openat bytecode: image: - url: quay.io/bpfd-bytecode/tracepoint:latest + url: quay.io/bpfman-bytecode/tracepoint:latest globaldata: GLOBAL_u8: - 0x01 diff --git a/bpfd-operator/config/samples/bpfd.io_v1alpha1_uprobe_uprobeprogram.yaml b/bpfman-operator/config/samples/bpfman.io_v1alpha1_uprobe_uprobeprogram.yaml similarity index 82% rename from bpfd-operator/config/samples/bpfd.io_v1alpha1_uprobe_uprobeprogram.yaml rename to bpfman-operator/config/samples/bpfman.io_v1alpha1_uprobe_uprobeprogram.yaml index 6e87fc86b..7e1ad1b43 100644 --- a/bpfd-operator/config/samples/bpfd.io_v1alpha1_uprobe_uprobeprogram.yaml +++ b/bpfman-operator/config/samples/bpfman.io_v1alpha1_uprobe_uprobeprogram.yaml @@ -1,4 +1,4 @@ -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: UprobeProgram metadata: labels: @@ -11,12 +11,12 @@ spec: func_name: syscall # offset: 0 # optional offset w/in function target: - - /bpfd + - /bpfman retprobe: false # pid: 0 # optional pid to execute uprobe for bytecode: image: - url: quay.io/bpfd-bytecode/uprobe:latest + url: quay.io/bpfman-bytecode/uprobe:latest globaldata: GLOBAL_u8: - 0x01 diff --git a/bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_private_xdpprogram.yaml b/bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_private_xdpprogram.yaml similarity index 52% rename from bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_private_xdpprogram.yaml rename to bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_private_xdpprogram.yaml index 669d8cde2..8e15f940a 100644 --- a/bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_private_xdpprogram.yaml +++ b/bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_private_xdpprogram.yaml @@ -1,6 +1,6 @@ # Try this out by first creating the secret: -# kubectl create secret -n bpfd docker-registry regcred --docker-server=quay.io --docker-username=bpfd-bytecode+bpfdcreds --docker-password=JOGZ3FA6A9L2297JAT4FFN6CJU87LKTIY6X1ZGKWJ0W0XLKY0KPT5YKTBBEAGSF5 -apiVersion: bpfd.dev/v1alpha1 +# kubectl create secret -n bpfman docker-registry regcred --docker-server=quay.io --docker-username=bpfman-bytecode+bpfmancreds --docker-password=JOGZ3FA6A9L2297JAT4FFN6CJU87LKTIY6X1ZGKWJ0W0XLKY0KPT5YKTBBEAGSF5 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -17,5 +17,5 @@ spec: image: imagepullsecret: name: regcred - namespace: bpfd - url: quay.io/bpfd-bytecode/xdp_pass_private:latest + namespace: bpfman + url: quay.io/bpfman-bytecode/xdp_pass_private:latest diff --git a/bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_xdpprogram.yaml b/bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_xdpprogram.yaml similarity index 81% rename from bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_xdpprogram.yaml rename to bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_xdpprogram.yaml index 132adc67a..b81ad54bc 100644 --- a/bpfd-operator/config/samples/bpfd.io_v1alpha1_xdp_pass_xdpprogram.yaml +++ b/bpfman-operator/config/samples/bpfman.io_v1alpha1_xdp_pass_xdpprogram.yaml @@ -1,4 +1,4 @@ -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -13,7 +13,7 @@ spec: priority: 0 bytecode: image: - url: quay.io/bpfd-bytecode/xdp_pass:latest + url: quay.io/bpfman-bytecode/xdp_pass:latest globaldata: GLOBAL_u8: - 0x01 diff --git a/bpfman-operator/config/samples/kustomization.yaml b/bpfman-operator/config/samples/kustomization.yaml new file mode 100644 index 000000000..9748e1a05 --- /dev/null +++ b/bpfman-operator/config/samples/kustomization.yaml @@ -0,0 +1,8 @@ +## Append samples you want in your CSV to this file as resources ## +resources: + - bpfman.io_v1alpha1_xdp_pass_xdpprogram.yaml + - bpfman.io_v1alpha1_tracepoint_tracepointprogram.yaml + - bpfman.io_v1alpha1_tc_pass_tcprogram.yaml + - bpfman.io_v1alpha1_kprobe_kprobeprogram.yaml + - bpfman.io_v1alpha1_uprobe_uprobeprogram.yaml +# +kubebuilder:scaffold:manifestskustomizesamples diff --git a/bpfd-operator/config/scorecard/bases/config.yaml b/bpfman-operator/config/scorecard/bases/config.yaml similarity index 100% rename from bpfd-operator/config/scorecard/bases/config.yaml rename to bpfman-operator/config/scorecard/bases/config.yaml diff --git a/bpfd-operator/config/scorecard/kustomization.yaml b/bpfman-operator/config/scorecard/kustomization.yaml similarity index 100% rename from bpfd-operator/config/scorecard/kustomization.yaml rename to bpfman-operator/config/scorecard/kustomization.yaml diff --git a/bpfd-operator/config/scorecard/patches/basic.config.yaml b/bpfman-operator/config/scorecard/patches/basic.config.yaml similarity index 100% rename from bpfd-operator/config/scorecard/patches/basic.config.yaml rename to bpfman-operator/config/scorecard/patches/basic.config.yaml diff --git a/bpfd-operator/config/scorecard/patches/olm.config.yaml b/bpfman-operator/config/scorecard/patches/olm.config.yaml similarity index 100% rename from bpfd-operator/config/scorecard/patches/olm.config.yaml rename to bpfman-operator/config/scorecard/patches/olm.config.yaml diff --git a/bpfd-operator/config/test/kustomization.yaml b/bpfman-operator/config/test/kustomization.yaml similarity index 89% rename from bpfd-operator/config/test/kustomization.yaml rename to bpfman-operator/config/test/kustomization.yaml index 1474b9b40..5f52dab86 100644 --- a/bpfd-operator/config/test/kustomization.yaml +++ b/bpfman-operator/config/test/kustomization.yaml @@ -1,12 +1,12 @@ # Adds namespace to all resources. -namespace: bpfd +namespace: bpfman # Value of this field is prepended to the # names of all resources, e.g. a deployment named # "wordpress" becomes "alices-wordpress". # Note that it should also match with the prefix (text before '-') of the namespace # field above. -namePrefix: bpfd- +namePrefix: bpfman- # Labels to add to all resources and selectors. # commonLabels: @@ -41,9 +41,9 @@ kind: Kustomization resources: - ../crd - ../rbac - - ../bpfd-deployment - - ../bpfd-operator-deployment + - ../bpfman-deployment + - ../bpfman-operator-deployment images: - - name: quay.io/bpfd/bpfd-operator - newName: quay.io/bpfd/bpfd-operator + - name: quay.io/bpfman/bpfman-operator + newName: quay.io/bpfman/bpfman-operator newTag: int-test diff --git a/bpfd-operator/config/test/manager_auth_proxy_patch.yaml b/bpfman-operator/config/test/manager_auth_proxy_patch.yaml similarity index 98% rename from bpfd-operator/config/test/manager_auth_proxy_patch.yaml rename to bpfman-operator/config/test/manager_auth_proxy_patch.yaml index 0b932de23..61acfd03f 100644 --- a/bpfd-operator/config/test/manager_auth_proxy_patch.yaml +++ b/bpfman-operator/config/test/manager_auth_proxy_patch.yaml @@ -48,7 +48,7 @@ spec: requests: cpu: 5m memory: 64Mi - - name: bpfd-operator + - name: bpfman-operator args: - "--health-probe-bind-address=:8081" - "--metrics-bind-address=127.0.0.1:8080" diff --git a/bpfd-operator/config/test/manager_config_patch.yaml b/bpfman-operator/config/test/manager_config_patch.yaml similarity index 80% rename from bpfd-operator/config/test/manager_config_patch.yaml rename to bpfman-operator/config/test/manager_config_patch.yaml index 12d12f087..7d4b43391 100644 --- a/bpfd-operator/config/test/manager_config_patch.yaml +++ b/bpfman-operator/config/test/manager_config_patch.yaml @@ -7,4 +7,4 @@ spec: template: spec: containers: - - name: bpfd-operator + - name: bpfman-operator diff --git a/bpfman-operator/config/test/patch.yaml b/bpfman-operator/config/test/patch.yaml new file mode 100644 index 000000000..a63067e24 --- /dev/null +++ b/bpfman-operator/config/test/patch.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: config + namespace: kube-system +data: + bpfman.agent.image: quay.io/bpfman/bpfman-agent:int-test + bpfman.image: quay.io/bpfman/bpfman:int-test + bpfman.log.level: debug diff --git a/bpfd-operator/controllers/bpfd-agent/common.go b/bpfman-operator/controllers/bpfman-agent/common.go similarity index 79% rename from bpfd-operator/controllers/bpfd-agent/common.go rename to bpfman-operator/controllers/bpfman-agent/common.go index ad4f01f72..14636e3e3 100644 --- a/bpfd-operator/controllers/bpfd-agent/common.go +++ b/bpfman-operator/controllers/bpfman-agent/common.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -34,22 +34,22 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + "github.com/bpfman/bpfman/bpfman-operator/internal" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/go-logr/logr" "google.golang.org/grpc" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=bpfprograms,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=bpfd.dev,resources=bpfprograms/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=bpfd.dev,resources=bpfprograms/finalizers,verbs=update -//+kubebuilder:rbac:groups=bpfd.dev,resources=tcprograms/finalizers,verbs=update -//+kubebuilder:rbac:groups=bpfd.dev,resources=xdpprograms/finalizers,verbs=update -//+kubebuilder:rbac:groups=bpfd.dev,resources=tracepointprograms/finalizers,verbs=update -//+kubebuilder:rbac:groups=bpfd.dev,resources=kprobeprograms/finalizers,verbs=update -//+kubebuilder:rbac:groups=bpfd.dev,resources=uprobeprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=bpfprograms,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=bpfman.io,resources=bpfprograms/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=bpfman.io,resources=bpfprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=tcprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=xdpprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=tracepointprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=kprobeprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=uprobeprograms/finalizers,verbs=update //+kubebuilder:rbac:groups=core,resources=nodes,verbs=get;list;watch //+kubebuilder:rbac:groups=core,resources=secrets,verbs=get @@ -60,28 +60,28 @@ const ( // ReconcilerCommon provides a skeleton for all *Program Reconcilers. type ReconcilerCommon struct { client.Client - Scheme *runtime.Scheme - GrpcConn *grpc.ClientConn - BpfdClient gobpfd.BpfdClient - Logger logr.Logger - NodeName string - progId *uint32 + Scheme *runtime.Scheme + GrpcConn *grpc.ClientConn + BpfmanClient gobpfman.BpfmanClient + Logger logr.Logger + NodeName string + progId *uint32 } -// bpfdReconciler defines a generic bpfProgram K8s object reconciler which can -// program bpfd from user intent in K8s CRDs. -type bpfdReconciler interface { +// bpfmanReconciler defines a generic bpfProgram K8s object reconciler which can +// program bpfman from user intent in K8s CRDs. +type bpfmanReconciler interface { getRecCommon() *ReconcilerCommon - reconcileBpfdProgram(context.Context, - map[string]*gobpfd.ListResponse_ListResult, - *bpfdiov1alpha1.BytecodeSelector, - *bpfdiov1alpha1.BpfProgram, + reconcileBpfmanProgram(context.Context, + map[string]*gobpfman.ListResponse_ListResult, + *bpfmaniov1alpha1.BytecodeSelector, + *bpfmaniov1alpha1.BpfProgram, bool, bool, - *MapOwnerParamStatus) (bpfdiov1alpha1.BpfProgramConditionType, error) + *MapOwnerParamStatus) (bpfmaniov1alpha1.BpfProgramConditionType, error) getFinalizer() string getRecType() string - expectedBpfPrograms(ctx context.Context) (*bpfdiov1alpha1.BpfProgramList, error) + expectedBpfPrograms(ctx context.Context) (*bpfmaniov1alpha1.BpfProgramList, error) } // Only return node updates for our node (all events) @@ -119,7 +119,7 @@ func isNodeSelected(selector *metav1.LabelSelector, nodeLabels map[string]string return selectorTool.Matches(nodeLabelSet), nil } -func getInterfaces(interfaceSelector *bpfdiov1alpha1.InterfaceSelector, ourNode *v1.Node) ([]string, error) { +func getInterfaces(interfaceSelector *bpfmaniov1alpha1.InterfaceSelector, ourNode *v1.Node) ([]string, error) { var interfaces []string if interfaceSelector.Interfaces != nil { @@ -127,7 +127,7 @@ func getInterfaces(interfaceSelector *bpfdiov1alpha1.InterfaceSelector, ourNode } if interfaceSelector.PrimaryNodeInterface != nil { - nodeIface, err := bpfdagentinternal.GetPrimaryNodeInterface(ourNode) + nodeIface, err := bpfmanagentinternal.GetPrimaryNodeInterface(ourNode) if err != nil { return nil, err } @@ -160,7 +160,7 @@ func (r *ReconcilerCommon) removeFinalizer(ctx context.Context, o client.Object, // updateStatus updates the status of a BpfProgram object if needed, returning // false if the status was already set for the given bpfProgram, meaning reconciliation // may continue. -func (r *ReconcilerCommon) updateStatus(ctx context.Context, prog *bpfdiov1alpha1.BpfProgram, cond bpfdiov1alpha1.BpfProgramConditionType) bool { +func (r *ReconcilerCommon) updateStatus(ctx context.Context, prog *bpfmaniov1alpha1.BpfProgram, cond bpfmaniov1alpha1.BpfProgramConditionType) bool { r.Logger.V(1).Info("updateStatus()", "existing conds", prog.Status.Conditions, "new cond", cond) @@ -197,8 +197,8 @@ func (r *ReconcilerCommon) updateStatus(ctx context.Context, prog *bpfdiov1alpha return true } -func (r *ReconcilerCommon) getExistingBpfProgs(ctx context.Context, owner metav1.Object) (map[string]bpfdiov1alpha1.BpfProgram, error) { - bpfProgramList := &bpfdiov1alpha1.BpfProgramList{} +func (r *ReconcilerCommon) getExistingBpfProgs(ctx context.Context, owner metav1.Object) (map[string]bpfmaniov1alpha1.BpfProgram, error) { + bpfProgramList := &bpfmaniov1alpha1.BpfProgramList{} // Only list bpfPrograms for this *Program and the controller's node opts := []client.ListOption{ @@ -210,7 +210,7 @@ func (r *ReconcilerCommon) getExistingBpfProgs(ctx context.Context, owner metav1 return nil, err } - existingProgs := map[string]bpfdiov1alpha1.BpfProgram{} + existingProgs := map[string]bpfmaniov1alpha1.BpfProgram{} for _, bpfProg := range bpfProgramList.Items { existingProgs[bpfProg.GetName()] = bpfProg } @@ -225,8 +225,8 @@ func (r *ReconcilerCommon) createBpfProgram(ctx context.Context, finalizer string, owner metav1.Object, ownerType string, - annotations map[string]string) (*bpfdiov1alpha1.BpfProgram, error) { - bpfProg := &bpfdiov1alpha1.BpfProgram{ + annotations map[string]string) (*bpfmaniov1alpha1.BpfProgram, error) { + bpfProg := &bpfmaniov1alpha1.BpfProgram{ ObjectMeta: metav1.ObjectMeta{ Name: bpfProgramName, Finalizers: []string{finalizer}, @@ -234,10 +234,10 @@ func (r *ReconcilerCommon) createBpfProgram(ctx context.Context, internal.K8sHostLabel: r.NodeName}, Annotations: annotations, }, - Spec: bpfdiov1alpha1.BpfProgramSpec{ + Spec: bpfmaniov1alpha1.BpfProgramSpec{ Type: ownerType, }, - Status: bpfdiov1alpha1.BpfProgramStatus{Conditions: []metav1.Condition{}}, + Status: bpfmaniov1alpha1.BpfProgramStatus{Conditions: []metav1.Condition{}}, } // Make the corresponding BpfProgramConfig the owner @@ -251,17 +251,17 @@ func (r *ReconcilerCommon) createBpfProgram(ctx context.Context, // reconcileProgram is called by ALL *Program controllers, and contains much of // the core logic for taking *Program objects, turning them into bpfProgram // object(s), and ultimately telling the custom controller types to load real -// bpf programs on the node via bpfd. Additionally it acts as a central point for +// bpf programs on the node via bpfman. Additionally it acts as a central point for // interacting with the K8s API. This function will exit if any action is taken // against the K8s API. If the function returns a retry boolean and error, the // reconcile will be retried based on a default 5 second interval if the retry // boolean is set to `true`. func reconcileProgram(ctx context.Context, - rec bpfdReconciler, + rec bpfmanReconciler, program client.Object, - common *bpfdiov1alpha1.BpfProgramCommon, + common *bpfmaniov1alpha1.BpfProgramCommon, ourNode *v1.Node, - programMap map[string]*gobpfd.ListResponse_ListResult) (internal.ReconcileResult, error) { + programMap map[string]*gobpfman.ListResponse_ListResult) (internal.ReconcileResult, error) { // initialize reconciler state r := rec.getRecCommon() @@ -305,7 +305,7 @@ func reconcileProgram(ctx context.Context, // multiplex signals into kubernetes API actions switch isBeingDeleted { // Deletion of a *Program takes a few steps if there's existing bpfPrograms: - // 1. Reconcile the bpfProgram (take bpfd cleanup steps). + // 1. Reconcile the bpfProgram (take bpfman cleanup steps). // 2. Remove any finalizers from the bpfProgram Object. // 3. Update the condition on the bpfProgram to BpfProgCondUnloaded so the // operator knows it's safe to remove the parent Program Object, which @@ -314,7 +314,7 @@ func reconcileProgram(ctx context.Context, for _, prog := range existingPrograms { // Reconcile the bpfProgram if error write condition and exit with // retry. - cond, err := rec.reconcileBpfdProgram(ctx, + cond, err := rec.reconcileBpfmanProgram(ctx, programMap, &common.ByteCode, &prog, @@ -324,7 +324,7 @@ func reconcileProgram(ctx context.Context, ) if err != nil { r.updateStatus(ctx, &prog, cond) - return internal.Requeue, fmt.Errorf("failed to delete bpfd program: %v", err) + return internal.Requeue, fmt.Errorf("failed to delete bpfman program: %v", err) } if r.removeFinalizer(ctx, &prog, rec.getFinalizer()) { @@ -352,7 +352,7 @@ func reconcileProgram(ctx context.Context, // bpfProgram Object exists go ahead and reconcile it, if there is // an error write condition and exit with retry. - cond, err := rec.reconcileBpfdProgram(ctx, + cond, err := rec.reconcileBpfmanProgram(ctx, programMap, &common.ByteCode, &prog, @@ -363,21 +363,21 @@ func reconcileProgram(ctx context.Context, if err != nil { if r.updateStatus(ctx, &prog, cond) { // Return an error the first time. - return internal.Updated, fmt.Errorf("failed to reconcile bpfd program: %v", err) + return internal.Updated, fmt.Errorf("failed to reconcile bpfman program: %v", err) } } else { // Make sure if we're not selected exit and write correct condition - if cond == bpfdiov1alpha1.BpfProgCondNotSelected || - cond == bpfdiov1alpha1.BpfProgCondMapOwnerNotFound || - cond == bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded { + if cond == bpfmaniov1alpha1.BpfProgCondNotSelected || + cond == bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound || + cond == bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded { // Write NodeNodeSelected status if r.updateStatus(ctx, &prog, cond) { - r.Logger.V(1).Info("Update condition from bpfd reconcile", "condition", cond) + r.Logger.V(1).Info("Update condition from bpfman reconcile", "condition", cond) return internal.Updated, nil } } - existingId, err := bpfdagentinternal.GetID(&prog) + existingId, err := bpfmanagentinternal.GetID(&prog) if err != nil { return internal.Requeue, fmt.Errorf("failed to get kernel id from bpfProgram: %v", err) } @@ -445,7 +445,7 @@ func ProcessMapOwnerParam(ctx context.Context, labelMap[key] = value } opts := []client.ListOption{labelMap} - bpfProgramList := &bpfdiov1alpha1.BpfProgramList{} + bpfProgramList := &bpfmaniov1alpha1.BpfProgramList{} r.Logger.V(1).Info("MapOwner Labels:", "opts", opts) err := r.List(ctx, bpfProgramList, opts...) if err != nil { @@ -461,14 +461,14 @@ func ProcessMapOwnerParam(ctx context.Context, mapOwnerStatus.isFound = true // Get bpfProgram based on UID meta - prog, err := bpfdagentinternal.GetBpfdProgram(ctx, r.BpfdClient, bpfProgramList.Items[0].GetUID()) + prog, err := bpfmanagentinternal.GetBpfmanProgram(ctx, r.BpfmanClient, bpfProgramList.Items[0].GetUID()) if err != nil { - return nil, fmt.Errorf("failed to get bpfd program for BpfProgram with UID %s: %v", bpfProgramList.Items[0].GetUID(), err) + return nil, fmt.Errorf("failed to get bpfman program for BpfProgram with UID %s: %v", bpfProgramList.Items[0].GetUID(), err) } kernelInfo := prog.GetKernelInfo() if kernelInfo == nil { - return nil, fmt.Errorf("failed to process bpfd program for BpfProgram with UID %s: %v", bpfProgramList.Items[0].GetUID(), err) + return nil, fmt.Errorf("failed to process bpfman program for BpfProgram with UID %s: %v", bpfProgramList.Items[0].GetUID(), err) } mapOwnerStatus.mapOwnerId = &kernelInfo.Id @@ -477,7 +477,7 @@ func ProcessMapOwnerParam(ctx context.Context, conLen := len(bpfProgramList.Items[0].Status.Conditions) if conLen > 0 && bpfProgramList.Items[0].Status.Conditions[conLen-1].Type == - string(bpfdiov1alpha1.BpfProgCondLoaded) { + string(bpfmaniov1alpha1.BpfProgCondLoaded) { mapOwnerStatus.isLoaded = true } diff --git a/bpfd-operator/controllers/bpfd-agent/discovered_program.go b/bpfman-operator/controllers/bpfman-agent/discovered_program.go similarity index 86% rename from bpfd-operator/controllers/bpfd-agent/discovered_program.go rename to bpfman-operator/controllers/bpfman-agent/discovered_program.go index a909045e8..8f4383cb9 100644 --- a/bpfd-operator/controllers/bpfd-agent/discovered_program.go +++ b/bpfman-operator/controllers/bpfman-agent/discovered_program.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -29,9 +29,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + "github.com/bpfman/bpfman/bpfman-operator/internal" v1 "k8s.io/api/core/v1" ) @@ -56,7 +56,7 @@ func (r *DiscoveredProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { builder.WithPredicates(predicate.And(predicate.ResourceVersionChangedPredicate{}, nodePredicate(r.NodeName))), ). Watches( - &source.Kind{Type: &bpfdiov1alpha1.BpfProgram{}}, + &source.Kind{Type: &bpfmaniov1alpha1.BpfProgram{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(predicate.And( internal.BpfProgramNodePredicate(r.NodeName)), @@ -75,8 +75,8 @@ func (r *DiscoveredProgramReconciler) Reconcile(ctx context.Context, req ctrl.Re ctxLogger := log.FromContext(ctx) ctxLogger.V(2).Info("Reconcile DiscoveredProgs: Enter", "ReconcileKey", req) - // Get existing ebpf state from bpfd. - programs, err := bpfdagentinternal.ListAllPrograms(ctx, r.BpfdClient) + // Get existing ebpf state from bpfman. + programs, err := bpfmanagentinternal.ListAllPrograms(ctx, r.BpfmanClient) if err != nil { r.Logger.Error(err, "failed to list loaded bpf programs") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationAgent}, nil @@ -87,14 +87,14 @@ func (r *DiscoveredProgramReconciler) Reconcile(ctx context.Context, req ctrl.Re client.MatchingLabels{internal.DiscoveredLabel: "", internal.K8sHostLabel: r.NodeName}, } - existingPrograms := bpfdiov1alpha1.BpfProgramList{} + existingPrograms := bpfmaniov1alpha1.BpfProgramList{} err = r.Client.List(ctx, &existingPrograms, opts...) if err != nil { r.Logger.Error(err, "failed to list existing discovered bpfProgram objects") } // build an indexable map of existing programs based on bpfProgram name - existingProgramIndex := map[string]bpfdiov1alpha1.BpfProgram{} + existingProgramIndex := map[string]bpfmaniov1alpha1.BpfProgram{} for _, p := range existingPrograms.Items { existingProgramIndex[p.Name] = p } @@ -107,7 +107,7 @@ func (r *DiscoveredProgramReconciler) Reconcile(ctx context.Context, req ctrl.Re programInfo := p.GetInfo() if programInfo != nil { - // skip bpf programs loaded by bpfd, their corresponding bpfProgram object + // skip bpf programs loaded by bpfman, their corresponding bpfProgram object // will be managed by another controller. metadata := programInfo.GetMetadata() if _, ok := metadata[internal.UuidMetadataKey]; ok { @@ -126,17 +126,17 @@ func (r *DiscoveredProgramReconciler) Reconcile(ctx context.Context, req ctrl.Re bpfProgName = fmt.Sprintf("%s-%d-%s", strings.ReplaceAll(kernelInfo.Name, "_", "-"), kernelInfo.Id, r.NodeName) } - expectedBpfProg := &bpfdiov1alpha1.BpfProgram{ + expectedBpfProg := &bpfmaniov1alpha1.BpfProgram{ ObjectMeta: metav1.ObjectMeta{ Name: bpfProgName, Labels: map[string]string{internal.DiscoveredLabel: "", internal.K8sHostLabel: r.NodeName}, - Annotations: bpfdagentinternal.Build_kernel_info_annotations(p), + Annotations: bpfmanagentinternal.Build_kernel_info_annotations(p), }, - Spec: bpfdiov1alpha1.BpfProgramSpec{ + Spec: bpfmaniov1alpha1.BpfProgramSpec{ Type: internal.ProgramType(kernelInfo.ProgramType).String(), }, - Status: bpfdiov1alpha1.BpfProgramStatus{Conditions: []metav1.Condition{}}, + Status: bpfmaniov1alpha1.BpfProgramStatus{Conditions: []metav1.Condition{}}, } existingBpfProg, ok := existingProgramIndex[bpfProgName] diff --git a/bpfd-operator/controllers/bpfd-agent/discovered_program_test.go b/bpfman-operator/controllers/bpfman-agent/discovered_program_test.go similarity index 80% rename from bpfd-operator/controllers/bpfd-agent/discovered_program_test.go rename to bpfman-operator/controllers/bpfman-agent/discovered_program_test.go index c5c8d335b..a0624fca0 100644 --- a/bpfd-operator/controllers/bpfd-agent/discovered_program_test.go +++ b/bpfman-operator/controllers/bpfman-agent/discovered_program_test.go @@ -14,20 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" "fmt" "testing" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - agenttestutils "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal/test-utils" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + agenttestutils "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal/test-utils" + "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -42,17 +42,17 @@ import ( func TestDiscoveredProgramControllerCreate(t *testing.T) { var ( - namespace = "bpfd" + namespace = "bpfman" fakeNode = testutils.NewNode("fake-control-plane") ctx = context.TODO() bpfProgName0 = fmt.Sprintf("%s-%d-%s", "dump-bpf-map", 693, fakeNode.Name) bpfProgName1 = fmt.Sprintf("%s-%d-%s", "dump-bpf-prog", 694, fakeNode.Name) bpfProgName2 = fmt.Sprintf("%d-%s", 695, fakeNode.Name) - bpfProg = &bpfdiov1alpha1.BpfProgram{} + bpfProg = &bpfmaniov1alpha1.BpfProgram{} fakeUID = "ef71d42c-aa21-48e8-a697-82391d801a81" - programs = map[int]*gobpfd.ListResponse_ListResult{ + programs = map[int]*gobpfman.ListResponse_ListResult{ 693: { - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ Name: "dump_bpf_map", ProgramType: 26, Id: 693, @@ -69,7 +69,7 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { }, }, 694: { - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ Name: "dump_bpf_prog", ProgramType: 26, Id: 694, @@ -87,7 +87,7 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { }, // test program with no name 695: { - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ ProgramType: 8, Id: 695, LoadedAt: "2023-07-20T19:11:11+0000", @@ -100,12 +100,12 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { VerifiedInsns: 8, }, }, - // skip program loaded by bpfd + // skip program loaded by bpfman 696: { - Info: &gobpfd.ProgramInfo{ + Info: &gobpfman.ProgramInfo{ Metadata: map[string]string{internal.UuidMetadataKey: fakeUID}, }, - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ ProgramType: 8, Id: 696, LoadedAt: "2023-07-20T19:11:11+0000", @@ -126,19 +126,19 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFakeWithPrograms(programs) + cli := agenttestutils.NewBpfmanClientFakeWithPrograms(programs) rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -188,7 +188,7 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { // node Label was correctly set require.Equal(t, bpfProg.Labels[internal.K8sHostLabel], fakeNode.Name) // ensure annotations were correct - require.Equal(t, bpfProg.Annotations, bpfdagentinternal.Build_kernel_info_annotations(programs[693])) + require.Equal(t, bpfProg.Annotations, bpfmanagentinternal.Build_kernel_info_annotations(programs[693])) // Check the second discovered BpfProgram Object was created successfully err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName1, Namespace: metav1.NamespaceAll}, bpfProg) @@ -200,7 +200,7 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { // node Label was correctly set require.Equal(t, bpfProg.Labels[internal.K8sHostLabel], fakeNode.Name) // ensure annotations were correct - require.Equal(t, bpfProg.Annotations, bpfdagentinternal.Build_kernel_info_annotations(programs[694])) + require.Equal(t, bpfProg.Annotations, bpfmanagentinternal.Build_kernel_info_annotations(programs[694])) // Check the third discovered BpfProgram Object was created successfully err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName2, Namespace: metav1.NamespaceAll}, bpfProg) @@ -212,7 +212,7 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { // node Label was correctly set require.Equal(t, bpfProg.Labels[internal.K8sHostLabel], fakeNode.Name) // ensure annotations were correct - require.Equal(t, bpfProg.Annotations, bpfdagentinternal.Build_kernel_info_annotations(programs[695])) + require.Equal(t, bpfProg.Annotations, bpfmanagentinternal.Build_kernel_info_annotations(programs[695])) // The fourth reconcile will end up exiting with a 30 second requeue res, err = r.Reconcile(ctx, req) @@ -226,17 +226,17 @@ func TestDiscoveredProgramControllerCreate(t *testing.T) { func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { var ( - namespace = "bpfd" + namespace = "bpfman" fakeNode = testutils.NewNode("fake-control-plane") ctx = context.TODO() bpfProgName0 = fmt.Sprintf("%s-%d-%s", "dump-bpf-map", 693, fakeNode.Name) bpfProgName1 = fmt.Sprintf("%s-%d-%s", "dump-bpf-prog", 694, fakeNode.Name) bpfProgName2 = fmt.Sprintf("%d-%s", 695, fakeNode.Name) - bpfProg = &bpfdiov1alpha1.BpfProgram{} + bpfProg = &bpfmaniov1alpha1.BpfProgram{} fakeUID = "ef71d42c-aa21-48e8-a697-82391d801a81" - programs = map[int]*gobpfd.ListResponse_ListResult{ + programs = map[int]*gobpfman.ListResponse_ListResult{ 693: { - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ Name: "dump_bpf_map", ProgramType: 26, Id: 693, @@ -253,7 +253,7 @@ func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { }, }, 694: { - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ Name: "dump_bpf_prog", ProgramType: 26, Id: 694, @@ -271,7 +271,7 @@ func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { }, // test program with no name 695: { - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ ProgramType: 8, Id: 695, LoadedAt: "2023-07-20T19:11:11+0000", @@ -284,12 +284,12 @@ func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { VerifiedInsns: 8, }, }, - // skip program loaded by bpfd + // skip program loaded by bpfman 696: { - Info: &gobpfd.ProgramInfo{ + Info: &gobpfman.ProgramInfo{ Metadata: map[string]string{internal.UuidMetadataKey: fakeUID}, }, - KernelInfo: &gobpfd.KernelProgramInfo{ + KernelInfo: &gobpfman.KernelProgramInfo{ ProgramType: 8, Id: 696, LoadedAt: "2023-07-20T19:11:11+0000", @@ -310,19 +310,19 @@ func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFakeWithPrograms(programs) + cli := agenttestutils.NewBpfmanClientFakeWithPrograms(programs) rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -372,7 +372,7 @@ func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { // node Label was correctly set require.Equal(t, bpfProg.Labels[internal.K8sHostLabel], fakeNode.Name) // ensure annotations were correct - require.Equal(t, bpfProg.Annotations, bpfdagentinternal.Build_kernel_info_annotations(programs[693])) + require.Equal(t, bpfProg.Annotations, bpfmanagentinternal.Build_kernel_info_annotations(programs[693])) // Check the second discovered BpfProgram Object was created successfully err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName1, Namespace: metav1.NamespaceAll}, bpfProg) @@ -384,7 +384,7 @@ func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { // node Label was correctly set require.Equal(t, bpfProg.Labels[internal.K8sHostLabel], fakeNode.Name) // ensure annotations were correct - require.Equal(t, bpfProg.Annotations, bpfdagentinternal.Build_kernel_info_annotations(programs[694])) + require.Equal(t, bpfProg.Annotations, bpfmanagentinternal.Build_kernel_info_annotations(programs[694])) // Check the third discovered BpfProgram Object was created successfully err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName2, Namespace: metav1.NamespaceAll}, bpfProg) @@ -396,10 +396,10 @@ func TestDiscoveredProgramControllerCreateAndDeleteStale(t *testing.T) { // node Label was correctly set require.Equal(t, bpfProg.Labels[internal.K8sHostLabel], fakeNode.Name) // ensure annotations were correct - require.Equal(t, bpfProg.Annotations, bpfdagentinternal.Build_kernel_info_annotations(programs[695])) + require.Equal(t, bpfProg.Annotations, bpfmanagentinternal.Build_kernel_info_annotations(programs[695])) // delete program - _, err = rc.BpfdClient.Unload(ctx, &gobpfd.UnloadRequest{Id: 693}) + _, err = rc.BpfmanClient.Unload(ctx, &gobpfman.UnloadRequest{Id: 693}) require.NoError(t, err) // The fourth reconcile will end up deleting the extra bpfProgram diff --git a/bpfd-operator/controllers/bpfd-agent/internal/auth.go b/bpfman-operator/controllers/bpfman-agent/internal/auth.go similarity index 100% rename from bpfd-operator/controllers/bpfd-agent/internal/auth.go rename to bpfman-operator/controllers/bpfman-agent/internal/auth.go diff --git a/bpfd-operator/controllers/bpfd-agent/internal/bpfd-core.go b/bpfman-operator/controllers/bpfman-agent/internal/bpfman-core.go similarity index 66% rename from bpfd-operator/controllers/bpfd-agent/internal/bpfd-core.go rename to bpfman-operator/controllers/bpfman-agent/internal/bpfman-core.go index d5394e8c7..01564bb09 100644 --- a/bpfd-operator/controllers/bpfd-agent/internal/bpfd-core.go +++ b/bpfman-operator/controllers/bpfman-agent/internal/bpfman-core.go @@ -21,9 +21,9 @@ import ( "fmt" "strconv" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/internal" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/containers/image/docker/reference" "k8s.io/apimachinery/pkg/types" @@ -33,20 +33,20 @@ import ( var log = ctrl.Log.WithName("agent-intern") -func imagePullPolicyConversion(policy bpfdiov1alpha1.PullPolicy) int32 { +func imagePullPolicyConversion(policy bpfmaniov1alpha1.PullPolicy) int32 { switch policy { - case bpfdiov1alpha1.PullAlways: + case bpfmaniov1alpha1.PullAlways: return 0 - case bpfdiov1alpha1.PullIfNotPresent: + case bpfmaniov1alpha1.PullIfNotPresent: return 1 - case bpfdiov1alpha1.PullNever: + case bpfmaniov1alpha1.PullNever: return 2 default: return 1 } } -func GetBytecode(c client.Client, b *bpfdiov1alpha1.BytecodeSelector) (*gobpfd.BytecodeLocation, error) { +func GetBytecode(c client.Client, b *bpfmaniov1alpha1.BytecodeSelector) (*gobpfman.BytecodeLocation, error) { if b.Image != nil { bytecodeImage := b.Image @@ -79,8 +79,8 @@ func GetBytecode(c client.Client, b *bpfdiov1alpha1.BytecodeSelector) (*gobpfd.B password = cred.Password } - return &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_Image{Image: &gobpfd.BytecodeImage{ + return &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_Image{Image: &gobpfman.BytecodeImage{ Url: bytecodeImage.Url, ImagePullPolicy: imagePullPolicyConversion(bytecodeImage.ImagePullPolicy), Username: &username, @@ -88,25 +88,25 @@ func GetBytecode(c client.Client, b *bpfdiov1alpha1.BytecodeSelector) (*gobpfd.B }}, }, nil } else { - return &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: *b.Path}, + return &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: *b.Path}, }, nil } } -func buildBpfdUnloadRequest(id uint32) *gobpfd.UnloadRequest { - return &gobpfd.UnloadRequest{ +func buildBpfmanUnloadRequest(id uint32) *gobpfman.UnloadRequest { + return &gobpfman.UnloadRequest{ Id: id, } } -func LoadBpfdProgram(ctx context.Context, bpfdClient gobpfd.BpfdClient, - loadRequest *gobpfd.LoadRequest) (*uint32, error) { - var res *gobpfd.LoadResponse +func LoadBpfmanProgram(ctx context.Context, bpfmanClient gobpfman.BpfmanClient, + loadRequest *gobpfman.LoadRequest) (*uint32, error) { + var res *gobpfman.LoadResponse - res, err := bpfdClient.Load(ctx, loadRequest) + res, err := bpfmanClient.Load(ctx, loadRequest) if err != nil { - return nil, fmt.Errorf("failed to load bpfProgram via bpfd: %w", err) + return nil, fmt.Errorf("failed to load bpfProgram via bpfman: %w", err) } kernelInfo := res.GetKernelInfo() if kernelInfo == nil { @@ -117,25 +117,25 @@ func LoadBpfdProgram(ctx context.Context, bpfdClient gobpfd.BpfdClient, return &id, nil } -func UnloadBpfdProgram(ctx context.Context, bpfdClient gobpfd.BpfdClient, id uint32) error { - _, err := bpfdClient.Unload(ctx, buildBpfdUnloadRequest(id)) +func UnloadBpfmanProgram(ctx context.Context, bpfmanClient gobpfman.BpfmanClient, id uint32) error { + _, err := bpfmanClient.Unload(ctx, buildBpfmanUnloadRequest(id)) if err != nil { - return fmt.Errorf("failed to unload bpfProgram via bpfd: %v", + return fmt.Errorf("failed to unload bpfProgram via bpfman: %v", err) } return nil } -func ListBpfdPrograms(ctx context.Context, bpfdClient gobpfd.BpfdClient, programType internal.ProgramType) (map[string]*gobpfd.ListResponse_ListResult, error) { - listOnlyBpfdPrograms := true - listReq := gobpfd.ListRequest{ - ProgramType: programType.Uint32(), - BpfdProgramsOnly: &listOnlyBpfdPrograms, +func ListBpfmanPrograms(ctx context.Context, bpfmanClient gobpfman.BpfmanClient, programType internal.ProgramType) (map[string]*gobpfman.ListResponse_ListResult, error) { + listOnlyBpfmanPrograms := true + listReq := gobpfman.ListRequest{ + ProgramType: programType.Uint32(), + BpfmanProgramsOnly: &listOnlyBpfmanPrograms, } - out := map[string]*gobpfd.ListResponse_ListResult{} + out := map[string]*gobpfman.ListResponse_ListResult{} - listResponse, err := bpfdClient.List(ctx, &listReq) + listResponse, err := bpfmanClient.List(ctx, &listReq) if err != nil { return nil, err } @@ -155,12 +155,12 @@ func ListBpfdPrograms(ctx context.Context, bpfdClient gobpfd.BpfdClient, program return out, nil } -func GetBpfdProgram(ctx context.Context, bpfdClient gobpfd.BpfdClient, uuid types.UID) (*gobpfd.ListResponse_ListResult, error) { - listReq := gobpfd.ListRequest{ +func GetBpfmanProgram(ctx context.Context, bpfmanClient gobpfman.BpfmanClient, uuid types.UID) (*gobpfman.ListResponse_ListResult, error) { + listReq := gobpfman.ListRequest{ MatchMetadata: map[string]string{internal.UuidMetadataKey: string(uuid)}, } - listResponse, err := bpfdClient.List(ctx, &listReq) + listResponse, err := bpfmanClient.List(ctx, &listReq) if err != nil { return nil, err } @@ -172,8 +172,8 @@ func GetBpfdProgram(ctx context.Context, bpfdClient gobpfd.BpfdClient, uuid type return listResponse.Results[0], nil } -func ListAllPrograms(ctx context.Context, bpfdClient gobpfd.BpfdClient) ([]*gobpfd.ListResponse_ListResult, error) { - listResponse, err := bpfdClient.List(ctx, &gobpfd.ListRequest{}) +func ListAllPrograms(ctx context.Context, bpfmanClient gobpfman.BpfmanClient) ([]*gobpfman.ListResponse_ListResult, error) { + listResponse, err := bpfmanClient.List(ctx, &gobpfman.ListRequest{}) if err != nil { return nil, err } @@ -182,7 +182,7 @@ func ListAllPrograms(ctx context.Context, bpfdClient gobpfd.BpfdClient) ([]*gobp } // Convert a list result into a set of kernel info annotations -func Build_kernel_info_annotations(p *gobpfd.ListResponse_ListResult) map[string]string { +func Build_kernel_info_annotations(p *gobpfman.ListResponse_ListResult) map[string]string { kernelInfo := p.GetKernelInfo() if kernelInfo != nil { return map[string]string{ @@ -205,7 +205,7 @@ func Build_kernel_info_annotations(p *gobpfd.ListResponse_ListResult) map[string } // get the program ID from a bpfProgram -func GetID(p *bpfdiov1alpha1.BpfProgram) (*uint32, error) { +func GetID(p *bpfmaniov1alpha1.BpfProgram) (*uint32, error) { idString, ok := p.Annotations[internal.IdAnnotation] if !ok { return nil, nil diff --git a/bpfd-operator/controllers/bpfd-agent/internal/cmp.go b/bpfman-operator/controllers/bpfman-agent/internal/cmp.go similarity index 97% rename from bpfd-operator/controllers/bpfd-agent/internal/cmp.go rename to bpfman-operator/controllers/bpfman-agent/internal/cmp.go index 556bf7d32..7c6f1d66f 100644 --- a/bpfd-operator/controllers/bpfd-agent/internal/cmp.go +++ b/bpfman-operator/controllers/bpfman-agent/internal/cmp.go @@ -20,12 +20,12 @@ import ( "fmt" "reflect" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" ) // Look at using https://pkg.go.dev/google.golang.org/protobuf/testing/protocmp to simplify. // Is state equal, ignoring UUID and GRPC type fields. -func DoesProgExist(actual *gobpfd.ListResponse_ListResult, expected *gobpfd.LoadRequest) (bool, []string) { +func DoesProgExist(actual *gobpfman.ListResponse_ListResult, expected *gobpfman.LoadRequest) (bool, []string) { var reasons []string actualInfo := actual.GetInfo() diff --git a/bpfd-operator/controllers/bpfd-agent/internal/iface.go b/bpfman-operator/controllers/bpfman-agent/internal/iface.go similarity index 100% rename from bpfd-operator/controllers/bpfd-agent/internal/iface.go rename to bpfman-operator/controllers/bpfman-agent/internal/iface.go diff --git a/bpfman-operator/controllers/bpfman-agent/internal/test-utils/fake_bpfman_client.go b/bpfman-operator/controllers/bpfman-agent/internal/test-utils/fake_bpfman_client.go new file mode 100644 index 000000000..051e7e1ca --- /dev/null +++ b/bpfman-operator/controllers/bpfman-agent/internal/test-utils/fake_bpfman_client.go @@ -0,0 +1,120 @@ +/* +Copyright 2022. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testutils + +import ( + "context" + "fmt" + "math/rand" + + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" + grpc "google.golang.org/grpc" +) + +type BpfmanClientFake struct { + LoadRequests map[int]*gobpfman.LoadRequest + UnloadRequests map[int]*gobpfman.UnloadRequest + ListRequests []*gobpfman.ListRequest + GetRequests map[int]*gobpfman.GetRequest + Programs map[int]*gobpfman.ListResponse_ListResult + PullBytecodeRequests map[int]*gobpfman.PullBytecodeRequest +} + +func NewBpfmanClientFake() *BpfmanClientFake { + return &BpfmanClientFake{ + LoadRequests: map[int]*gobpfman.LoadRequest{}, + UnloadRequests: map[int]*gobpfman.UnloadRequest{}, + ListRequests: []*gobpfman.ListRequest{}, + GetRequests: map[int]*gobpfman.GetRequest{}, + Programs: map[int]*gobpfman.ListResponse_ListResult{}, + PullBytecodeRequests: map[int]*gobpfman.PullBytecodeRequest{}, + } +} + +func NewBpfmanClientFakeWithPrograms(programs map[int]*gobpfman.ListResponse_ListResult) *BpfmanClientFake { + return &BpfmanClientFake{ + LoadRequests: map[int]*gobpfman.LoadRequest{}, + UnloadRequests: map[int]*gobpfman.UnloadRequest{}, + ListRequests: []*gobpfman.ListRequest{}, + GetRequests: map[int]*gobpfman.GetRequest{}, + Programs: programs, + } +} + +func (b *BpfmanClientFake) Load(ctx context.Context, in *gobpfman.LoadRequest, opts ...grpc.CallOption) (*gobpfman.LoadResponse, error) { + id := rand.Intn(100) + b.LoadRequests[id] = in + + b.Programs[id] = loadRequestToListResult(in, uint32(id)) + + return &gobpfman.LoadResponse{ + Info: b.Programs[id].Info, + KernelInfo: b.Programs[id].KernelInfo, + }, nil +} + +func (b *BpfmanClientFake) Unload(ctx context.Context, in *gobpfman.UnloadRequest, opts ...grpc.CallOption) (*gobpfman.UnloadResponse, error) { + b.UnloadRequests[int(in.Id)] = in + delete(b.Programs, int(in.Id)) + + return &gobpfman.UnloadResponse{}, nil +} + +func (b *BpfmanClientFake) List(ctx context.Context, in *gobpfman.ListRequest, opts ...grpc.CallOption) (*gobpfman.ListResponse, error) { + b.ListRequests = append(b.ListRequests, in) + results := &gobpfman.ListResponse{Results: []*gobpfman.ListResponse_ListResult{}} + for _, v := range b.Programs { + results.Results = append(results.Results, v) + } + return results, nil +} + +func loadRequestToListResult(loadReq *gobpfman.LoadRequest, id uint32) *gobpfman.ListResponse_ListResult { + mapOwnerId := loadReq.GetMapOwnerId() + programInfo := gobpfman.ProgramInfo{ + Name: loadReq.GetName(), + Bytecode: loadReq.GetBytecode(), + Attach: loadReq.GetAttach(), + GlobalData: loadReq.GetGlobalData(), + MapOwnerId: &mapOwnerId, + Metadata: loadReq.GetMetadata(), + } + kernelInfo := gobpfman.KernelProgramInfo{ + Id: id, + ProgramType: loadReq.GetProgramType(), + } + + return &gobpfman.ListResponse_ListResult{ + Info: &programInfo, + KernelInfo: &kernelInfo, + } +} + +func (b *BpfmanClientFake) Get(ctx context.Context, in *gobpfman.GetRequest, opts ...grpc.CallOption) (*gobpfman.GetResponse, error) { + if b.Programs[int(in.Id)] != nil { + return &gobpfman.GetResponse{ + Info: b.Programs[int(in.Id)].Info, + KernelInfo: b.Programs[int(in.Id)].KernelInfo, + }, nil + } else { + return nil, fmt.Errorf("Requested program does not exist") + } +} + +func (b *BpfmanClientFake) PullBytecode(ctx context.Context, in *gobpfman.PullBytecodeRequest, opts ...grpc.CallOption) (*gobpfman.PullBytecodeResponse, error) { + return &gobpfman.PullBytecodeResponse{}, nil +} diff --git a/bpfd-operator/controllers/bpfd-agent/kprobe-program.go b/bpfman-operator/controllers/bpfman-agent/kprobe-program.go similarity index 68% rename from bpfd-operator/controllers/bpfd-agent/kprobe-program.go rename to bpfman-operator/controllers/bpfman-agent/kprobe-program.go index 36cc2f096..ed6ea8088 100644 --- a/bpfd-operator/controllers/bpfd-agent/kprobe-program.go +++ b/bpfman-operator/controllers/bpfman-agent/kprobe-program.go @@ -14,17 +14,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" "fmt" "strings" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + "github.com/bpfman/bpfman/bpfman-operator/internal" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -37,12 +37,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/source" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=kprobeprograms,verbs=get;list;watch +//+kubebuilder:rbac:groups=bpfman.io,resources=kprobeprograms,verbs=get;list;watch // BpfProgramReconciler reconciles a BpfProgram object type KprobeProgramReconciler struct { ReconcilerCommon - currentKprobeProgram *bpfdiov1alpha1.KprobeProgram + currentKprobeProgram *bpfmaniov1alpha1.KprobeProgram ourNode *v1.Node } @@ -59,13 +59,13 @@ func (r *KprobeProgramReconciler) getRecType() string { } // SetupWithManager sets up the controller with the Manager. -// The Bpfd-Agent should reconcile whenever a KprobeProgram is updated, -// load the program to the node via bpfd, and then create a bpfProgram object +// The Bpfman-Agent should reconcile whenever a KprobeProgram is updated, +// load the program to the node via bpfman, and then create a bpfProgram object // to reflect per node state information. func (r *KprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.KprobeProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). - Owns(&bpfdiov1alpha1.BpfProgram{}, + For(&bpfmaniov1alpha1.KprobeProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). + Owns(&bpfmaniov1alpha1.BpfProgram{}, builder.WithPredicates(predicate.And( internal.BpfProgramTypePredicate(internal.Kprobe.String()), internal.BpfProgramNodePredicate(r.NodeName)), @@ -82,8 +82,8 @@ func (r *KprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *KprobeProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfdiov1alpha1.BpfProgramList, error) { - progs := &bpfdiov1alpha1.BpfProgramList{} +func (r *KprobeProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfmaniov1alpha1.BpfProgramList, error) { + progs := &bpfmaniov1alpha1.BpfProgramList{} for _, function := range r.currentKprobeProgram.Spec.FunctionNames { // sanitize kprobe name to work in a bpfProgram name @@ -105,20 +105,20 @@ func (r *KprobeProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpf func (r *KprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { // Initialize node and current program - r.currentKprobeProgram = &bpfdiov1alpha1.KprobeProgram{} + r.currentKprobeProgram = &bpfmaniov1alpha1.KprobeProgram{} r.ourNode = &v1.Node{} r.Logger = ctrl.Log.WithName("kprobe") ctxLogger := log.FromContext(ctx) ctxLogger.Info("Reconcile Kprobe: Enter", "ReconcileKey", req) - // Lookup K8s node object for this bpfd-agent This should always succeed + // Lookup K8s node object for this bpfman-agent This should always succeed if err := r.Get(ctx, types.NamespacedName{Namespace: v1.NamespaceAll, Name: r.NodeName}, r.ourNode); err != nil { - return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfd-agent node %s : %v", + return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfman-agent node %s : %v", req.NamespacedName, err) } - kprobePrograms := &bpfdiov1alpha1.KprobeProgramList{} + kprobePrograms := &bpfmaniov1alpha1.KprobeProgramList{} opts := []client.ListOption{} @@ -132,16 +132,16 @@ func (r *KprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{Requeue: false}, nil } - // Get existing ebpf state from bpfd. - programMap, err := bpfdagentinternal.ListBpfdPrograms(ctx, r.BpfdClient, internal.Kprobe) + // Get existing ebpf state from bpfman. + programMap, err := bpfmanagentinternal.ListBpfmanPrograms(ctx, r.BpfmanClient, internal.Kprobe) if err != nil { - r.Logger.Error(err, "failed to list loaded bpfd programs") + r.Logger.Error(err, "failed to list loaded bpfman programs") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationAgent}, nil } // Reconcile each KprobeProgram. Don't return error here because it will trigger an infinite reconcile loop, instead // report the error to user and retry if specified. For some errors the controller may not decide to retry. - // Note: This only results in grpc calls to bpfd if we need to change something + // Note: This only results in grpc calls to bpfman if we need to change something requeue := false // initialize requeue to false for _, kprobeProgram := range kprobePrograms.Items { r.Logger.Info("KprobeProgramController is reconciling", "currentKprobeProgram", kprobeProgram.Name) @@ -174,21 +174,21 @@ func (r *KprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Reques } func (r *KprobeProgramReconciler) buildKprobeLoadRequest( - bytecode *gobpfd.BytecodeLocation, + bytecode *gobpfman.BytecodeLocation, uuid string, - bpfProgram *bpfdiov1alpha1.BpfProgram, - mapOwnerId *uint32) *gobpfd.LoadRequest { + bpfProgram *bpfmaniov1alpha1.BpfProgram, + mapOwnerId *uint32) *gobpfman.LoadRequest { - // Namespace isn't supported yet in bpfd, so set it to an empty string. + // Namespace isn't supported yet in bpfman, so set it to an empty string. namespace := "" - return &gobpfd.LoadRequest{ + return &gobpfman.LoadRequest{ Bytecode: bytecode, Name: r.currentKprobeProgram.Spec.BpfFunctionName, ProgramType: uint32(internal.Kprobe), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_KprobeAttachInfo{ - KprobeAttachInfo: &gobpfd.KprobeAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_KprobeAttachInfo{ + KprobeAttachInfo: &gobpfman.KprobeAttachInfo{ FnName: bpfProgram.Annotations[internal.KprobeProgramFunction], Offset: r.currentKprobeProgram.Spec.Offset, Retprobe: r.currentKprobeProgram.Spec.RetProbe, @@ -202,27 +202,27 @@ func (r *KprobeProgramReconciler) buildKprobeLoadRequest( } } -// reconcileBpfdPrograms ONLY reconciles the bpfd state for a single BpfProgram. +// reconcileBpfmanPrograms ONLY reconciles the bpfman state for a single BpfProgram. // It does not interact with the k8s API in any way. -func (r *KprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, - existingBpfPrograms map[string]*gobpfd.ListResponse_ListResult, - bytecodeSelector *bpfdiov1alpha1.BytecodeSelector, - bpfProgram *bpfdiov1alpha1.BpfProgram, +func (r *KprobeProgramReconciler) reconcileBpfmanProgram(ctx context.Context, + existingBpfPrograms map[string]*gobpfman.ListResponse_ListResult, + bytecodeSelector *bpfmaniov1alpha1.BytecodeSelector, + bpfProgram *bpfmaniov1alpha1.BpfProgram, isNodeSelected bool, isBeingDeleted bool, - mapOwnerStatus *MapOwnerParamStatus) (bpfdiov1alpha1.BpfProgramConditionType, error) { + mapOwnerStatus *MapOwnerParamStatus) (bpfmaniov1alpha1.BpfProgramConditionType, error) { r.Logger.V(1).Info("Existing bpfProgram", "UUID", bpfProgram.UID, "Name", bpfProgram.Name, "CurrentKprobeProgram", r.currentKprobeProgram.Name) uuid := bpfProgram.UID - getLoadRequest := func() (*gobpfd.LoadRequest, bpfdiov1alpha1.BpfProgramConditionType, error) { - bytecode, err := bpfdagentinternal.GetBytecode(r.Client, bytecodeSelector) + getLoadRequest := func() (*gobpfman.LoadRequest, bpfmaniov1alpha1.BpfProgramConditionType, error) { + bytecode, err := bpfmanagentinternal.GetBytecode(r.Client, bytecodeSelector) if err != nil { - return nil, bpfdiov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) + return nil, bpfmaniov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) } loadRequest := r.buildKprobeLoadRequest(bytecode, string(uuid), bpfProgram, mapOwnerStatus.mapOwnerId) - return loadRequest, bpfdiov1alpha1.BpfProgCondNone, nil + return loadRequest, bpfmaniov1alpha1.BpfProgCondNone, nil } existingProgram, doesProgramExist := existingBpfPrograms[string(uuid)] @@ -231,22 +231,22 @@ func (r *KprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, // If KprobeProgram is being deleted just exit if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } // Make sure if we're not selected just exit if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } // Make sure if the Map Owner is set but not found then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } // Make sure if the Map Owner is set but not loaded then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } // otherwise load it @@ -255,21 +255,21 @@ func (r *KprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, return condition, err } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load KprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } - r.Logger.Info("bpfd called to load KprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) - return bpfdiov1alpha1.BpfProgCondLoaded, nil + r.Logger.Info("bpfman called to load KprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } // prog ID should already have been set if program exists - id, err := bpfdagentinternal.GetID(bpfProgram) + id, err := bpfmanagentinternal.GetID(bpfProgram) if err != nil { r.Logger.Error(err, "Failed to get program ID") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } // BpfProgram exists but either KprobeProgram is being deleted, node is no @@ -280,27 +280,27 @@ func (r *KprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, "isDeleted", isBeingDeleted, "isSelected", isNodeSelected, "mapIsSet", mapOwnerStatus.isSet, "mapIsFound", mapOwnerStatus.isFound, "mapIsLoaded", mapOwnerStatus.isLoaded, "id", id) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload KprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.Logger.Info("bpfd called to unload KprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + r.Logger.Info("bpfman called to unload KprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } } @@ -312,26 +312,26 @@ func (r *KprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, r.Logger.V(1).WithValues("expectedProgram", loadRequest).WithValues("existingProgram", existingProgram).Info("StateMatch") - isSame, reasons := bpfdagentinternal.DoesProgExist(existingProgram, loadRequest) + isSame, reasons := bpfmanagentinternal.DoesProgExist(existingProgram, loadRequest) if !isSame { r.Logger.V(1).Info("KprobeProgram is in wrong state, unloading and reloading", "Reason", reasons) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload KprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load KprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, err + return bpfmaniov1alpha1.BpfProgCondNotLoaded, err } - r.Logger.Info("bpfd called to reload KprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + r.Logger.Info("bpfman called to reload KprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) } else { // Program exists and bpfProgram K8s Object is up to date - r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfd") + r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfman") r.progId = id } - return bpfdiov1alpha1.BpfProgCondLoaded, nil + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } diff --git a/bpfd-operator/controllers/bpfd-agent/kprobe-program_test.go b/bpfman-operator/controllers/bpfman-agent/kprobe-program_test.go similarity index 74% rename from bpfd-operator/controllers/bpfd-agent/kprobe-program_test.go rename to bpfman-operator/controllers/bpfman-agent/kprobe-program_test.go index 33e14f52a..ac32a2d71 100644 --- a/bpfd-operator/controllers/bpfd-agent/kprobe-program_test.go +++ b/bpfman-operator/controllers/bpfman-agent/kprobe-program_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -24,13 +24,13 @@ import ( "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/testing/protocmp" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - agenttestutils "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal/test-utils" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + agenttestutils "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal/test-utils" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -46,7 +46,7 @@ import ( func TestKprobeProgramControllerCreate(t *testing.T) { var ( name = "fakeKprobeProgram" - namespace = "bpfd" + namespace = "bpfman" bytecodePath = "/tmp/hello.o" bpfFunctionName = "test" functionName = "try_to_wake_up" @@ -56,19 +56,19 @@ func TestKprobeProgramControllerCreate(t *testing.T) { fakeNode = testutils.NewNode("fake-control-plane") ctx = context.TODO() bpfProgName = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, "try-to-wake-up") - bpfProg = &bpfdiov1alpha1.BpfProgram{} + bpfProg = &bpfmaniov1alpha1.BpfProgram{} fakeUID = "ef71d42c-aa21-48e8-a697-82391d801a81" ) // A KprobeProgram object with metadata and spec. - Kprobe := &bpfdiov1alpha1.KprobeProgram{ + Kprobe := &bpfmaniov1alpha1.KprobeProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.KprobeProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.KprobeProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, @@ -83,21 +83,21 @@ func TestKprobeProgramControllerCreate(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, Kprobe) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.KprobeProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, Kprobe) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.KprobeProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFake() + cli := agenttestutils.NewBpfmanClientFake() rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -144,7 +144,7 @@ func TestKprobeProgramControllerCreate(t *testing.T) { err = cl.Update(ctx, bpfProg) require.NoError(t, err) - // Second reconcile should create the bpfd Load Request and update the + // Second reconcile should create the bpfman Load Request and update the // BpfProgram object's maps field and id annotation. res, err = r.Reconcile(ctx, req) if err != nil { @@ -153,17 +153,17 @@ func TestKprobeProgramControllerCreate(t *testing.T) { // Require no requeue require.False(t, res.Requeue) - expectedLoadReq := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Kprobe.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: string(bpfProg.UID), internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_KprobeAttachInfo{ - KprobeAttachInfo: &gobpfd.KprobeAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_KprobeAttachInfo{ + KprobeAttachInfo: &gobpfman.KprobeAttachInfo{ FnName: functionName, Offset: uint64(offset), Retprobe: retprobe, @@ -178,14 +178,14 @@ func TestKprobeProgramControllerCreate(t *testing.T) { require.NoError(t, err) // prog ID should already have been set - id, err := bpfdagentinternal.GetID(bpfProg) + id, err := bpfmanagentinternal.GetID(bpfProg) require.NoError(t, err) // Check the bpfLoadRequest was correctly Built if !cmp.Equal(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform()) { cmp.Diff(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform()) t.Logf("Diff %v", cmp.Diff(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform())) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // Third reconcile should set the status to loaded @@ -201,5 +201,5 @@ func TestKprobeProgramControllerCreate(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName, Namespace: metav1.NamespaceAll}, bpfProg) require.NoError(t, err) - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) } diff --git a/bpfd-operator/controllers/bpfd-agent/tc-program.go b/bpfman-operator/controllers/bpfman-agent/tc-program.go similarity index 69% rename from bpfd-operator/controllers/bpfd-agent/tc-program.go rename to bpfman-operator/controllers/bpfman-agent/tc-program.go index 3a922b9b9..9324792e0 100644 --- a/bpfd-operator/controllers/bpfd-agent/tc-program.go +++ b/bpfman-operator/controllers/bpfman-agent/tc-program.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -30,21 +30,21 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + "github.com/bpfman/bpfman/bpfman-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" v1 "k8s.io/api/core/v1" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=tcprograms,verbs=get;list;watch +//+kubebuilder:rbac:groups=bpfman.io,resources=tcprograms,verbs=get;list;watch // TcProgramReconciler reconciles a tcProgram object by creating multiple -// bpfProgram objects and managing bpfd for each one. +// bpfProgram objects and managing bpfman for each one. type TcProgramReconciler struct { ReconcilerCommon - currentTcProgram *bpfdiov1alpha1.TcProgram + currentTcProgram *bpfmaniov1alpha1.TcProgram ourNode *v1.Node interfaces []string } @@ -61,8 +61,8 @@ func (r *TcProgramReconciler) getRecType() string { return internal.Tc.String() } -// Must match with bpfd internal types -func tcProceedOnToInt(proceedOn []bpfdiov1alpha1.TcProceedOnValue) []int32 { +// Must match with bpfman internal types +func tcProceedOnToInt(proceedOn []bpfmaniov1alpha1.TcProceedOnValue) []int32 { var out []int32 for _, p := range proceedOn { @@ -96,17 +96,17 @@ func tcProceedOnToInt(proceedOn []bpfdiov1alpha1.TcProceedOnValue) []int32 { } // SetupWithManager sets up the controller with the Manager. -// The Bpfd-Agent should reconcile whenever a TcProgram is updated, -// load the program to the node via bpfd, and then create bpfProgram object(s) +// The Bpfman-Agent should reconcile whenever a TcProgram is updated, +// load the program to the node via bpfman, and then create bpfProgram object(s) // to reflect per node state information. func (r *TcProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.TcProgram{}, builder.WithPredicates(predicate.And( + For(&bpfmaniov1alpha1.TcProgram{}, builder.WithPredicates(predicate.And( predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}), ), ). - Owns(&bpfdiov1alpha1.BpfProgram{}, + Owns(&bpfmaniov1alpha1.BpfProgram{}, builder.WithPredicates(predicate.And( internal.BpfProgramTypePredicate(internal.Tc.String()), internal.BpfProgramNodePredicate(r.NodeName)), @@ -123,8 +123,8 @@ func (r *TcProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *TcProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfdiov1alpha1.BpfProgramList, error) { - progs := &bpfdiov1alpha1.BpfProgramList{} +func (r *TcProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfmaniov1alpha1.BpfProgramList, error) { + progs := &bpfmaniov1alpha1.BpfProgramList{} for _, iface := range r.interfaces { bpfProgramName := fmt.Sprintf("%s-%s-%s", r.currentTcProgram.Name, r.NodeName, iface) annotations := map[string]string{internal.TcProgramInterface: iface} @@ -142,7 +142,7 @@ func (r *TcProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfdiov func (r *TcProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { // Initialize node and current program - r.currentTcProgram = &bpfdiov1alpha1.TcProgram{} + r.currentTcProgram = &bpfmaniov1alpha1.TcProgram{} r.ourNode = &v1.Node{} r.Logger = ctrl.Log.WithName("tc") var err error @@ -150,13 +150,13 @@ func (r *TcProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( ctxLogger := log.FromContext(ctx) ctxLogger.Info("Reconcile TC: Enter", "ReconcileKey", req) - // Lookup K8s node object for this bpfd-agent This should always succeed + // Lookup K8s node object for this bpfman-agent This should always succeed if err := r.Get(ctx, types.NamespacedName{Namespace: v1.NamespaceAll, Name: r.NodeName}, r.ourNode); err != nil { - return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfd-agent node %s : %v", + return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfman-agent node %s : %v", req.NamespacedName, err) } - tcPrograms := &bpfdiov1alpha1.TcProgramList{} + tcPrograms := &bpfmaniov1alpha1.TcProgramList{} opts := []client.ListOption{} @@ -170,16 +170,16 @@ func (r *TcProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( return ctrl.Result{Requeue: false}, nil } - // Get existing ebpf state from bpfd. - existingPrograms, err := bpfdagentinternal.ListBpfdPrograms(ctx, r.BpfdClient, internal.Tc) + // Get existing ebpf state from bpfman. + existingPrograms, err := bpfmanagentinternal.ListBpfmanPrograms(ctx, r.BpfmanClient, internal.Tc) if err != nil { - r.Logger.Error(err, "failed to list loaded bpfd programs") + r.Logger.Error(err, "failed to list loaded bpfman programs") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationAgent}, nil } // Reconcile each TcProgram. Don't return error here because it will trigger an infinite reconcile loop, instead // report the error to user and retry if specified. For some errors the controller may not decide to retry. - // Note: This only results in grpc calls to bpfd if we need to change something + // Note: This only results in grpc calls to bpfman if we need to change something requeue := false // initialize requeue to false for _, tcProgram := range tcPrograms.Items { r.Logger.Info("TcProgramController is reconciling", "currentTcProgram", tcProgram.Name) @@ -219,18 +219,18 @@ func (r *TcProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( } func (r *TcProgramReconciler) buildTcLoadRequest( - bytecode *gobpfd.BytecodeLocation, + bytecode *gobpfman.BytecodeLocation, uuid string, iface string, - mapOwnerId *uint32) *gobpfd.LoadRequest { + mapOwnerId *uint32) *gobpfman.LoadRequest { - return &gobpfd.LoadRequest{ + return &gobpfman.LoadRequest{ Bytecode: bytecode, Name: r.currentTcProgram.Spec.BpfFunctionName, ProgramType: uint32(internal.Tc), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TcAttachInfo{ - TcAttachInfo: &gobpfd.TCAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TcAttachInfo{ + TcAttachInfo: &gobpfman.TCAttachInfo{ Priority: r.currentTcProgram.Spec.Priority, Iface: iface, Direction: r.currentTcProgram.Spec.Direction, @@ -244,15 +244,15 @@ func (r *TcProgramReconciler) buildTcLoadRequest( } } -// reconcileBpfdPrograms ONLY reconciles the bpfd state for a single BpfProgram. +// reconcileBpfmanPrograms ONLY reconciles the bpfman state for a single BpfProgram. // It does not interact with the k8s API in any way. -func (r *TcProgramReconciler) reconcileBpfdProgram(ctx context.Context, - existingBpfPrograms map[string]*gobpfd.ListResponse_ListResult, - bytecodeSelector *bpfdiov1alpha1.BytecodeSelector, - bpfProgram *bpfdiov1alpha1.BpfProgram, +func (r *TcProgramReconciler) reconcileBpfmanProgram(ctx context.Context, + existingBpfPrograms map[string]*gobpfman.ListResponse_ListResult, + bytecodeSelector *bpfmaniov1alpha1.BytecodeSelector, + bpfProgram *bpfmaniov1alpha1.BpfProgram, isNodeSelected bool, isBeingDeleted bool, - mapOwnerStatus *MapOwnerParamStatus) (bpfdiov1alpha1.BpfProgramConditionType, error) { + mapOwnerStatus *MapOwnerParamStatus) (bpfmaniov1alpha1.BpfProgramConditionType, error) { r.Logger.V(1).Info("Existing bpfProgram", "UUID", bpfProgram.UID, "Name", bpfProgram.Name) iface := bpfProgram.Annotations[internal.TcProgramInterface] @@ -260,13 +260,13 @@ func (r *TcProgramReconciler) reconcileBpfdProgram(ctx context.Context, var err error uuid := string(bpfProgram.UID) - getLoadRequest := func() (*gobpfd.LoadRequest, bpfdiov1alpha1.BpfProgramConditionType, error) { - bytecode, err := bpfdagentinternal.GetBytecode(r.Client, bytecodeSelector) + getLoadRequest := func() (*gobpfman.LoadRequest, bpfmaniov1alpha1.BpfProgramConditionType, error) { + bytecode, err := bpfmanagentinternal.GetBytecode(r.Client, bytecodeSelector) if err != nil { - return nil, bpfdiov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) + return nil, bpfmaniov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) } loadRequest := r.buildTcLoadRequest(bytecode, string(uuid), iface, mapOwnerStatus.mapOwnerId) - return loadRequest, bpfdiov1alpha1.BpfProgCondNone, nil + return loadRequest, bpfmaniov1alpha1.BpfProgCondNone, nil } existingProgram, doesProgramExist := existingBpfPrograms[string(uuid)] @@ -275,22 +275,22 @@ func (r *TcProgramReconciler) reconcileBpfdProgram(ctx context.Context, // If TcProgram is being deleted just break out and remove finalizer if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } // Make sure if we're not selected just exit if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } // Make sure if the Map Owner is set but not found then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } // Make sure if the Map Owner is set but not loaded then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } // otherwise load it @@ -299,21 +299,21 @@ func (r *TcProgramReconciler) reconcileBpfdProgram(ctx context.Context, return condition, err } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load TcProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } - r.Logger.Info("bpfd called to load TcProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) - return bpfdiov1alpha1.BpfProgCondLoaded, nil + r.Logger.Info("bpfman called to load TcProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } // prog ID should already have been set - id, err := bpfdagentinternal.GetID(bpfProgram) + id, err := bpfmanagentinternal.GetID(bpfProgram) if err != nil { r.Logger.Error(err, "Failed to get program ID") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } // BpfProgram exists but either BpfProgramConfig is being deleted or node is no @@ -326,27 +326,27 @@ func (r *TcProgramReconciler) reconcileBpfdProgram(ctx context.Context, "isDeleted", isBeingDeleted, "isSelected", isNodeSelected, "mapIsSet", mapOwnerStatus.isSet, "mapIsFound", mapOwnerStatus.isFound, "mapIsLoaded", mapOwnerStatus.isLoaded) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload TcProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.Logger.Info("bpfd called to unload TcProgram on Node", "Name", bpfProgram.Name, "UUID", id) + r.Logger.Info("bpfman called to unload TcProgram on Node", "Name", bpfProgram.Name, "UUID", id) if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } } @@ -356,27 +356,27 @@ func (r *TcProgramReconciler) reconcileBpfdProgram(ctx context.Context, return condition, err } - isSame, reasons := bpfdagentinternal.DoesProgExist(existingProgram, loadRequest) + isSame, reasons := bpfmanagentinternal.DoesProgExist(existingProgram, loadRequest) if !isSame { r.Logger.V(1).Info("TcProgram is in wrong state, unloading and reloading", "Reason", reasons) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload TcProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load TcProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } - r.Logger.Info("bpfd called to reload TcProgram on Node", "Name", bpfProgram.Name, "UUID", id) + r.Logger.Info("bpfman called to reload TcProgram on Node", "Name", bpfProgram.Name, "UUID", id) } else { // Program exists and bpfProgram K8s Object is up to date - r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfd") + r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfman") r.progId = id } - return bpfdiov1alpha1.BpfProgCondLoaded, nil + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } diff --git a/bpfd-operator/controllers/bpfd-agent/tc-program_test.go b/bpfman-operator/controllers/bpfman-agent/tc-program_test.go similarity index 74% rename from bpfd-operator/controllers/bpfd-agent/tc-program_test.go rename to bpfman-operator/controllers/bpfman-agent/tc-program_test.go index fee1a87ae..d67ed9917 100644 --- a/bpfd-operator/controllers/bpfd-agent/tc-program_test.go +++ b/bpfman-operator/controllers/bpfman-agent/tc-program_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -24,14 +24,14 @@ import ( "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/testing/protocmp" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - agenttestutils "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal/test-utils" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + agenttestutils "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal/test-utils" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -47,7 +47,7 @@ import ( func TestTcProgramControllerCreate(t *testing.T) { var ( name = "fakeTcProgram" - namespace = "bpfd" + namespace = "bpfman" bytecodePath = "/tmp/hello.o" bpfFunctionName = "test" direction = "ingress" @@ -55,30 +55,30 @@ func TestTcProgramControllerCreate(t *testing.T) { fakeInt = "eth0" ctx = context.TODO() bpfProgName = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, fakeInt) - bpfProg = &bpfdiov1alpha1.BpfProgram{} + bpfProg = &bpfmaniov1alpha1.BpfProgram{} fakeUID = "ef71d42c-aa21-48e8-a697-82391d801a81" ) // A TcProgram object with metadata and spec. - tc := &bpfdiov1alpha1.TcProgram{ + tc := &bpfmaniov1alpha1.TcProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.TcProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.TcProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, - InterfaceSelector: bpfdiov1alpha1.InterfaceSelector{ + InterfaceSelector: bpfmaniov1alpha1.InterfaceSelector{ Interfaces: &[]string{fakeInt}, }, Priority: 0, Direction: direction, - ProceedOn: []bpfdiov1alpha1.TcProceedOnValue{ - bpfdiov1alpha1.TcProceedOnValue("pipe"), - bpfdiov1alpha1.TcProceedOnValue("dispatcher_return"), + ProceedOn: []bpfmaniov1alpha1.TcProceedOnValue{ + bpfmaniov1alpha1.TcProceedOnValue("pipe"), + bpfmaniov1alpha1.TcProceedOnValue("dispatcher_return"), }, }, } @@ -88,21 +88,21 @@ func TestTcProgramControllerCreate(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, tc) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TcProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, tc) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TcProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFake() + cli := agenttestutils.NewBpfmanClientFake() rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -147,7 +147,7 @@ func TestTcProgramControllerCreate(t *testing.T) { err = cl.Update(ctx, bpfProg) require.NoError(t, err) - // Second reconcile should create the bpfd Load Request and update the + // Second reconcile should create the bpfman Load Request and update the // BpfProgram object's 'Programs' field. res, err = r.Reconcile(ctx, req) if err != nil { @@ -158,17 +158,17 @@ func TestTcProgramControllerCreate(t *testing.T) { require.False(t, res.Requeue) uuid := string(bpfProg.UID) - expectedLoadReq := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Tc.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: string(uuid), internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TcAttachInfo{ - TcAttachInfo: &gobpfd.TCAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TcAttachInfo{ + TcAttachInfo: &gobpfman.TCAttachInfo{ Iface: fakeInt, Priority: 0, Direction: direction, @@ -183,13 +183,13 @@ func TestTcProgramControllerCreate(t *testing.T) { require.NoError(t, err) // prog ID should already have been set - id, err := bpfdagentinternal.GetID(bpfProg) + id, err := bpfmanagentinternal.GetID(bpfProg) require.NoError(t, err) // Check the bpfLoadRequest was correctly built if !cmp.Equal(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform()) { t.Logf("Diff %v", cmp.Diff(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform())) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // Third reconcile should update the bpfPrograms status to loaded @@ -205,13 +205,13 @@ func TestTcProgramControllerCreate(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName, Namespace: metav1.NamespaceAll}, bpfProg) require.NoError(t, err) - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) } func TestTcProgramControllerCreateMultiIntf(t *testing.T) { var ( name = "fakeTcProgram" - namespace = "bpfd" + namespace = "bpfman" bytecodePath = "/tmp/hello.o" bpfFunctionName = "test" direction = "ingress" @@ -220,32 +220,32 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { ctx = context.TODO() bpfProgName0 = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, fakeInts[0]) bpfProgName1 = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, fakeInts[1]) - bpfProgEth0 = &bpfdiov1alpha1.BpfProgram{} - bpfProgEth1 = &bpfdiov1alpha1.BpfProgram{} + bpfProgEth0 = &bpfmaniov1alpha1.BpfProgram{} + bpfProgEth1 = &bpfmaniov1alpha1.BpfProgram{} fakeUID0 = "ef71d42c-aa21-48e8-a697-82391d801a80" fakeUID1 = "ef71d42c-aa21-48e8-a697-82391d801a81" ) // A TcProgram object with metadata and spec. - tc := &bpfdiov1alpha1.TcProgram{ + tc := &bpfmaniov1alpha1.TcProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.TcProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.TcProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, - InterfaceSelector: bpfdiov1alpha1.InterfaceSelector{ + InterfaceSelector: bpfmaniov1alpha1.InterfaceSelector{ Interfaces: &fakeInts, }, Priority: 0, Direction: direction, - ProceedOn: []bpfdiov1alpha1.TcProceedOnValue{ - bpfdiov1alpha1.TcProceedOnValue("pipe"), - bpfdiov1alpha1.TcProceedOnValue("dispatcher_return"), + ProceedOn: []bpfmaniov1alpha1.TcProceedOnValue{ + bpfmaniov1alpha1.TcProceedOnValue("pipe"), + bpfmaniov1alpha1.TcProceedOnValue("dispatcher_return"), }, }, } @@ -255,21 +255,21 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, tc) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TcProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, tc) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TcProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFake() + cli := agenttestutils.NewBpfmanClientFake() rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -314,7 +314,7 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { err = cl.Update(ctx, bpfProgEth0) require.NoError(t, err) - // Second reconcile should create the bpfd Load Requests for the first bpfProgram and update the prog id. + // Second reconcile should create the bpfman Load Requests for the first bpfProgram and update the prog id. res, err = r.Reconcile(ctx, req) if err != nil { t.Fatalf("reconcile: (%v)", err) @@ -329,7 +329,7 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { t.Fatalf("reconcile: (%v)", err) } - // Fourth reconcile should create the bpfd Load Requests for the second bpfProgram. + // Fourth reconcile should create the bpfman Load Requests for the second bpfProgram. res, err = r.Reconcile(ctx, req) if err != nil { t.Fatalf("reconcile: (%v)", err) @@ -377,17 +377,17 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { uuid0 := string(bpfProgEth0.UID) - expectedLoadReq0 := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq0 := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Tc.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: string(uuid0), internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TcAttachInfo{ - TcAttachInfo: &gobpfd.TCAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TcAttachInfo{ + TcAttachInfo: &gobpfman.TCAttachInfo{ Iface: fakeInts[0], Priority: 0, Direction: direction, @@ -399,17 +399,17 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { uuid1 := string(bpfProgEth1.UID) - expectedLoadReq1 := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq1 := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Tc.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: string(uuid1), internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TcAttachInfo{ - TcAttachInfo: &gobpfd.TCAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TcAttachInfo{ + TcAttachInfo: &gobpfman.TCAttachInfo{ Iface: fakeInts[1], Priority: 0, Direction: direction, @@ -424,7 +424,7 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { require.NoError(t, err) // prog ID should already have been set - id0, err := bpfdagentinternal.GetID(bpfProgEth0) + id0, err := bpfmanagentinternal.GetID(bpfProgEth0) require.NoError(t, err) // Check that the bpfProgram's maps was correctly updated @@ -432,19 +432,19 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { require.NoError(t, err) // prog ID should already have been set - id1, err := bpfdagentinternal.GetID(bpfProgEth1) + id1, err := bpfmanagentinternal.GetID(bpfProgEth1) require.NoError(t, err) // Check the bpfLoadRequest was correctly built if !cmp.Equal(expectedLoadReq0, cli.LoadRequests[int(*id0)], protocmp.Transform()) { t.Logf("Diff %v", cmp.Diff(expectedLoadReq0, cli.LoadRequests[int(*id0)], protocmp.Transform())) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // Check the bpfLoadRequest was correctly built if !cmp.Equal(expectedLoadReq1, cli.LoadRequests[int(*id1)], protocmp.Transform()) { t.Logf("Diff %v", cmp.Diff(expectedLoadReq1, cli.LoadRequests[int(*id1)], protocmp.Transform())) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // Check that the bpfProgram's maps was correctly updated @@ -468,11 +468,11 @@ func TestTcProgramControllerCreateMultiIntf(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName0, Namespace: metav1.NamespaceAll}, bpfProgEth0) require.NoError(t, err) - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProgEth0.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProgEth0.Status.Conditions[0].Type) // Check that the bpfProgram's status was correctly updated err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName1, Namespace: metav1.NamespaceAll}, bpfProgEth1) require.NoError(t, err) - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProgEth1.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProgEth1.Status.Conditions[0].Type) } diff --git a/bpfd-operator/controllers/bpfd-agent/tracepoint-program.go b/bpfman-operator/controllers/bpfman-agent/tracepoint-program.go similarity index 67% rename from bpfd-operator/controllers/bpfd-agent/tracepoint-program.go rename to bpfman-operator/controllers/bpfman-agent/tracepoint-program.go index 8ff0a2c38..3ec99a6c9 100644 --- a/bpfd-operator/controllers/bpfd-agent/tracepoint-program.go +++ b/bpfman-operator/controllers/bpfman-agent/tracepoint-program.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -31,20 +31,20 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" v1 "k8s.io/api/core/v1" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=tracepointprograms,verbs=get;list;watch +//+kubebuilder:rbac:groups=bpfman.io,resources=tracepointprograms,verbs=get;list;watch // BpfProgramReconciler reconciles a BpfProgram object type TracepointProgramReconciler struct { ReconcilerCommon - currentTracepointProgram *bpfdiov1alpha1.TracepointProgram + currentTracepointProgram *bpfmaniov1alpha1.TracepointProgram ourNode *v1.Node } @@ -61,13 +61,13 @@ func (r *TracepointProgramReconciler) getRecType() string { } // SetupWithManager sets up the controller with the Manager. -// The Bpfd-Agent should reconcile whenever a TracepointProgram is updated, -// load the program to the node via bpfd, and then create a bpfProgram object +// The Bpfman-Agent should reconcile whenever a TracepointProgram is updated, +// load the program to the node via bpfman, and then create a bpfProgram object // to reflect per node state information. func (r *TracepointProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.TracepointProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). - Owns(&bpfdiov1alpha1.BpfProgram{}, + For(&bpfmaniov1alpha1.TracepointProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). + Owns(&bpfmaniov1alpha1.BpfProgram{}, builder.WithPredicates(predicate.And( internal.BpfProgramTypePredicate(internal.Tracepoint.String()), internal.BpfProgramNodePredicate(r.NodeName)), @@ -84,8 +84,8 @@ func (r *TracepointProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *TracepointProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfdiov1alpha1.BpfProgramList, error) { - progs := &bpfdiov1alpha1.BpfProgramList{} +func (r *TracepointProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfmaniov1alpha1.BpfProgramList, error) { + progs := &bpfmaniov1alpha1.BpfProgramList{} for _, tracepoint := range r.currentTracepointProgram.Spec.Names { // sanitize tracepoint name to work in a bpfProgram name @@ -107,20 +107,20 @@ func (r *TracepointProgramReconciler) expectedBpfPrograms(ctx context.Context) ( func (r *TracepointProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { // Initialize node and current program - r.currentTracepointProgram = &bpfdiov1alpha1.TracepointProgram{} + r.currentTracepointProgram = &bpfmaniov1alpha1.TracepointProgram{} r.ourNode = &v1.Node{} r.Logger = ctrl.Log.WithName("tracept") ctxLogger := log.FromContext(ctx) ctxLogger.Info("Reconcile Tracepoint: Enter", "ReconcileKey", req) - // Lookup K8s node object for this bpfd-agent This should always succeed + // Lookup K8s node object for this bpfman-agent This should always succeed if err := r.Get(ctx, types.NamespacedName{Namespace: v1.NamespaceAll, Name: r.NodeName}, r.ourNode); err != nil { - return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfd-agent node %s : %v", + return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfman-agent node %s : %v", req.NamespacedName, err) } - tracepointPrograms := &bpfdiov1alpha1.TracepointProgramList{} + tracepointPrograms := &bpfmaniov1alpha1.TracepointProgramList{} opts := []client.ListOption{} @@ -134,16 +134,16 @@ func (r *TracepointProgramReconciler) Reconcile(ctx context.Context, req ctrl.Re return ctrl.Result{Requeue: false}, nil } - // Get existing ebpf state from bpfd. - programMap, err := bpfdagentinternal.ListBpfdPrograms(ctx, r.BpfdClient, internal.Tracepoint) + // Get existing ebpf state from bpfman. + programMap, err := bpfmanagentinternal.ListBpfmanPrograms(ctx, r.BpfmanClient, internal.Tracepoint) if err != nil { - r.Logger.Error(err, "failed to list loaded bpfd programs") + r.Logger.Error(err, "failed to list loaded bpfman programs") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationAgent}, nil } // Reconcile each TracepointProgram. Don't return error here because it will trigger an infinite reconcile loop, instead // report the error to user and retry if specified. For some errors the controller may not decide to retry. - // Note: This only results in grpc calls to bpfd if we need to change something + // Note: This only results in grpc calls to bpfman if we need to change something requeue := false // initialize requeue to false for _, tracepointProgram := range tracepointPrograms.Items { r.Logger.Info("TracepointProgramController is reconciling", "currentTracePtProgram", tracepointProgram.Name) @@ -176,18 +176,18 @@ func (r *TracepointProgramReconciler) Reconcile(ctx context.Context, req ctrl.Re } func (r *TracepointProgramReconciler) buildTracepointLoadRequest( - bytecode *gobpfd.BytecodeLocation, + bytecode *gobpfman.BytecodeLocation, uuid string, - bpfProgram *bpfdiov1alpha1.BpfProgram, - mapOwnerId *uint32) *gobpfd.LoadRequest { + bpfProgram *bpfmaniov1alpha1.BpfProgram, + mapOwnerId *uint32) *gobpfman.LoadRequest { - return &gobpfd.LoadRequest{ + return &gobpfman.LoadRequest{ Bytecode: bytecode, Name: r.currentTracepointProgram.Spec.BpfFunctionName, ProgramType: uint32(internal.Tracepoint), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TracepointAttachInfo{ - TracepointAttachInfo: &gobpfd.TracepointAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TracepointAttachInfo{ + TracepointAttachInfo: &gobpfman.TracepointAttachInfo{ Tracepoint: bpfProgram.Annotations[internal.TracepointProgramTracepoint], }, }, @@ -198,26 +198,26 @@ func (r *TracepointProgramReconciler) buildTracepointLoadRequest( } } -// reconcileBpfdPrograms ONLY reconciles the bpfd state for a single BpfProgram. +// reconcileBpfmanPrograms ONLY reconciles the bpfman state for a single BpfProgram. // It does not interact with the k8s API in any way. -func (r *TracepointProgramReconciler) reconcileBpfdProgram(ctx context.Context, - existingBpfPrograms map[string]*gobpfd.ListResponse_ListResult, - bytecodeSelector *bpfdiov1alpha1.BytecodeSelector, - bpfProgram *bpfdiov1alpha1.BpfProgram, +func (r *TracepointProgramReconciler) reconcileBpfmanProgram(ctx context.Context, + existingBpfPrograms map[string]*gobpfman.ListResponse_ListResult, + bytecodeSelector *bpfmaniov1alpha1.BytecodeSelector, + bpfProgram *bpfmaniov1alpha1.BpfProgram, isNodeSelected bool, isBeingDeleted bool, - mapOwnerStatus *MapOwnerParamStatus) (bpfdiov1alpha1.BpfProgramConditionType, error) { + mapOwnerStatus *MapOwnerParamStatus) (bpfmaniov1alpha1.BpfProgramConditionType, error) { r.Logger.V(1).Info("Existing bpfProgram", "UUID", bpfProgram.UID, "Name", bpfProgram.Name, "CurrentTracepointProgram", r.currentTracepointProgram.Name) uuid := string(bpfProgram.UID) - getLoadRequest := func() (*gobpfd.LoadRequest, bpfdiov1alpha1.BpfProgramConditionType, error) { - bytecode, err := bpfdagentinternal.GetBytecode(r.Client, bytecodeSelector) + getLoadRequest := func() (*gobpfman.LoadRequest, bpfmaniov1alpha1.BpfProgramConditionType, error) { + bytecode, err := bpfmanagentinternal.GetBytecode(r.Client, bytecodeSelector) if err != nil { - return nil, bpfdiov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) + return nil, bpfmaniov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) } loadRequest := r.buildTracepointLoadRequest(bytecode, uuid, bpfProgram, mapOwnerStatus.mapOwnerId) - return loadRequest, bpfdiov1alpha1.BpfProgCondNone, nil + return loadRequest, bpfmaniov1alpha1.BpfProgCondNone, nil } existingProgram, doesProgramExist := existingBpfPrograms[uuid] @@ -226,22 +226,22 @@ func (r *TracepointProgramReconciler) reconcileBpfdProgram(ctx context.Context, // If TracepointProgram is being deleted just exit if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } // Make sure if we're not selected just exit if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } // Make sure if the Map Owner is set but not found then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } // Make sure if the Map Owner is set but not loaded then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } // otherwise load it @@ -250,21 +250,21 @@ func (r *TracepointProgramReconciler) reconcileBpfdProgram(ctx context.Context, return condition, err } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load TracepointProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } - r.Logger.Info("bpfd called to load TracepointProgram on Node", "Name", bpfProgram.Name, "ID", uuid) - return bpfdiov1alpha1.BpfProgCondLoaded, nil + r.Logger.Info("bpfman called to load TracepointProgram on Node", "Name", bpfProgram.Name, "ID", uuid) + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } // prog ID should already have been set if program doesn't exist - id, err := bpfdagentinternal.GetID(bpfProgram) + id, err := bpfmanagentinternal.GetID(bpfProgram) if err != nil { r.Logger.Error(err, "Failed to get program ID") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } // BpfProgram exists but either TracepointProgram is being deleted, node is no @@ -275,27 +275,27 @@ func (r *TracepointProgramReconciler) reconcileBpfdProgram(ctx context.Context, "isDeleted", isBeingDeleted, "isSelected", isNodeSelected, "mapIsSet", mapOwnerStatus.isSet, "mapIsFound", mapOwnerStatus.isFound, "mapIsLoaded", mapOwnerStatus.isLoaded) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload TracepointProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.Logger.Info("bpfd called to unload TracepointProgram on Node", "Name", bpfProgram.Name, "UUID", id) + r.Logger.Info("bpfman called to unload TracepointProgram on Node", "Name", bpfProgram.Name, "UUID", id) if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } } @@ -307,27 +307,27 @@ func (r *TracepointProgramReconciler) reconcileBpfdProgram(ctx context.Context, r.Logger.V(1).WithValues("expectedProgram", loadRequest).WithValues("existingProgram", existingProgram).Info("StateMatch") - isSame, reasons := bpfdagentinternal.DoesProgExist(existingProgram, loadRequest) + isSame, reasons := bpfmanagentinternal.DoesProgExist(existingProgram, loadRequest) if !isSame { r.Logger.V(1).Info("TracepointProgram is in wrong state, unloading and reloading", "Reason", reasons) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload TracepointProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load TracepointProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, err + return bpfmaniov1alpha1.BpfProgCondNotLoaded, err } - r.Logger.Info("bpfd called to reload TracepointProgram on Node", "Name", bpfProgram.Name, "UUID", id) + r.Logger.Info("bpfman called to reload TracepointProgram on Node", "Name", bpfProgram.Name, "UUID", id) } else { // Program exists and bpfProgram K8s Object is up to date - r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfd") + r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfman") r.progId = id } - return bpfdiov1alpha1.BpfProgCondLoaded, nil + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } diff --git a/bpfd-operator/controllers/bpfd-agent/tracepoint-program_test.go b/bpfman-operator/controllers/bpfman-agent/tracepoint-program_test.go similarity index 73% rename from bpfd-operator/controllers/bpfd-agent/tracepoint-program_test.go rename to bpfman-operator/controllers/bpfman-agent/tracepoint-program_test.go index fd7f3a663..b2a4c64ed 100644 --- a/bpfd-operator/controllers/bpfd-agent/tracepoint-program_test.go +++ b/bpfman-operator/controllers/bpfman-agent/tracepoint-program_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -24,13 +24,13 @@ import ( "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/testing/protocmp" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - agenttestutils "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal/test-utils" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + agenttestutils "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal/test-utils" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -46,26 +46,26 @@ import ( func TestTracepointProgramControllerCreate(t *testing.T) { var ( name = "fakeTracepointProgram" - namespace = "bpfd" + namespace = "bpfman" bytecodePath = "/tmp/hello.o" bpfFunctionName = "test" tracepointName = "syscalls/sys_enter_setitimer" fakeNode = testutils.NewNode("fake-control-plane") ctx = context.TODO() bpfProgName = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, "syscalls-sys-enter-setitimer") - bpfProg = &bpfdiov1alpha1.BpfProgram{} + bpfProg = &bpfmaniov1alpha1.BpfProgram{} fakeUID = "ef71d42c-aa21-48e8-a697-82391d801a81" ) // A TracepointProgram object with metadata and spec. - Tracepoint := &bpfdiov1alpha1.TracepointProgram{ + Tracepoint := &bpfmaniov1alpha1.TracepointProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.TracepointProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.TracepointProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, @@ -78,21 +78,21 @@ func TestTracepointProgramControllerCreate(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, Tracepoint) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TracepointProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, Tracepoint) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TracepointProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFake() + cli := agenttestutils.NewBpfmanClientFake() rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -137,7 +137,7 @@ func TestTracepointProgramControllerCreate(t *testing.T) { err = cl.Update(ctx, bpfProg) require.NoError(t, err) - // Second reconcile should create the bpfd Load Request and update the + // Second reconcile should create the bpfman Load Request and update the // BpfProgram object's 'Programs' field. res, err = r.Reconcile(ctx, req) if err != nil { @@ -148,17 +148,17 @@ func TestTracepointProgramControllerCreate(t *testing.T) { require.False(t, res.Requeue) uuid := string(bpfProg.UID) - expectedLoadReq := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Tracepoint.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: string(uuid), internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TracepointAttachInfo{ - TracepointAttachInfo: &gobpfd.TracepointAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TracepointAttachInfo{ + TracepointAttachInfo: &gobpfman.TracepointAttachInfo{ Tracepoint: tracepointName, }, }, @@ -170,13 +170,13 @@ func TestTracepointProgramControllerCreate(t *testing.T) { require.NoError(t, err) // prog ID should already have been set - id, err := bpfdagentinternal.GetID(bpfProg) + id, err := bpfmanagentinternal.GetID(bpfProg) require.NoError(t, err) // Check the bpfLoadRequest was correctly Built if !cmp.Equal(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform()) { cmp.Diff(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform()) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // Check that the bpfProgram's programs was correctly updated @@ -196,5 +196,5 @@ func TestTracepointProgramControllerCreate(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName, Namespace: metav1.NamespaceAll}, bpfProg) require.NoError(t, err) - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) } diff --git a/bpfd-operator/controllers/bpfd-agent/uprobe-program.go b/bpfman-operator/controllers/bpfman-agent/uprobe-program.go similarity index 67% rename from bpfd-operator/controllers/bpfd-agent/uprobe-program.go rename to bpfman-operator/controllers/bpfman-agent/uprobe-program.go index 20465f8cd..8231a1815 100644 --- a/bpfd-operator/controllers/bpfd-agent/uprobe-program.go +++ b/bpfman-operator/controllers/bpfman-agent/uprobe-program.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -31,20 +31,20 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" v1 "k8s.io/api/core/v1" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=uprobeprograms,verbs=get;list;watch +//+kubebuilder:rbac:groups=bpfman.io,resources=uprobeprograms,verbs=get;list;watch // BpfProgramReconciler reconciles a BpfProgram object type UprobeProgramReconciler struct { ReconcilerCommon - currentUprobeProgram *bpfdiov1alpha1.UprobeProgram + currentUprobeProgram *bpfmaniov1alpha1.UprobeProgram ourNode *v1.Node } @@ -61,13 +61,13 @@ func (r *UprobeProgramReconciler) getRecType() string { } // SetupWithManager sets up the controller with the Manager. -// The Bpfd-Agent should reconcile whenever a UprobeProgram is updated, -// load the program to the node via bpfd, and then create a bpfProgram object +// The Bpfman-Agent should reconcile whenever a UprobeProgram is updated, +// load the program to the node via bpfman, and then create a bpfProgram object // to reflect per node state information. func (r *UprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.UprobeProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). - Owns(&bpfdiov1alpha1.BpfProgram{}, + For(&bpfmaniov1alpha1.UprobeProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). + Owns(&bpfmaniov1alpha1.BpfProgram{}, builder.WithPredicates(predicate.And( internal.BpfProgramTypePredicate(internal.UprobeString), internal.BpfProgramNodePredicate(r.NodeName)), @@ -84,8 +84,8 @@ func (r *UprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *UprobeProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfdiov1alpha1.BpfProgramList, error) { - progs := &bpfdiov1alpha1.BpfProgramList{} +func (r *UprobeProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfmaniov1alpha1.BpfProgramList, error) { + progs := &bpfmaniov1alpha1.BpfProgramList{} for _, target := range r.currentUprobeProgram.Spec.Targets { // sanitize uprobe name to work in a bpfProgram name @@ -107,20 +107,20 @@ func (r *UprobeProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpf func (r *UprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { // Initialize node and current program - r.currentUprobeProgram = &bpfdiov1alpha1.UprobeProgram{} + r.currentUprobeProgram = &bpfmaniov1alpha1.UprobeProgram{} r.ourNode = &v1.Node{} r.Logger = ctrl.Log.WithName("uprobe") ctxLogger := log.FromContext(ctx) ctxLogger.Info("Reconcile Uprobe: Enter", "ReconcileKey", req) - // Lookup K8s node object for this bpfd-agent This should always succeed + // Lookup K8s node object for this bpfman-agent This should always succeed if err := r.Get(ctx, types.NamespacedName{Namespace: v1.NamespaceAll, Name: r.NodeName}, r.ourNode); err != nil { - return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfd-agent node %s : %v", + return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfman-agent node %s : %v", req.NamespacedName, err) } - uprobePrograms := &bpfdiov1alpha1.UprobeProgramList{} + uprobePrograms := &bpfmaniov1alpha1.UprobeProgramList{} opts := []client.ListOption{} @@ -134,17 +134,17 @@ func (r *UprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{Requeue: false}, nil } - // Get existing ebpf state from bpfd. Since both uprobes and kprobes have + // Get existing ebpf state from bpfman. Since both uprobes and kprobes have // the same kernel ProgramType, we use internal.Kprobe below. - programMap, err := bpfdagentinternal.ListBpfdPrograms(ctx, r.BpfdClient, internal.Kprobe) + programMap, err := bpfmanagentinternal.ListBpfmanPrograms(ctx, r.BpfmanClient, internal.Kprobe) if err != nil { - r.Logger.Error(err, "failed to list loaded bpfd programs") + r.Logger.Error(err, "failed to list loaded bpfman programs") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationAgent}, nil } // Reconcile each UprobeProgram. Don't return error here because it will trigger an infinite reconcile loop, instead // report the error to user and retry if specified. For some errors the controller may not decide to retry. - // Note: This only results in grpc calls to bpfd if we need to change something + // Note: This only results in grpc calls to bpfman if we need to change something requeue := false // initialize requeue to false for _, uprobeProgram := range uprobePrograms.Items { r.Logger.Info("UprobeProgramController is reconciling", "currentUprobeProgram", uprobeProgram.Name) @@ -177,21 +177,21 @@ func (r *UprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Reques } func (r *UprobeProgramReconciler) buildUprobeLoadRequest( - bytecode *gobpfd.BytecodeLocation, + bytecode *gobpfman.BytecodeLocation, uuid string, - bpfProgram *bpfdiov1alpha1.BpfProgram, - mapOwnerId *uint32) *gobpfd.LoadRequest { + bpfProgram *bpfmaniov1alpha1.BpfProgram, + mapOwnerId *uint32) *gobpfman.LoadRequest { - // Namespace isn't supported yet in bpfd, so set it to an empty string. + // Namespace isn't supported yet in bpfman, so set it to an empty string. namespace := "" - return &gobpfd.LoadRequest{ + return &gobpfman.LoadRequest{ Bytecode: bytecode, Name: r.currentUprobeProgram.Spec.BpfFunctionName, ProgramType: uint32(internal.Kprobe), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_UprobeAttachInfo{ - UprobeAttachInfo: &gobpfd.UprobeAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_UprobeAttachInfo{ + UprobeAttachInfo: &gobpfman.UprobeAttachInfo{ FnName: &r.currentUprobeProgram.Spec.FunctionName, Offset: r.currentUprobeProgram.Spec.Offset, Target: bpfProgram.Annotations[internal.UprobeProgramTarget], @@ -206,27 +206,27 @@ func (r *UprobeProgramReconciler) buildUprobeLoadRequest( } } -// reconcileBpfdPrograms ONLY reconciles the bpfd state for a single BpfProgram. +// reconcileBpfmanPrograms ONLY reconciles the bpfman state for a single BpfProgram. // It does not interact with the k8s API in any way. -func (r *UprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, - existingBpfPrograms map[string]*gobpfd.ListResponse_ListResult, - bytecodeSelector *bpfdiov1alpha1.BytecodeSelector, - bpfProgram *bpfdiov1alpha1.BpfProgram, +func (r *UprobeProgramReconciler) reconcileBpfmanProgram(ctx context.Context, + existingBpfPrograms map[string]*gobpfman.ListResponse_ListResult, + bytecodeSelector *bpfmaniov1alpha1.BytecodeSelector, + bpfProgram *bpfmaniov1alpha1.BpfProgram, isNodeSelected bool, isBeingDeleted bool, - mapOwnerStatus *MapOwnerParamStatus) (bpfdiov1alpha1.BpfProgramConditionType, error) { + mapOwnerStatus *MapOwnerParamStatus) (bpfmaniov1alpha1.BpfProgramConditionType, error) { r.Logger.V(1).Info("Existing bpfProgram", "UUID", bpfProgram.UID, "Name", bpfProgram.Name, "CurrentUprobeProgram", r.currentUprobeProgram.Name) uuid := bpfProgram.UID - getLoadRequest := func() (*gobpfd.LoadRequest, bpfdiov1alpha1.BpfProgramConditionType, error) { - bytecode, err := bpfdagentinternal.GetBytecode(r.Client, bytecodeSelector) + getLoadRequest := func() (*gobpfman.LoadRequest, bpfmaniov1alpha1.BpfProgramConditionType, error) { + bytecode, err := bpfmanagentinternal.GetBytecode(r.Client, bytecodeSelector) if err != nil { - return nil, bpfdiov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) + return nil, bpfmaniov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) } loadRequest := r.buildUprobeLoadRequest(bytecode, string(uuid), bpfProgram, mapOwnerStatus.mapOwnerId) - return loadRequest, bpfdiov1alpha1.BpfProgCondNone, nil + return loadRequest, bpfmaniov1alpha1.BpfProgCondNone, nil } existingProgram, doesProgramExist := existingBpfPrograms[string(uuid)] @@ -235,22 +235,22 @@ func (r *UprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, // If UprobeProgram is being deleted just exit if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } // Make sure if we're not selected just exit if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } // Make sure if the Map Owner is set but not found then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } // Make sure if the Map Owner is set but not loaded then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } // otherwise load it @@ -259,21 +259,21 @@ func (r *UprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, return condition, err } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load UprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } - r.Logger.Info("bpfd called to load UprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) - return bpfdiov1alpha1.BpfProgCondLoaded, nil + r.Logger.Info("bpfman called to load UprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } // prog ID should already have been set if program exists - id, err := bpfdagentinternal.GetID(bpfProgram) + id, err := bpfmanagentinternal.GetID(bpfProgram) if err != nil { r.Logger.Error(err, "Failed to get program ID") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } // BpfProgram exists but either UprobeProgram is being deleted, node is no @@ -284,27 +284,27 @@ func (r *UprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, "isDeleted", isBeingDeleted, "isSelected", isNodeSelected, "mapIsSet", mapOwnerStatus.isSet, "mapIsFound", mapOwnerStatus.isFound, "mapIsLoaded", mapOwnerStatus.isLoaded) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload UprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.Logger.Info("bpfd called to unload UprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + r.Logger.Info("bpfman called to unload UprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } } @@ -316,25 +316,25 @@ func (r *UprobeProgramReconciler) reconcileBpfdProgram(ctx context.Context, r.Logger.V(1).WithValues("expectedProgram", loadRequest).WithValues("existingProgram", existingProgram).Info("StateMatch") - isSame, reasons := bpfdagentinternal.DoesProgExist(existingProgram, loadRequest) + isSame, reasons := bpfmanagentinternal.DoesProgExist(existingProgram, loadRequest) if !isSame { r.Logger.V(1).Info("UprobeProgram is in wrong state, unloading and reloading", "Reason", reasons) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload UprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load UprobeProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, err + return bpfmaniov1alpha1.BpfProgCondNotLoaded, err } - r.Logger.Info("bpfd called to reload UprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + r.Logger.Info("bpfman called to reload UprobeProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) } else { // Program exists and bpfProgram K8s Object is up to date - r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfd") + r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfman") } - return bpfdiov1alpha1.BpfProgCondLoaded, nil + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } diff --git a/bpfd-operator/controllers/bpfd-agent/uprobe-program_test.go b/bpfman-operator/controllers/bpfman-agent/uprobe-program_test.go similarity index 74% rename from bpfd-operator/controllers/bpfd-agent/uprobe-program_test.go rename to bpfman-operator/controllers/bpfman-agent/uprobe-program_test.go index 27e1a8df9..8b45b1988 100644 --- a/bpfd-operator/controllers/bpfd-agent/uprobe-program_test.go +++ b/bpfman-operator/controllers/bpfman-agent/uprobe-program_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -24,13 +24,13 @@ import ( "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/testing/protocmp" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - agenttestutils "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal/test-utils" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + agenttestutils "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal/test-utils" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -46,7 +46,7 @@ import ( func TestUprobeProgramControllerCreate(t *testing.T) { var ( name = "fakeUprobeProgram" - namespace = "bpfd" + namespace = "bpfman" bytecodePath = "/tmp/hello.o" bpfFunctionName = "test" functionName = "malloc" @@ -57,19 +57,19 @@ func TestUprobeProgramControllerCreate(t *testing.T) { fakeNode = testutils.NewNode("fake-control-plane") ctx = context.TODO() bpfProgName = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, "libc") - bpfProg = &bpfdiov1alpha1.BpfProgram{} + bpfProg = &bpfmaniov1alpha1.BpfProgram{} fakeUID = "ef71d42c-aa21-48e8-a697-82391d801a81" ) // A UprobeProgram object with metadata and spec. - Uprobe := &bpfdiov1alpha1.UprobeProgram{ + Uprobe := &bpfmaniov1alpha1.UprobeProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.UprobeProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.UprobeProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, @@ -85,21 +85,21 @@ func TestUprobeProgramControllerCreate(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, Uprobe) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.UprobeProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, Uprobe) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.UprobeProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFake() + cli := agenttestutils.NewBpfmanClientFake() rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -146,7 +146,7 @@ func TestUprobeProgramControllerCreate(t *testing.T) { err = cl.Update(ctx, bpfProg) require.NoError(t, err) - // Second reconcile should create the bpfd Load Request and update the + // Second reconcile should create the bpfman Load Request and update the // BpfProgram object's maps field and id annotation. res, err = r.Reconcile(ctx, req) if err != nil { @@ -155,17 +155,17 @@ func TestUprobeProgramControllerCreate(t *testing.T) { // Require no requeue require.False(t, res.Requeue) - expectedLoadReq := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Kprobe.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: string(bpfProg.UID), internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_UprobeAttachInfo{ - UprobeAttachInfo: &gobpfd.UprobeAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_UprobeAttachInfo{ + UprobeAttachInfo: &gobpfman.UprobeAttachInfo{ FnName: &functionName, Target: target, Offset: uint64(offset), @@ -181,14 +181,14 @@ func TestUprobeProgramControllerCreate(t *testing.T) { require.NoError(t, err) // prog ID should already have been set - id, err := bpfdagentinternal.GetID(bpfProg) + id, err := bpfmanagentinternal.GetID(bpfProg) require.NoError(t, err) // Check the bpfLoadRequest was correctly Built if !cmp.Equal(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform()) { cmp.Diff(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform()) t.Logf("Diff %v", cmp.Diff(expectedLoadReq, cli.LoadRequests[int(*id)], protocmp.Transform())) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // Third reconcile should set the status to loaded @@ -204,5 +204,5 @@ func TestUprobeProgramControllerCreate(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: bpfProgName, Namespace: metav1.NamespaceAll}, bpfProg) require.NoError(t, err) - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProg.Status.Conditions[0].Type) } diff --git a/bpfd-operator/controllers/bpfd-agent/xdp-program.go b/bpfman-operator/controllers/bpfman-agent/xdp-program.go similarity index 69% rename from bpfd-operator/controllers/bpfd-agent/xdp-program.go rename to bpfman-operator/controllers/bpfman-agent/xdp-program.go index d8685fadd..7742022e8 100644 --- a/bpfd-operator/controllers/bpfd-agent/xdp-program.go +++ b/bpfman-operator/controllers/bpfman-agent/xdp-program.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -30,20 +30,20 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" v1 "k8s.io/api/core/v1" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=xdpprograms,verbs=get;list;watch +//+kubebuilder:rbac:groups=bpfman.io,resources=xdpprograms,verbs=get;list;watch // BpfProgramReconciler reconciles a BpfProgram object type XdpProgramReconciler struct { ReconcilerCommon - currentXdpProgram *bpfdiov1alpha1.XdpProgram + currentXdpProgram *bpfmaniov1alpha1.XdpProgram ourNode *v1.Node interfaces []string } @@ -60,8 +60,8 @@ func (r *XdpProgramReconciler) getRecType() string { return internal.Xdp.String() } -// Must match with bpfd internal types -func xdpProceedOnToInt(proceedOn []bpfdiov1alpha1.XdpProceedOnValue) []int32 { +// Must match with bpfman internal types +func xdpProceedOnToInt(proceedOn []bpfmaniov1alpha1.XdpProceedOnValue) []int32 { var out []int32 for _, p := range proceedOn { @@ -85,13 +85,13 @@ func xdpProceedOnToInt(proceedOn []bpfdiov1alpha1.XdpProceedOnValue) []int32 { } // SetupWithManager sets up the controller with the Manager. -// The Bpfd-Agent should reconcile whenever a XdpProgram is updated, -// load the program to the node via bpfd, and then create a bpfProgram object +// The Bpfman-Agent should reconcile whenever a XdpProgram is updated, +// load the program to the node via bpfman, and then create a bpfProgram object // to reflect per node state information. func (r *XdpProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.XdpProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). - Owns(&bpfdiov1alpha1.BpfProgram{}, + For(&bpfmaniov1alpha1.XdpProgram{}, builder.WithPredicates(predicate.And(predicate.GenerationChangedPredicate{}, predicate.ResourceVersionChangedPredicate{}))). + Owns(&bpfmaniov1alpha1.BpfProgram{}, builder.WithPredicates(predicate.And( internal.BpfProgramTypePredicate(internal.Xdp.String()), internal.BpfProgramNodePredicate(r.NodeName)), @@ -108,8 +108,8 @@ func (r *XdpProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { Complete(r) } -func (r *XdpProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfdiov1alpha1.BpfProgramList, error) { - progs := &bpfdiov1alpha1.BpfProgramList{} +func (r *XdpProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfmaniov1alpha1.BpfProgramList, error) { + progs := &bpfmaniov1alpha1.BpfProgramList{} for _, iface := range r.interfaces { bpfProgramName := fmt.Sprintf("%s-%s-%s", r.currentXdpProgram.Name, r.NodeName, iface) @@ -128,7 +128,7 @@ func (r *XdpProgramReconciler) expectedBpfPrograms(ctx context.Context) (*bpfdio func (r *XdpProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { // Initialize node and current program - r.currentXdpProgram = &bpfdiov1alpha1.XdpProgram{} + r.currentXdpProgram = &bpfmaniov1alpha1.XdpProgram{} r.ourNode = &v1.Node{} r.Logger = ctrl.Log.WithName("xdp") var err error @@ -136,13 +136,13 @@ func (r *XdpProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) ctxLogger := log.FromContext(ctx) ctxLogger.Info("Reconcile XDP: Enter", "ReconcileKey", req) - // Lookup K8s node object for this bpfd-agent This should always succeed + // Lookup K8s node object for this bpfman-agent This should always succeed if err := r.Get(ctx, types.NamespacedName{Namespace: v1.NamespaceAll, Name: r.NodeName}, r.ourNode); err != nil { - return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfd-agent node %s : %v", + return ctrl.Result{Requeue: false}, fmt.Errorf("failed getting bpfman-agent node %s : %v", req.NamespacedName, err) } - xdpPrograms := &bpfdiov1alpha1.XdpProgramList{} + xdpPrograms := &bpfmaniov1alpha1.XdpProgramList{} opts := []client.ListOption{} if err := r.List(ctx, xdpPrograms, opts...); err != nil { @@ -155,17 +155,17 @@ func (r *XdpProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) return ctrl.Result{Requeue: false}, nil } - // Get existing ebpf state from bpfd. - programMap, err := bpfdagentinternal.ListBpfdPrograms(ctx, r.BpfdClient, internal.Xdp) + // Get existing ebpf state from bpfman. + programMap, err := bpfmanagentinternal.ListBpfmanPrograms(ctx, r.BpfmanClient, internal.Xdp) if err != nil { - r.Logger.Error(err, "failed to list loaded bpfd programs") + r.Logger.Error(err, "failed to list loaded bpfman programs") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationAgent}, nil } r.Logger.V(1).Info("Existing XDP programs", "loaded-xdp-programs", programMap) // Reconcile each XdpProgram. Don't return error here because it will trigger an infinite reconcile loop, instead // report the error to user and retry if specified. For some errors the controller may not decide to retry. - // Note: This only results in grpc calls to bpfd if we need to change something + // Note: This only results in grpc calls to bpfman if we need to change something requeue := false // initialize requeue to false for _, xdpProgram := range xdpPrograms.Items { r.Logger.Info("XdpProgramController is reconciling", "currentXdpProgram", xdpProgram.Name) @@ -207,18 +207,18 @@ func (r *XdpProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) } func (r *XdpProgramReconciler) buildXdpLoadRequest( - bytecode *gobpfd.BytecodeLocation, + bytecode *gobpfman.BytecodeLocation, uuid string, iface string, - mapOwnerId *uint32) *gobpfd.LoadRequest { + mapOwnerId *uint32) *gobpfman.LoadRequest { - return &gobpfd.LoadRequest{ + return &gobpfman.LoadRequest{ Bytecode: bytecode, Name: r.currentXdpProgram.Spec.BpfFunctionName, ProgramType: uint32(internal.Xdp), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_XdpAttachInfo{ - XdpAttachInfo: &gobpfd.XDPAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_XdpAttachInfo{ + XdpAttachInfo: &gobpfman.XDPAttachInfo{ Priority: r.currentXdpProgram.Spec.Priority, Iface: iface, ProceedOn: xdpProceedOnToInt(r.currentXdpProgram.Spec.ProceedOn), @@ -231,15 +231,15 @@ func (r *XdpProgramReconciler) buildXdpLoadRequest( } } -// reconcileBpfdPrograms ONLY reconciles the bpfd state for a single BpfProgram. +// reconcileBpfmanPrograms ONLY reconciles the bpfman state for a single BpfProgram. // It does not interact with the k8s API in any way. -func (r *XdpProgramReconciler) reconcileBpfdProgram(ctx context.Context, - existingBpfPrograms map[string]*gobpfd.ListResponse_ListResult, - bytecodeSelector *bpfdiov1alpha1.BytecodeSelector, - bpfProgram *bpfdiov1alpha1.BpfProgram, +func (r *XdpProgramReconciler) reconcileBpfmanProgram(ctx context.Context, + existingBpfPrograms map[string]*gobpfman.ListResponse_ListResult, + bytecodeSelector *bpfmaniov1alpha1.BytecodeSelector, + bpfProgram *bpfmaniov1alpha1.BpfProgram, isNodeSelected bool, isBeingDeleted bool, - mapOwnerStatus *MapOwnerParamStatus) (bpfdiov1alpha1.BpfProgramConditionType, error) { + mapOwnerStatus *MapOwnerParamStatus) (bpfmaniov1alpha1.BpfProgramConditionType, error) { r.Logger.V(1).Info("Existing bpfProgram", "UUID", bpfProgram.UID, "Name", bpfProgram.Name, "CurrentXdpProgram", r.currentXdpProgram.Name) iface := bpfProgram.Annotations[internal.XdpProgramInterface] @@ -247,13 +247,13 @@ func (r *XdpProgramReconciler) reconcileBpfdProgram(ctx context.Context, var err error uuid := string(bpfProgram.UID) - getLoadRequest := func() (*gobpfd.LoadRequest, bpfdiov1alpha1.BpfProgramConditionType, error) { - bytecode, err := bpfdagentinternal.GetBytecode(r.Client, bytecodeSelector) + getLoadRequest := func() (*gobpfman.LoadRequest, bpfmaniov1alpha1.BpfProgramConditionType, error) { + bytecode, err := bpfmanagentinternal.GetBytecode(r.Client, bytecodeSelector) if err != nil { - return nil, bpfdiov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) + return nil, bpfmaniov1alpha1.BpfProgCondBytecodeSelectorError, fmt.Errorf("failed to process bytecode selector: %v", err) } loadRequest := r.buildXdpLoadRequest(bytecode, uuid, iface, mapOwnerStatus.mapOwnerId) - return loadRequest, bpfdiov1alpha1.BpfProgCondNone, nil + return loadRequest, bpfmaniov1alpha1.BpfProgCondNone, nil } existingProgram, doesProgramExist := existingBpfPrograms[uuid] @@ -262,22 +262,22 @@ func (r *XdpProgramReconciler) reconcileBpfdProgram(ctx context.Context, // If XdpProgram is being deleted just break out and remove finalizer if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } // Make sure if we're not selected just exit if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } // Make sure if the Map Owner is set but not found then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } // Make sure if the Map Owner is set but not loaded then just exit if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } // otherwise load it @@ -286,21 +286,21 @@ func (r *XdpProgramReconciler) reconcileBpfdProgram(ctx context.Context, return condition, err } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load XdpProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } - r.Logger.Info("bpfd called to load XdpProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) - return bpfdiov1alpha1.BpfProgCondLoaded, nil + r.Logger.Info("bpfman called to load XdpProgram on Node", "Name", bpfProgram.Name, "UUID", uuid) + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } // prog ID should already have been set - id, err := bpfdagentinternal.GetID(bpfProgram) + id, err := bpfmanagentinternal.GetID(bpfProgram) if err != nil { r.Logger.Error(err, "Failed to get program ID") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } // BpfProgram exists but either XdpProgram is being deleted, node is no @@ -311,27 +311,27 @@ func (r *XdpProgramReconciler) reconcileBpfdProgram(ctx context.Context, "isDeleted", isBeingDeleted, "isSelected", isNodeSelected, "mapIsSet", mapOwnerStatus.isSet, "mapIsFound", mapOwnerStatus.isFound, "mapIsLoaded", mapOwnerStatus.isLoaded) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload XdpProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.Logger.Info("bpfd called to unload XdpProgram on Node", "Name", bpfProgram.Name, "UUID", id) + r.Logger.Info("bpfman called to unload XdpProgram on Node", "Name", bpfProgram.Name, "UUID", id) if isBeingDeleted { - return bpfdiov1alpha1.BpfProgCondUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondUnloaded, nil } if !isNodeSelected { - return bpfdiov1alpha1.BpfProgCondNotSelected, nil + return bpfmaniov1alpha1.BpfProgCondNotSelected, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isFound { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotFound, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound, nil } if mapOwnerStatus.isSet && !mapOwnerStatus.isLoaded { - return bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded, nil } } @@ -341,27 +341,27 @@ func (r *XdpProgramReconciler) reconcileBpfdProgram(ctx context.Context, return condition, err } - isSame, reasons := bpfdagentinternal.DoesProgExist(existingProgram, loadRequest) + isSame, reasons := bpfmanagentinternal.DoesProgExist(existingProgram, loadRequest) if !isSame { r.Logger.V(1).Info("XdpProgram is in wrong state, unloading and reloading", "Reason", reasons) - if err := bpfdagentinternal.UnloadBpfdProgram(ctx, r.BpfdClient, *id); err != nil { + if err := bpfmanagentinternal.UnloadBpfmanProgram(ctx, r.BpfmanClient, *id); err != nil { r.Logger.Error(err, "Failed to unload XdpProgram") - return bpfdiov1alpha1.BpfProgCondNotUnloaded, nil + return bpfmaniov1alpha1.BpfProgCondNotUnloaded, nil } - r.progId, err = bpfdagentinternal.LoadBpfdProgram(ctx, r.BpfdClient, loadRequest) + r.progId, err = bpfmanagentinternal.LoadBpfmanProgram(ctx, r.BpfmanClient, loadRequest) if err != nil { r.Logger.Error(err, "Failed to load XdpProgram") - return bpfdiov1alpha1.BpfProgCondNotLoaded, nil + return bpfmaniov1alpha1.BpfProgCondNotLoaded, nil } - r.Logger.Info("bpfd called to reload XdpProgram on Node", "Name", bpfProgram.Name, "UUID", id) + r.Logger.Info("bpfman called to reload XdpProgram on Node", "Name", bpfProgram.Name, "UUID", id) } else { // Program exists and bpfProgram K8s Object is up to date - r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfd") + r.Logger.V(1).Info("Ignoring Object Change nothing to do in bpfman") r.progId = id } - return bpfdiov1alpha1.BpfProgCondLoaded, nil + return bpfmaniov1alpha1.BpfProgCondLoaded, nil } diff --git a/bpfd-operator/controllers/bpfd-agent/xdp-program_test.go b/bpfman-operator/controllers/bpfman-agent/xdp-program_test.go similarity index 76% rename from bpfd-operator/controllers/bpfd-agent/xdp-program_test.go rename to bpfman-operator/controllers/bpfman-agent/xdp-program_test.go index a1cbd598b..7e79597da 100644 --- a/bpfd-operator/controllers/bpfd-agent/xdp-program_test.go +++ b/bpfman-operator/controllers/bpfman-agent/xdp-program_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdagent +package bpfmanagent import ( "context" @@ -24,13 +24,13 @@ import ( "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/testing/protocmp" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdagentinternal "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal" - agenttestutils "github.com/bpfd-dev/bpfd/bpfd-operator/controllers/bpfd-agent/internal/test-utils" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanagentinternal "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal" + agenttestutils "github.com/bpfman/bpfman/bpfman-operator/controllers/bpfman-agent/internal/test-utils" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,7 +50,7 @@ import ( func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiCondition bool) { var ( name = "fakeXdpProgram" - namespace = "bpfd" + namespace = "bpfman" bytecodePath = "/tmp/hello.o" bpfFunctionName = "test" fakeNode = testutils.NewNode("fake-control-plane") @@ -59,8 +59,8 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio ctx = context.TODO() bpfProgName0 = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, fakeInt0) bpfProgName1 = fmt.Sprintf("%s-%s-%s", name, fakeNode.Name, fakeInt1) - bpfProgEth0 = &bpfdiov1alpha1.BpfProgram{} - bpfProgEth1 = &bpfdiov1alpha1.BpfProgram{} + bpfProgEth0 = &bpfmaniov1alpha1.BpfProgram{} + bpfProgEth1 = &bpfmaniov1alpha1.BpfProgram{} fakeUID0 = "ef71d42c-aa21-48e8-a697-82391d801a80" fakeUID1 = "ef71d42c-aa21-48e8-a697-82391d801a81" ) @@ -73,24 +73,24 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio } // A XdpProgram object with metadata and spec. - xdp := &bpfdiov1alpha1.XdpProgram{ + xdp := &bpfmaniov1alpha1.XdpProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.XdpProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.XdpProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, - InterfaceSelector: bpfdiov1alpha1.InterfaceSelector{ + InterfaceSelector: bpfmaniov1alpha1.InterfaceSelector{ Interfaces: &fakeInts, }, Priority: 0, - ProceedOn: []bpfdiov1alpha1.XdpProceedOnValue{bpfdiov1alpha1.XdpProceedOnValue("pass"), - bpfdiov1alpha1.XdpProceedOnValue("dispatcher_return"), + ProceedOn: []bpfmaniov1alpha1.XdpProceedOnValue{bpfmaniov1alpha1.XdpProceedOnValue("pass"), + bpfmaniov1alpha1.XdpProceedOnValue("dispatcher_return"), }, }, } @@ -100,21 +100,21 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, xdp) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.XdpProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, xdp) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.XdpProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() - cli := agenttestutils.NewBpfdClientFake() + cli := agenttestutils.NewBpfmanClientFake() rc := ReconcilerCommon{ - Client: cl, - Scheme: s, - BpfdClient: cli, - NodeName: fakeNode.Name, + Client: cl, + Scheme: s, + BpfmanClient: cli, + NodeName: fakeNode.Name, } // Set development Logger so we can see all logs in tests. @@ -159,7 +159,7 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio err = cl.Update(ctx, bpfProgEth0) require.NoError(t, err) - // Second reconcile should create the bpfd Load Requests for the first bpfProgram. + // Second reconcile should create the bpfman Load Requests for the first bpfProgram. res, err = r.Reconcile(ctx, req) if err != nil { t.Fatalf("reconcile: (%v)", err) @@ -170,17 +170,17 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio uuid0 := string(bpfProgEth0.UID) - expectedLoadReq0 := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq0 := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Xdp.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: uuid0, internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_XdpAttachInfo{ - XdpAttachInfo: &gobpfd.XDPAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_XdpAttachInfo{ + XdpAttachInfo: &gobpfman.XDPAttachInfo{ Priority: 0, Iface: fakeInts[0], ProceedOn: []int32{2, 31}, @@ -194,13 +194,13 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio require.NoError(t, err) // prog ID should already have been set - id0, err := bpfdagentinternal.GetID(bpfProgEth0) + id0, err := bpfmanagentinternal.GetID(bpfProgEth0) require.NoError(t, err) // Check the bpfLoadRequest was correctly built if !cmp.Equal(expectedLoadReq0, cli.LoadRequests[int(*id0)], protocmp.Transform()) { t.Logf("Diff %v", cmp.Diff(expectedLoadReq0, cli.LoadRequests[int(*id0)], protocmp.Transform())) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // NOTE: THIS IS A TEST FOR AN ERROR PATH. THERE SHOULD NEVER BE MORE THAN @@ -208,11 +208,11 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio if multiCondition { // Add some random conditions and verify that the condition still gets // updated correctly. - meta.SetStatusCondition(&bpfProgEth0.Status.Conditions, bpfdiov1alpha1.BpfProgCondBytecodeSelectorError.Condition()) + meta.SetStatusCondition(&bpfProgEth0.Status.Conditions, bpfmaniov1alpha1.BpfProgCondBytecodeSelectorError.Condition()) if err := r.Status().Update(ctx, bpfProgEth0); err != nil { r.Logger.V(1).Info("failed to set KprobeProgram object status") } - meta.SetStatusCondition(&bpfProgEth0.Status.Conditions, bpfdiov1alpha1.BpfProgCondNotSelected.Condition()) + meta.SetStatusCondition(&bpfProgEth0.Status.Conditions, bpfmaniov1alpha1.BpfProgCondNotSelected.Condition()) if err := r.Status().Update(ctx, bpfProgEth0); err != nil { r.Logger.V(1).Info("failed to set KprobeProgram object status") } @@ -237,7 +237,7 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio // Make sure we only have 1 condition now require.Equal(t, 1, len(bpfProgEth0.Status.Conditions)) // Make sure it's the right one. - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProgEth0.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProgEth0.Status.Conditions[0].Type) if multiInterface { // Fourth reconcile should create the second bpfProgram. @@ -290,17 +290,17 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio uuid1 := string(bpfProgEth1.UID) - expectedLoadReq1 := &gobpfd.LoadRequest{ - Bytecode: &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: bytecodePath}, + expectedLoadReq1 := &gobpfman.LoadRequest{ + Bytecode: &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: bytecodePath}, }, Name: bpfFunctionName, ProgramType: *internal.Xdp.Uint32(), Metadata: map[string]string{internal.UuidMetadataKey: uuid1, internal.ProgramNameKey: name}, MapOwnerId: nil, - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_XdpAttachInfo{ - XdpAttachInfo: &gobpfd.XDPAttachInfo{ + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_XdpAttachInfo{ + XdpAttachInfo: &gobpfman.XDPAttachInfo{ Priority: 0, Iface: fakeInts[1], ProceedOn: []int32{2, 31}, @@ -314,13 +314,13 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio require.NoError(t, err) // prog ID should already have been set - id1, err := bpfdagentinternal.GetID(bpfProgEth1) + id1, err := bpfmanagentinternal.GetID(bpfProgEth1) require.NoError(t, err) // Check the bpfLoadRequest was correctly built if !cmp.Equal(expectedLoadReq1, cli.LoadRequests[int(*id1)], protocmp.Transform()) { t.Logf("Diff %v", cmp.Diff(expectedLoadReq1, cli.LoadRequests[int(*id1)], protocmp.Transform())) - t.Fatal("Built bpfd LoadRequest does not match expected") + t.Fatal("Built bpfman LoadRequest does not match expected") } // Get program object @@ -331,7 +331,7 @@ func xdpProgramControllerCreate(t *testing.T, multiInterface bool, multiConditio // Make sure we only have 1 condition now require.Equal(t, 1, len(bpfProgEth1.Status.Conditions)) // Make sure it's the right one. - require.Equal(t, string(bpfdiov1alpha1.BpfProgCondLoaded), bpfProgEth1.Status.Conditions[0].Type) + require.Equal(t, string(bpfmaniov1alpha1.BpfProgCondLoaded), bpfProgEth1.Status.Conditions[0].Type) } } diff --git a/bpfd-operator/controllers/bpfd-operator/common.go b/bpfman-operator/controllers/bpfman-operator/common.go similarity index 76% rename from bpfd-operator/controllers/bpfd-operator/common.go rename to bpfman-operator/controllers/bpfman-operator/common.go index 1f570332c..d3a30ad4f 100644 --- a/bpfd-operator/controllers/bpfd-operator/common.go +++ b/bpfman-operator/controllers/bpfman-operator/common.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" @@ -32,13 +32,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - bpfdHelpers "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/helpers" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + bpfmanHelpers "github.com/bpfman/bpfman/bpfman-operator/pkg/helpers" "github.com/go-logr/logr" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=bpfprograms,verbs=get;list;watch +//+kubebuilder:rbac:groups=bpfman.io,resources=bpfprograms,verbs=get;list;watch //+kubebuilder:rbac:groups=core,resources=nodes,verbs=get;list;watch const ( @@ -52,12 +52,12 @@ type ReconcilerCommon struct { Logger logr.Logger } -// bpfdReconciler defines a k8s reconciler which can program bpfd. +// bpfmanReconciler defines a k8s reconciler which can program bpfman. type ProgramReconciler interface { getRecCommon() *ReconcilerCommon updateStatus(ctx context.Context, name string, - cond bpfdiov1alpha1.ProgramConditionType, + cond bpfmaniov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) getFinalizer() string } @@ -68,13 +68,13 @@ func reconcileBpfProgram(ctx context.Context, rec ProgramReconciler, prog client r.Logger.V(1).Info("Reconciling Program", "ProgramName", progName) - if !controllerutil.ContainsFinalizer(prog, internal.BpfdOperatorFinalizer) { - return r.addFinalizer(ctx, prog, internal.BpfdOperatorFinalizer) + if !controllerutil.ContainsFinalizer(prog, internal.BpfmanOperatorFinalizer) { + return r.addFinalizer(ctx, prog, internal.BpfmanOperatorFinalizer) } // reconcile Program Object on all other events // list all existing bpfProgram state for the given Program - bpfPrograms := &bpfdiov1alpha1.BpfProgramList{} + bpfPrograms := &bpfmaniov1alpha1.BpfProgramList{} // Only list bpfPrograms for this Program opts := []client.ListOption{client.MatchingLabels{internal.BpfProgramOwnerLabel: progName}} @@ -92,11 +92,11 @@ func reconcileBpfProgram(ctx context.Context, rec ProgramReconciler, prog client } // Return NotYetLoaded Status if - // BpfPrograms for each node haven't been created by bpfd-agent and the config isn't + // BpfPrograms for each node haven't been created by bpfman-agent and the config isn't // being deleted. if len(nodes.Items) != len(bpfPrograms.Items) && prog.GetDeletionTimestamp().IsZero() { // Causes Requeue - return rec.updateStatus(ctx, progName, bpfdiov1alpha1.ProgramNotYetLoaded, "") + return rec.updateStatus(ctx, progName, bpfmaniov1alpha1.ProgramNotYetLoaded, "") } failedBpfPrograms := []string{} @@ -108,32 +108,32 @@ func reconcileBpfProgram(ctx context.Context, rec ProgramReconciler, prog client finalApplied = append(finalApplied, bpfProgram.Name) } - if bpfdHelpers.IsBpfProgramConditionFailure(&bpfProgram.Status.Conditions) { + if bpfmanHelpers.IsBpfProgramConditionFailure(&bpfProgram.Status.Conditions) { failedBpfPrograms = append(failedBpfPrograms, bpfProgram.Name) } } if !prog.GetDeletionTimestamp().IsZero() { - // Only remove bpfd-operator finalizer if all bpfProgram Objects are ready to be pruned (i.e there are no + // Only remove bpfman-operator finalizer if all bpfProgram Objects are ready to be pruned (i.e there are no // bpfPrograms with a finalizer) if len(finalApplied) == 0 { // Causes Requeue - return r.removeFinalizer(ctx, prog, internal.BpfdOperatorFinalizer) + return r.removeFinalizer(ctx, prog, internal.BpfmanOperatorFinalizer) } // Causes Requeue - return rec.updateStatus(ctx, progName, bpfdiov1alpha1.ProgramDeleteError, fmt.Sprintf("Program Deletion failed on the following bpfProgram Objects: %v", + return rec.updateStatus(ctx, progName, bpfmaniov1alpha1.ProgramDeleteError, fmt.Sprintf("Program Deletion failed on the following bpfProgram Objects: %v", finalApplied)) } if len(failedBpfPrograms) != 0 { // Causes Requeue - return rec.updateStatus(ctx, progName, bpfdiov1alpha1.ProgramReconcileError, + return rec.updateStatus(ctx, progName, bpfmaniov1alpha1.ProgramReconcileError, fmt.Sprintf("bpfProgramReconciliation failed on the following bpfProgram Objects: %v", failedBpfPrograms)) } // Causes Requeue - return rec.updateStatus(ctx, progName, bpfdiov1alpha1.ProgramReconcileSuccess, "") + return rec.updateStatus(ctx, progName, bpfmaniov1alpha1.ProgramReconcileSuccess, "") } func (r *ReconcilerCommon) removeFinalizer(ctx context.Context, prog client.Object, finalizer string) (ctrl.Result, error) { @@ -151,11 +151,11 @@ func (r *ReconcilerCommon) removeFinalizer(ctx context.Context, prog client.Obje } func (r *ReconcilerCommon) addFinalizer(ctx context.Context, prog client.Object, finalizer string) (ctrl.Result, error) { - controllerutil.AddFinalizer(prog, internal.BpfdOperatorFinalizer) + controllerutil.AddFinalizer(prog, internal.BpfmanOperatorFinalizer) err := r.Update(ctx, prog) if err != nil { - r.Logger.V(1).Info("failed adding bpfd-operator finalizer to Program...requeuing") + r.Logger.V(1).Info("failed adding bpfman-operator finalizer to Program...requeuing") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil } @@ -172,8 +172,8 @@ func statusChangedPredicate() predicate.Funcs { return false }, UpdateFunc: func(e event.UpdateEvent) bool { - oldObject := e.ObjectOld.(*bpfdiov1alpha1.BpfProgram) - newObject := e.ObjectNew.(*bpfdiov1alpha1.BpfProgram) + oldObject := e.ObjectOld.(*bpfmaniov1alpha1.BpfProgram) + newObject := e.ObjectNew.(*bpfmaniov1alpha1.BpfProgram) return !reflect.DeepEqual(oldObject.Status, newObject.Status) }, DeleteFunc: func(e event.DeleteEvent) bool { @@ -182,7 +182,7 @@ func statusChangedPredicate() predicate.Funcs { } } -func (r *ReconcilerCommon) updateCondition(ctx context.Context, obj client.Object, conditions *[]metav1.Condition, cond bpfdiov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { +func (r *ReconcilerCommon) updateCondition(ctx context.Context, obj client.Object, conditions *[]metav1.Condition, cond bpfmaniov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { r.Logger.V(1).Info("updateCondition()", "existing conds", conditions, "new cond", cond) diff --git a/bpfman-operator/controllers/bpfman-operator/configmap.go b/bpfman-operator/controllers/bpfman-operator/configmap.go new file mode 100644 index 000000000..96f7bd61f --- /dev/null +++ b/bpfman-operator/controllers/bpfman-operator/configmap.go @@ -0,0 +1,266 @@ +/* +Copyright 2022. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package bpfmanoperator + +import ( + "context" + "io" + "os" + "reflect" + + appsv1 "k8s.io/api/apps/v1" + corev1 "k8s.io/api/core/v1" + storagev1 "k8s.io/api/storage/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/kubernetes/scheme" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/event" + "sigs.k8s.io/controller-runtime/pkg/predicate" + + "sigs.k8s.io/controller-runtime/pkg/builder" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" + "sigs.k8s.io/controller-runtime/pkg/log" + + "github.com/bpfman/bpfman/bpfman-operator/internal" +) + +// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create +// +kubebuilder:rbac:groups=storage.k8s.io,resources=csidrivers,verbs=get;list;watch;create;delete +// +kubebuilder:rbac:groups=bpfman.io,resources=configmaps/finalizers,verbs=update + +type BpfmanConfigReconciler struct { + ReconcilerCommon + BpfmanStandardDeployment string + CsiDriverDeployment string +} + +// SetupWithManager sets up the controller with the Manager. +func (r *BpfmanConfigReconciler) SetupWithManager(mgr ctrl.Manager) error { + return ctrl.NewControllerManagedBy(mgr). + // Watch the bpfman-daemon configmap to configure the bpfman deployment across the whole cluster + For(&corev1.ConfigMap{}, + builder.WithPredicates(bpfmanConfigPredicate())). + // This only watches the bpfman daemonset which is stored on disk and will be created + // by this operator. We're doing a manual watch since the operator (As a controller) + // doesn't really want to have an owner-ref since we don't have a CRD for + // configuring it, only a configmap. + Owns( + &appsv1.DaemonSet{}, + builder.WithPredicates(bpfmanDaemonPredicate())). + Complete(r) +} + +func (r *BpfmanConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + r.Logger = log.FromContext(ctx) + + bpfmanConfig := &corev1.ConfigMap{} + if err := r.Get(ctx, req.NamespacedName, bpfmanConfig); err != nil { + if !errors.IsNotFound(err) { + r.Logger.Error(err, "failed getting bpfman config", "ReconcileObject", req.NamespacedName) + return ctrl.Result{}, nil + } + } else { + if updated := controllerutil.AddFinalizer(bpfmanConfig, internal.BpfmanOperatorFinalizer); updated { + if err := r.Update(ctx, bpfmanConfig); err != nil { + r.Logger.Error(err, "failed adding bpfman-operator finalizer to bpfman config") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + } else { + return r.ReconcileBpfmanConfig(ctx, req, bpfmanConfig) + } + } + + return ctrl.Result{}, nil +} + +func (r *BpfmanConfigReconciler) ReconcileBpfmanConfig(ctx context.Context, req ctrl.Request, bpfmanConfig *corev1.ConfigMap) (ctrl.Result, error) { + bpfmanDeployment := &appsv1.DaemonSet{} + + staticBpfmanDeployment := LoadAndConfigureBpfmanDs(bpfmanConfig, r.BpfmanStandardDeployment) + r.Logger.V(1).Info("StaticBpfmanDeployment with CSI", "DS", staticBpfmanDeployment) + bpfmanCsiDriver := &storagev1.CSIDriver{} + // one-shot try to create bpfman's CSIDriver object if it doesn't exist, does not re-trigger reconcile. + if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: internal.BpfmanCsiDriverName}, bpfmanCsiDriver); err != nil { + if errors.IsNotFound(err) { + bpfmanCsiDriver = LoadCsiDriver(r.CsiDriverDeployment) + + r.Logger.Info("Creating Bpfman csi driver object") + if err := r.Create(ctx, bpfmanCsiDriver); err != nil { + r.Logger.Error(err, "Failed to create Bpfman csi driver") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + } + } + + if err := r.Get(ctx, types.NamespacedName{Namespace: bpfmanConfig.Namespace, Name: internal.BpfmanDsName}, bpfmanDeployment); err != nil { + if errors.IsNotFound(err) { + r.Logger.Info("Creating Bpfman Daemon") + // Causes Requeue + if err := r.Create(ctx, staticBpfmanDeployment); err != nil { + r.Logger.Error(err, "Failed to create Bpfman Daemon") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + return ctrl.Result{}, nil + } + + r.Logger.Error(err, "Failed to get bpfman daemon") + return ctrl.Result{}, nil + } + + if !bpfmanConfig.DeletionTimestamp.IsZero() { + r.Logger.Info("Deleting bpfman daemon and config") + controllerutil.RemoveFinalizer(bpfmanDeployment, internal.BpfmanOperatorFinalizer) + + err := r.Update(ctx, bpfmanDeployment) + if err != nil { + r.Logger.Error(err, "failed removing bpfman-operator finalizer from bpfmanDs") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + + bpfmanCsiDriver := &storagev1.CSIDriver{} + + // one-shot try to delete bpfman's CSIDriver object only if it exists. + if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: internal.BpfmanCsiDriverName}, bpfmanCsiDriver); err == nil { + r.Logger.Info("Deleting Bpfman csi driver object") + if err := r.Delete(ctx, bpfmanCsiDriver); err != nil { + r.Logger.Error(err, "Failed to delete Bpfman csi driver") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + } + + if err = r.Delete(ctx, bpfmanDeployment); err != nil { + r.Logger.Error(err, "failed deleting bpfman DS") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + + controllerutil.RemoveFinalizer(bpfmanConfig, internal.BpfmanOperatorFinalizer) + err = r.Update(ctx, bpfmanConfig) + if err != nil { + r.Logger.Error(err, "failed removing bpfman-operator finalizer from bpfman config") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + + return ctrl.Result{}, nil + } + + if !reflect.DeepEqual(staticBpfmanDeployment.Spec, bpfmanDeployment.Spec) { + r.Logger.Info("Reconciling bpfman") + + // Causes Requeue + if err := r.Update(ctx, staticBpfmanDeployment); err != nil { + r.Logger.Error(err, "failed reconciling bpfman deployment") + return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil + } + } + + return ctrl.Result{}, nil +} + +// Only reconcile on bpfman-daemon Daemonset events. +func bpfmanDaemonPredicate() predicate.Funcs { + return predicate.Funcs{ + GenericFunc: func(e event.GenericEvent) bool { + return e.Object.GetName() == internal.BpfmanDsName + }, + CreateFunc: func(e event.CreateEvent) bool { + return e.Object.GetName() == internal.BpfmanDsName + }, + UpdateFunc: func(e event.UpdateEvent) bool { + return e.ObjectNew.GetName() == internal.BpfmanDsName + }, + DeleteFunc: func(e event.DeleteEvent) bool { + return e.Object.GetName() == internal.BpfmanDsName + }, + } +} + +// Only reconcile on bpfman-config configmap events. +func bpfmanConfigPredicate() predicate.Funcs { + return predicate.Funcs{ + GenericFunc: func(e event.GenericEvent) bool { + return e.Object.GetName() == internal.BpfmanConfigName + }, + CreateFunc: func(e event.CreateEvent) bool { + return e.Object.GetName() == internal.BpfmanConfigName + }, + UpdateFunc: func(e event.UpdateEvent) bool { + return e.ObjectNew.GetName() == internal.BpfmanConfigName + }, + DeleteFunc: func(e event.DeleteEvent) bool { + return e.Object.GetName() == internal.BpfmanConfigName + }, + } +} + +func LoadCsiDriver(path string) *storagev1.CSIDriver { + // Load static bpfman deployment from disk + file, err := os.Open(path) + if err != nil { + panic(err) + } + + b, err := io.ReadAll(file) + if err != nil { + panic(err) + } + + decode := scheme.Codecs.UniversalDeserializer().Decode + obj, _, _ := decode(b, nil, nil) + + return obj.(*storagev1.CSIDriver) +} + +func LoadAndConfigureBpfmanDs(config *corev1.ConfigMap, path string) *appsv1.DaemonSet { + // Load static bpfman deployment from disk + file, err := os.Open(path) + if err != nil { + panic(err) + } + + b, err := io.ReadAll(file) + if err != nil { + panic(err) + } + + decode := scheme.Codecs.UniversalDeserializer().Decode + obj, _, _ := decode(b, nil, nil) + + staticBpfmanDeployment := obj.(*appsv1.DaemonSet) + + // Runtime Configurable fields + bpfmanImage := config.Data["bpfman.image"] + bpfmanAgentImage := config.Data["bpfman.agent.image"] + bpfmanLogLevel := config.Data["bpfman.log.level"] + bpfmanAgentLogLevel := config.Data["bpfman.agent.log.level"] + + // Annotate the log level on the ds so we get automatic restarts on changes. + if staticBpfmanDeployment.Spec.Template.ObjectMeta.Annotations == nil { + staticBpfmanDeployment.Spec.Template.ObjectMeta.Annotations = make(map[string]string) + } + + staticBpfmanDeployment.Spec.Template.ObjectMeta.Annotations["bpfman.io.bpfman.loglevel"] = bpfmanLogLevel + staticBpfmanDeployment.Spec.Template.ObjectMeta.Annotations["bpfman.io.bpfman.agent.loglevel"] = bpfmanAgentLogLevel + staticBpfmanDeployment.Name = "bpfman-daemon" + staticBpfmanDeployment.Namespace = config.Namespace + staticBpfmanDeployment.Spec.Template.Spec.Containers[0].Image = bpfmanImage + staticBpfmanDeployment.Spec.Template.Spec.Containers[1].Image = bpfmanAgentImage + controllerutil.AddFinalizer(staticBpfmanDeployment, internal.BpfmanOperatorFinalizer) + + return staticBpfmanDeployment +} diff --git a/bpfd-operator/controllers/bpfd-operator/configmap_test.go b/bpfman-operator/controllers/bpfman-operator/configmap_test.go similarity index 60% rename from bpfd-operator/controllers/bpfd-operator/configmap_test.go rename to bpfman-operator/controllers/bpfman-operator/configmap_test.go index 1bc2b5d3c..f43fbd888 100644 --- a/bpfd-operator/controllers/bpfd-operator/configmap_test.go +++ b/bpfman-operator/controllers/bpfman-operator/configmap_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" @@ -33,35 +33,35 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + "github.com/bpfman/bpfman/bpfman-operator/internal" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -func TestBpfdConfigReconcileAndDelete(t *testing.T) { +func TestBpfmanConfigReconcileAndDelete(t *testing.T) { var ( - name = "bpfd-config" - namespace = "bpfd" - staticDsPath = "../../config/bpfd-deployment/daemonset.yaml" - staticCsiPath = "../../config/bpfd-deployment/csidriverinfo.yaml" + name = "bpfman-config" + namespace = "bpfman" + staticDsPath = "../../config/bpfman-deployment/daemonset.yaml" + staticCsiPath = "../../config/bpfman-deployment/csidriverinfo.yaml" ctx = context.TODO() ) - // A configMap for bpfd with metadata and spec. - bpfdConfig := &corev1.ConfigMap{ + // A configMap for bpfman with metadata and spec. + bpfmanConfig := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, }, Data: map[string]string{ - "bpfd.agent.image": "BPFD_AGENT_IS_SCARY", - "bpfd.image": "FAKE-IMAGE", - "bpfd.agent.log.level": "FAKE", + "bpfman.agent.image": "BPFMAN_AGENT_IS_SCARY", + "bpfman.image": "FAKE-IMAGE", + "bpfman.agent.log.level": "FAKE", }, } // Objects to track in the fake client. - objs := []runtime.Object{bpfdConfig} + objs := []runtime.Object{bpfmanConfig} // Register operator types with the runtime scheme. s := scheme.Scheme @@ -77,14 +77,14 @@ func TestBpfdConfigReconcileAndDelete(t *testing.T) { Scheme: s, } - // The expected bpfd daemonset - expectedBpfdDs := LoadAndConfigureBpfdDs(bpfdConfig, staticDsPath) + // The expected bpfman daemonset + expectedBpfmanDs := LoadAndConfigureBpfmanDs(bpfmanConfig, staticDsPath) // Set development Logger so we can see all logs in tests. logf.SetLogger(zap.New(zap.UseFlagOptions(&zap.Options{Development: true}))) // Create a ReconcileMemcached object with the scheme and fake client. - r := &BpfdConfigReconciler{ReconcilerCommon: rc, BpfdStandardDeployment: staticDsPath, CsiDriverDeployment: staticCsiPath} + r := &BpfmanConfigReconciler{ReconcilerCommon: rc, BpfmanStandardDeployment: staticDsPath, CsiDriverDeployment: staticCsiPath} // Mock request to simulate Reconcile() being called on an event for a // watched resource . @@ -95,7 +95,7 @@ func TestBpfdConfigReconcileAndDelete(t *testing.T) { }, } - // First reconcile will add bpfd-operator finalizer to bpfd configmap + // First reconcile will add bpfman-operator finalizer to bpfman configmap res, err := r.Reconcile(ctx, req) if err != nil { t.Fatalf("reconcile: (%v)", err) @@ -105,13 +105,13 @@ func TestBpfdConfigReconcileAndDelete(t *testing.T) { require.False(t, res.Requeue) // Check the BpfProgram Object was created successfully - err = cl.Get(ctx, types.NamespacedName{Name: bpfdConfig.Name, Namespace: namespace}, bpfdConfig) + err = cl.Get(ctx, types.NamespacedName{Name: bpfmanConfig.Name, Namespace: namespace}, bpfmanConfig) require.NoError(t, err) - // Check the bpfd-operator finalizer was successfully added - require.Contains(t, bpfdConfig.GetFinalizers(), internal.BpfdOperatorFinalizer) + // Check the bpfman-operator finalizer was successfully added + require.Contains(t, bpfmanConfig.GetFinalizers(), internal.BpfmanOperatorFinalizer) - // Second reconcile will create bpfd daemonset + // Second reconcile will create bpfman daemonset res, err = r.Reconcile(ctx, req) if err != nil { t.Fatalf("reconcile: (%v)", err) @@ -120,20 +120,20 @@ func TestBpfdConfigReconcileAndDelete(t *testing.T) { // Require no requeue require.False(t, res.Requeue) - // Check the bpfd daemonset was created successfully - actualBpfdDs := &appsv1.DaemonSet{} + // Check the bpfman daemonset was created successfully + actualBpfmanDs := &appsv1.DaemonSet{} - err = cl.Get(ctx, types.NamespacedName{Name: expectedBpfdDs.Name, Namespace: namespace}, actualBpfdDs) + err = cl.Get(ctx, types.NamespacedName{Name: expectedBpfmanDs.Name, Namespace: namespace}, actualBpfmanDs) require.NoError(t, err) - // Check the bpfd daemonset was created with the correct configuration. - require.True(t, reflect.DeepEqual(actualBpfdDs.Spec, expectedBpfdDs.Spec)) + // Check the bpfman daemonset was created with the correct configuration. + require.True(t, reflect.DeepEqual(actualBpfmanDs.Spec, expectedBpfmanDs.Spec)) - // Delete the bpfd configmap - err = cl.Delete(ctx, bpfdConfig) + // Delete the bpfman configmap + err = cl.Delete(ctx, bpfmanConfig) require.NoError(t, err) - // Third reconcile will delete bpfd daemonset + // Third reconcile will delete bpfman daemonset res, err = r.Reconcile(ctx, req) if err != nil { t.Fatalf("reconcile: (%v)", err) @@ -142,9 +142,9 @@ func TestBpfdConfigReconcileAndDelete(t *testing.T) { // Require no requeue require.False(t, res.Requeue) - err = cl.Get(ctx, types.NamespacedName{Name: expectedBpfdDs.Name, Namespace: namespace}, actualBpfdDs) + err = cl.Get(ctx, types.NamespacedName{Name: expectedBpfmanDs.Name, Namespace: namespace}, actualBpfmanDs) require.True(t, errors.IsNotFound(err)) - err = cl.Get(ctx, types.NamespacedName{Name: bpfdConfig.Name, Namespace: namespace}, bpfdConfig) + err = cl.Get(ctx, types.NamespacedName{Name: bpfmanConfig.Name, Namespace: namespace}, bpfmanConfig) require.True(t, errors.IsNotFound(err)) } diff --git a/bpfd-operator/controllers/bpfd-operator/kprobe-program.go b/bpfman-operator/controllers/bpfman-operator/kprobe-program.go similarity index 82% rename from bpfd-operator/controllers/bpfd-operator/kprobe-program.go rename to bpfman-operator/controllers/bpfman-operator/kprobe-program.go index 387eb86f1..6ca509308 100644 --- a/bpfd-operator/controllers/bpfd-operator/kprobe-program.go +++ b/bpfman-operator/controllers/bpfman-operator/kprobe-program.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" @@ -29,13 +29,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/internal" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=kprobeprograms,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=bpfd.dev,resources=kprobeprograms/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=bpfd.dev,resources=kprobeprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=kprobeprograms,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=bpfman.io,resources=kprobeprograms/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=bpfman.io,resources=kprobeprograms/finalizers,verbs=update type KprobeProgramReconciler struct { ReconcilerCommon @@ -52,10 +52,10 @@ func (r *KprobeProgramReconciler) getFinalizer() string { // SetupWithManager sets up the controller with the Manager. func (r *KprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.KprobeProgram{}). + For(&bpfmaniov1alpha1.KprobeProgram{}). // Watch bpfPrograms which are owned by KprobePrograms Watches( - &source.Kind{Type: &bpfdiov1alpha1.BpfProgram{}}, + &source.Kind{Type: &bpfmaniov1alpha1.BpfProgram{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(predicate.And(statusChangedPredicate(), internal.BpfProgramTypePredicate(internal.Kprobe.String()))), ). @@ -65,11 +65,11 @@ func (r *KprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { func (r *KprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { r.Logger = log.FromContext(ctx) - kprobeProgram := &bpfdiov1alpha1.KprobeProgram{} + kprobeProgram := &bpfmaniov1alpha1.KprobeProgram{} if err := r.Get(ctx, req.NamespacedName, kprobeProgram); err != nil { // Reconcile was triggered by bpfProgram event, get parent KprobeProgram Object. if errors.IsNotFound(err) { - bpfProgram := &bpfdiov1alpha1.BpfProgram{} + bpfProgram := &bpfmaniov1alpha1.BpfProgram{} if err := r.Get(ctx, req.NamespacedName, bpfProgram); err != nil { if errors.IsNotFound(err) { r.Logger.V(1).Info("bpfProgram not found stale reconcile, exiting", "Name", req.NamespacedName) @@ -103,10 +103,10 @@ func (r *KprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Reques return reconcileBpfProgram(ctx, r, kprobeProgram) } -func (r *KprobeProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfdiov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { +func (r *KprobeProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfmaniov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { // Sometimes we end up with a stale KprobeProgram due to races, do this // get to ensure we're up to date before attempting a status update. - prog := &bpfdiov1alpha1.KprobeProgram{} + prog := &bpfmaniov1alpha1.KprobeProgram{} if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: name}, prog); err != nil { r.Logger.V(1).Info("failed to get fresh KprobeProgram object...requeuing") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil diff --git a/bpfd-operator/controllers/bpfd-operator/kprobe-program_test.go b/bpfman-operator/controllers/bpfman-operator/kprobe-program_test.go similarity index 76% rename from bpfd-operator/controllers/bpfd-operator/kprobe-program_test.go rename to bpfman-operator/controllers/bpfman-operator/kprobe-program_test.go index e40b68a40..fb8d148e0 100644 --- a/bpfd-operator/controllers/bpfd-operator/kprobe-program_test.go +++ b/bpfman-operator/controllers/bpfman-operator/kprobe-program_test.go @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" "fmt" "testing" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" "github.com/stretchr/testify/require" meta "k8s.io/apimachinery/pkg/api/meta" @@ -53,15 +53,15 @@ func kprobeProgramReconcile(t *testing.T, multiCondition bool) { bpfProgName = fmt.Sprintf("%s-%s", name, fakeNode.Name) ) // A KprobeProgram object with metadata and spec. - Kprobe := &bpfdiov1alpha1.KprobeProgram{ + Kprobe := &bpfmaniov1alpha1.KprobeProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.KprobeProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.KprobeProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, @@ -72,7 +72,7 @@ func kprobeProgramReconcile(t *testing.T, multiCondition bool) { } // The expected accompanying BpfProgram object - expectedBpfProg := &bpfdiov1alpha1.BpfProgram{ + expectedBpfProg := &bpfmaniov1alpha1.BpfProgram{ ObjectMeta: metav1.ObjectMeta{ Name: bpfProgName, OwnerReferences: []metav1.OwnerReference{ @@ -84,11 +84,11 @@ func kprobeProgramReconcile(t *testing.T, multiCondition bool) { Labels: map[string]string{internal.BpfProgramOwnerLabel: Kprobe.Name, internal.K8sHostLabel: fakeNode.Name}, Finalizers: []string{internal.KprobeProgramControllerFinalizer}, }, - Spec: bpfdiov1alpha1.BpfProgramSpec{ + Spec: bpfmaniov1alpha1.BpfProgramSpec{ Type: "kprobe", }, - Status: bpfdiov1alpha1.BpfProgramStatus{ - Conditions: []metav1.Condition{bpfdiov1alpha1.BpfProgCondLoaded.Condition()}, + Status: bpfmaniov1alpha1.BpfProgramStatus{ + Conditions: []metav1.Condition{bpfmaniov1alpha1.BpfProgCondLoaded.Condition()}, }, } @@ -97,10 +97,10 @@ func kprobeProgramReconcile(t *testing.T, multiCondition bool) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, Kprobe) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TcProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, Kprobe) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TcProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() @@ -137,19 +137,19 @@ func kprobeProgramReconcile(t *testing.T, multiCondition bool) { err = cl.Get(ctx, types.NamespacedName{Name: Kprobe.Name, Namespace: metav1.NamespaceAll}, Kprobe) require.NoError(t, err) - // Check the bpfd-operator finalizer was successfully added - require.Contains(t, Kprobe.GetFinalizers(), internal.BpfdOperatorFinalizer) + // Check the bpfman-operator finalizer was successfully added + require.Contains(t, Kprobe.GetFinalizers(), internal.BpfmanOperatorFinalizer) // NOTE: THIS IS A TEST FOR AN ERROR PATH. THERE SHOULD NEVER BE MORE THAN // ONE CONDITION. if multiCondition { // Add some random conditions and verify that the condition still gets // updated correctly. - meta.SetStatusCondition(&Kprobe.Status.Conditions, bpfdiov1alpha1.ProgramDeleteError.Condition("bogus condition #1")) + meta.SetStatusCondition(&Kprobe.Status.Conditions, bpfmaniov1alpha1.ProgramDeleteError.Condition("bogus condition #1")) if err := r.Status().Update(ctx, Kprobe); err != nil { r.Logger.V(1).Info("failed to set KprobeProgram object status") } - meta.SetStatusCondition(&Kprobe.Status.Conditions, bpfdiov1alpha1.ProgramReconcileError.Condition("bogus condition #2")) + meta.SetStatusCondition(&Kprobe.Status.Conditions, bpfmaniov1alpha1.ProgramReconcileError.Condition("bogus condition #2")) if err := r.Status().Update(ctx, Kprobe); err != nil { r.Logger.V(1).Info("failed to set KprobeProgram object status") } @@ -173,7 +173,7 @@ func kprobeProgramReconcile(t *testing.T, multiCondition bool) { // Make sure we only have 1 condition now require.Equal(t, 1, len(Kprobe.Status.Conditions)) // Make sure it's the right one. - require.Equal(t, Kprobe.Status.Conditions[0].Type, string(bpfdiov1alpha1.ProgramReconcileSuccess)) + require.Equal(t, Kprobe.Status.Conditions[0].Type, string(bpfmaniov1alpha1.ProgramReconcileSuccess)) } func TestKprobeProgramReconcile(t *testing.T) { diff --git a/bpfd-operator/controllers/bpfd-operator/tc-program.go b/bpfman-operator/controllers/bpfman-operator/tc-program.go similarity index 83% rename from bpfd-operator/controllers/bpfd-operator/tc-program.go rename to bpfman-operator/controllers/bpfman-operator/tc-program.go index d9f34c48b..596b73e3f 100644 --- a/bpfd-operator/controllers/bpfd-operator/tc-program.go +++ b/bpfman-operator/controllers/bpfman-operator/tc-program.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" @@ -29,8 +29,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/internal" ) type TcProgramReconciler struct { @@ -48,28 +48,28 @@ func (r *TcProgramReconciler) getFinalizer() string { // SetupWithManager sets up the controller with the Manager. func (r *TcProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.TcProgram{}). + For(&bpfmaniov1alpha1.TcProgram{}). // Watch bpfPrograms which are owned by TcPrograms Watches( - &source.Kind{Type: &bpfdiov1alpha1.BpfProgram{}}, + &source.Kind{Type: &bpfmaniov1alpha1.BpfProgram{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(predicate.And(statusChangedPredicate(), internal.BpfProgramTypePredicate(internal.Tc.String()))), ). Complete(r) } -//+kubebuilder:rbac:groups=bpfd.dev,resources=tcprograms,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=bpfd.dev,resources=tcprograms/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=bpfd.dev,resources=tcprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=tcprograms,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=bpfman.io,resources=tcprograms/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=bpfman.io,resources=tcprograms/finalizers,verbs=update func (r *TcProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { r.Logger = log.FromContext(ctx) - tcProgram := &bpfdiov1alpha1.TcProgram{} + tcProgram := &bpfmaniov1alpha1.TcProgram{} if err := r.Get(ctx, req.NamespacedName, tcProgram); err != nil { // list all TcProgram objects with if errors.IsNotFound(err) { - bpfProgram := &bpfdiov1alpha1.BpfProgram{} + bpfProgram := &bpfmaniov1alpha1.BpfProgram{} if err := r.Get(ctx, req.NamespacedName, bpfProgram); err != nil { if errors.IsNotFound(err) { r.Logger.V(1).Info("bpfProgram not found stale reconcile, exiting", "Name", req.NamespacedName) @@ -103,10 +103,10 @@ func (r *TcProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( return reconcileBpfProgram(ctx, r, tcProgram) } -func (r *TcProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfdiov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { +func (r *TcProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfmaniov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { // Sometimes we end up with a stale TcProgram due to races, do this // get to ensure we're up to date before attempting a finalizer removal. - prog := &bpfdiov1alpha1.TcProgram{} + prog := &bpfmaniov1alpha1.TcProgram{} if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: name}, prog); err != nil { r.Logger.V(1).Info("failed to get fresh TcProgram object...requeuing") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil diff --git a/bpfd-operator/controllers/bpfd-operator/tc-program_test.go b/bpfman-operator/controllers/bpfman-operator/tc-program_test.go similarity index 72% rename from bpfd-operator/controllers/bpfd-operator/tc-program_test.go rename to bpfman-operator/controllers/bpfman-operator/tc-program_test.go index 02b3626bf..40db88162 100644 --- a/bpfd-operator/controllers/bpfd-operator/tc-program_test.go +++ b/bpfman-operator/controllers/bpfman-operator/tc-program_test.go @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" "fmt" "testing" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,32 +50,32 @@ func TestTcProgramReconcile(t *testing.T) { ) // A TcProgram object with metadata and spec. - tc := &bpfdiov1alpha1.TcProgram{ + tc := &bpfmaniov1alpha1.TcProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.TcProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.TcProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, - InterfaceSelector: bpfdiov1alpha1.InterfaceSelector{ + InterfaceSelector: bpfmaniov1alpha1.InterfaceSelector{ Interfaces: &[]string{fakeInt}, }, Priority: 0, Direction: direction, - ProceedOn: []bpfdiov1alpha1.TcProceedOnValue{ - bpfdiov1alpha1.TcProceedOnValue("pipe"), - bpfdiov1alpha1.TcProceedOnValue("dispatcher_return"), + ProceedOn: []bpfmaniov1alpha1.TcProceedOnValue{ + bpfmaniov1alpha1.TcProceedOnValue("pipe"), + bpfmaniov1alpha1.TcProceedOnValue("dispatcher_return"), }, }, } // The expected accompanying BpfProgram object - expectedBpfProg := &bpfdiov1alpha1.BpfProgram{ + expectedBpfProg := &bpfmaniov1alpha1.BpfProgram{ ObjectMeta: metav1.ObjectMeta{ Name: bpfProgName, OwnerReferences: []metav1.OwnerReference{ @@ -87,11 +87,11 @@ func TestTcProgramReconcile(t *testing.T) { Labels: map[string]string{internal.BpfProgramOwnerLabel: tc.Name, internal.K8sHostLabel: fakeNode.Name}, Finalizers: []string{internal.TcProgramControllerFinalizer}, }, - Spec: bpfdiov1alpha1.BpfProgramSpec{ + Spec: bpfmaniov1alpha1.BpfProgramSpec{ Type: "tc", }, - Status: bpfdiov1alpha1.BpfProgramStatus{ - Conditions: []metav1.Condition{bpfdiov1alpha1.BpfProgCondLoaded.Condition()}, + Status: bpfmaniov1alpha1.BpfProgramStatus{ + Conditions: []metav1.Condition{bpfmaniov1alpha1.BpfProgCondLoaded.Condition()}, }, } @@ -100,10 +100,10 @@ func TestTcProgramReconcile(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, tc) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TcProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, tc) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TcProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() @@ -140,8 +140,8 @@ func TestTcProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: tc.Name, Namespace: metav1.NamespaceAll}, tc) require.NoError(t, err) - // Check the bpfd-operator finalizer was successfully added - require.Contains(t, tc.GetFinalizers(), internal.BpfdOperatorFinalizer) + // Check the bpfman-operator finalizer was successfully added + require.Contains(t, tc.GetFinalizers(), internal.BpfmanOperatorFinalizer) // Second reconcile should check bpfProgram Status and write Success condition to tcProgram Status res, err = r.Reconcile(ctx, req) @@ -156,6 +156,6 @@ func TestTcProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: tc.Name, Namespace: metav1.NamespaceAll}, tc) require.NoError(t, err) - require.Equal(t, tc.Status.Conditions[0].Type, string(bpfdiov1alpha1.ProgramReconcileSuccess)) + require.Equal(t, tc.Status.Conditions[0].Type, string(bpfmaniov1alpha1.ProgramReconcileSuccess)) } diff --git a/bpfd-operator/controllers/bpfd-operator/tracepoint-program.go b/bpfman-operator/controllers/bpfman-operator/tracepoint-program.go similarity index 82% rename from bpfd-operator/controllers/bpfd-operator/tracepoint-program.go rename to bpfman-operator/controllers/bpfman-operator/tracepoint-program.go index 99ad9dbd8..eaaf175b0 100644 --- a/bpfd-operator/controllers/bpfd-operator/tracepoint-program.go +++ b/bpfman-operator/controllers/bpfman-operator/tracepoint-program.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" @@ -29,13 +29,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/internal" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=tracepointprograms,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=bpfd.dev,resources=tracepointprograms/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=bpfd.dev,resources=tracepointprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=tracepointprograms,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=bpfman.io,resources=tracepointprograms/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=bpfman.io,resources=tracepointprograms/finalizers,verbs=update type TracepointProgramReconciler struct { ReconcilerCommon @@ -52,10 +52,10 @@ func (r *TracepointProgramReconciler) getFinalizer() string { // SetupWithManager sets up the controller with the Manager. func (r *TracepointProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.TracepointProgram{}). + For(&bpfmaniov1alpha1.TracepointProgram{}). // Watch bpfPrograms which are owned by TracepointPrograms Watches( - &source.Kind{Type: &bpfdiov1alpha1.BpfProgram{}}, + &source.Kind{Type: &bpfmaniov1alpha1.BpfProgram{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(predicate.And(statusChangedPredicate(), internal.BpfProgramTypePredicate(internal.Tracepoint.String()))), ). @@ -65,11 +65,11 @@ func (r *TracepointProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { func (r *TracepointProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { r.Logger = log.FromContext(ctx) - tracepointProgram := &bpfdiov1alpha1.TracepointProgram{} + tracepointProgram := &bpfmaniov1alpha1.TracepointProgram{} if err := r.Get(ctx, req.NamespacedName, tracepointProgram); err != nil { // list all TracepointProgram objects with if errors.IsNotFound(err) { - bpfProgram := &bpfdiov1alpha1.BpfProgram{} + bpfProgram := &bpfmaniov1alpha1.BpfProgram{} if err := r.Get(ctx, req.NamespacedName, bpfProgram); err != nil { if errors.IsNotFound(err) { r.Logger.V(1).Info("bpfProgram not found stale reconcile, exiting", "Name", req.NamespacedName) @@ -103,10 +103,10 @@ func (r *TracepointProgramReconciler) Reconcile(ctx context.Context, req ctrl.Re return reconcileBpfProgram(ctx, r, tracepointProgram) } -func (r *TracepointProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfdiov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { +func (r *TracepointProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfmaniov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { // Sometimes we end up with a stale TracepointProgram due to races, do this // get to ensure we're up to date before attempting a finalizer removal. - prog := &bpfdiov1alpha1.TracepointProgram{} + prog := &bpfmaniov1alpha1.TracepointProgram{} if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: name}, prog); err != nil { r.Logger.V(1).Info("failed to get fresh Tracepoint object...requeuing") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil diff --git a/bpfd-operator/controllers/bpfd-operator/tracepoint-program_test.go b/bpfman-operator/controllers/bpfman-operator/tracepoint-program_test.go similarity index 76% rename from bpfd-operator/controllers/bpfd-operator/tracepoint-program_test.go rename to bpfman-operator/controllers/bpfman-operator/tracepoint-program_test.go index 211dd8188..103a8e369 100644 --- a/bpfd-operator/controllers/bpfd-operator/tracepoint-program_test.go +++ b/bpfman-operator/controllers/bpfman-operator/tracepoint-program_test.go @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" "fmt" "testing" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -48,15 +48,15 @@ func TestTracepointProgramReconcile(t *testing.T) { bpfProgName = fmt.Sprintf("%s-%s", name, fakeNode.Name) ) // A TracepointProgram object with metadata and spec. - Tracepoint := &bpfdiov1alpha1.TracepointProgram{ + Tracepoint := &bpfmaniov1alpha1.TracepointProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.TracepointProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.TracepointProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, @@ -65,7 +65,7 @@ func TestTracepointProgramReconcile(t *testing.T) { } // The expected accompanying BpfProgram object - expectedBpfProg := &bpfdiov1alpha1.BpfProgram{ + expectedBpfProg := &bpfmaniov1alpha1.BpfProgram{ ObjectMeta: metav1.ObjectMeta{ Name: bpfProgName, OwnerReferences: []metav1.OwnerReference{ @@ -77,11 +77,11 @@ func TestTracepointProgramReconcile(t *testing.T) { Labels: map[string]string{internal.BpfProgramOwnerLabel: Tracepoint.Name, internal.K8sHostLabel: fakeNode.Name}, Finalizers: []string{internal.TracepointProgramControllerFinalizer}, }, - Spec: bpfdiov1alpha1.BpfProgramSpec{ + Spec: bpfmaniov1alpha1.BpfProgramSpec{ Type: "tracepoint", }, - Status: bpfdiov1alpha1.BpfProgramStatus{ - Conditions: []metav1.Condition{bpfdiov1alpha1.BpfProgCondLoaded.Condition()}, + Status: bpfmaniov1alpha1.BpfProgramStatus{ + Conditions: []metav1.Condition{bpfmaniov1alpha1.BpfProgCondLoaded.Condition()}, }, } @@ -90,10 +90,10 @@ func TestTracepointProgramReconcile(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, Tracepoint) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TcProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, Tracepoint) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TcProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() @@ -130,8 +130,8 @@ func TestTracepointProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: Tracepoint.Name, Namespace: metav1.NamespaceAll}, Tracepoint) require.NoError(t, err) - // Check the bpfd-operator finalizer was successfully added - require.Contains(t, Tracepoint.GetFinalizers(), internal.BpfdOperatorFinalizer) + // Check the bpfman-operator finalizer was successfully added + require.Contains(t, Tracepoint.GetFinalizers(), internal.BpfmanOperatorFinalizer) // Second reconcile should check bpfProgram Status and write Success condition to tcProgram Status res, err = r.Reconcile(ctx, req) @@ -146,6 +146,6 @@ func TestTracepointProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: Tracepoint.Name, Namespace: metav1.NamespaceAll}, Tracepoint) require.NoError(t, err) - require.Equal(t, Tracepoint.Status.Conditions[0].Type, string(bpfdiov1alpha1.ProgramReconcileSuccess)) + require.Equal(t, Tracepoint.Status.Conditions[0].Type, string(bpfmaniov1alpha1.ProgramReconcileSuccess)) } diff --git a/bpfd-operator/controllers/bpfd-operator/uprobe-program.go b/bpfman-operator/controllers/bpfman-operator/uprobe-program.go similarity index 82% rename from bpfd-operator/controllers/bpfd-operator/uprobe-program.go rename to bpfman-operator/controllers/bpfman-operator/uprobe-program.go index 46bfda040..57d708c88 100644 --- a/bpfd-operator/controllers/bpfd-operator/uprobe-program.go +++ b/bpfman-operator/controllers/bpfman-operator/uprobe-program.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" @@ -29,13 +29,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/internal" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=uprobeprograms,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=bpfd.dev,resources=uprobeprograms/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=bpfd.dev,resources=uprobeprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=uprobeprograms,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=bpfman.io,resources=uprobeprograms/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=bpfman.io,resources=uprobeprograms/finalizers,verbs=update type UprobeProgramReconciler struct { ReconcilerCommon @@ -52,10 +52,10 @@ func (r *UprobeProgramReconciler) getFinalizer() string { // SetupWithManager sets up the controller with the Manager. func (r *UprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.UprobeProgram{}). + For(&bpfmaniov1alpha1.UprobeProgram{}). // Watch bpfPrograms which are owned by UprobePrograms Watches( - &source.Kind{Type: &bpfdiov1alpha1.BpfProgram{}}, + &source.Kind{Type: &bpfmaniov1alpha1.BpfProgram{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(predicate.And(statusChangedPredicate(), internal.BpfProgramTypePredicate(internal.UprobeString))), ). @@ -65,11 +65,11 @@ func (r *UprobeProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { func (r *UprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { r.Logger = log.FromContext(ctx) - uprobeProgram := &bpfdiov1alpha1.UprobeProgram{} + uprobeProgram := &bpfmaniov1alpha1.UprobeProgram{} if err := r.Get(ctx, req.NamespacedName, uprobeProgram); err != nil { // Reconcile was triggered by bpfProgram event, get parent UprobeProgram Object. if errors.IsNotFound(err) { - bpfProgram := &bpfdiov1alpha1.BpfProgram{} + bpfProgram := &bpfmaniov1alpha1.BpfProgram{} if err := r.Get(ctx, req.NamespacedName, bpfProgram); err != nil { if errors.IsNotFound(err) { r.Logger.V(1).Info("bpfProgram not found stale reconcile, exiting", "Name", req.NamespacedName) @@ -103,10 +103,10 @@ func (r *UprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Reques return reconcileBpfProgram(ctx, r, uprobeProgram) } -func (r *UprobeProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfdiov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { +func (r *UprobeProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfmaniov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { // Sometimes we end up with a stale UprobeProgram due to races, do this // get to ensure we're up to date before attempting a status update. - prog := &bpfdiov1alpha1.UprobeProgram{} + prog := &bpfmaniov1alpha1.UprobeProgram{} if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: name}, prog); err != nil { r.Logger.V(1).Info("failed to get fresh UprobeProgram object...requeuing") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil diff --git a/bpfd-operator/controllers/bpfd-operator/uprobe-program_test.go b/bpfman-operator/controllers/bpfman-operator/uprobe-program_test.go similarity index 75% rename from bpfd-operator/controllers/bpfd-operator/uprobe-program_test.go rename to bpfman-operator/controllers/bpfman-operator/uprobe-program_test.go index 3f9fd157d..2161c80e3 100644 --- a/bpfd-operator/controllers/bpfd-operator/uprobe-program_test.go +++ b/bpfman-operator/controllers/bpfman-operator/uprobe-program_test.go @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" "fmt" "testing" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -51,15 +51,15 @@ func TestUprobeProgramReconcile(t *testing.T) { bpfProgName = fmt.Sprintf("%s-%s", name, fakeNode.Name) ) // A UprobeProgram object with metadata and spec. - Uprobe := &bpfdiov1alpha1.UprobeProgram{ + Uprobe := &bpfmaniov1alpha1.UprobeProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.UprobeProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.UprobeProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, @@ -71,7 +71,7 @@ func TestUprobeProgramReconcile(t *testing.T) { } // The expected accompanying BpfProgram object - expectedBpfProg := &bpfdiov1alpha1.BpfProgram{ + expectedBpfProg := &bpfmaniov1alpha1.BpfProgram{ ObjectMeta: metav1.ObjectMeta{ Name: bpfProgName, OwnerReferences: []metav1.OwnerReference{ @@ -83,11 +83,11 @@ func TestUprobeProgramReconcile(t *testing.T) { Labels: map[string]string{internal.BpfProgramOwnerLabel: Uprobe.Name, internal.K8sHostLabel: fakeNode.Name}, Finalizers: []string{internal.UprobeProgramControllerFinalizer}, }, - Spec: bpfdiov1alpha1.BpfProgramSpec{ + Spec: bpfmaniov1alpha1.BpfProgramSpec{ Type: "uprobe", }, - Status: bpfdiov1alpha1.BpfProgramStatus{ - Conditions: []metav1.Condition{bpfdiov1alpha1.BpfProgCondLoaded.Condition()}, + Status: bpfmaniov1alpha1.BpfProgramStatus{ + Conditions: []metav1.Condition{bpfmaniov1alpha1.BpfProgCondLoaded.Condition()}, }, } @@ -96,10 +96,10 @@ func TestUprobeProgramReconcile(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, Uprobe) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TcProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, Uprobe) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TcProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() @@ -136,8 +136,8 @@ func TestUprobeProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: Uprobe.Name, Namespace: metav1.NamespaceAll}, Uprobe) require.NoError(t, err) - // Check the bpfd-operator finalizer was successfully added - require.Contains(t, Uprobe.GetFinalizers(), internal.BpfdOperatorFinalizer) + // Check the bpfman-operator finalizer was successfully added + require.Contains(t, Uprobe.GetFinalizers(), internal.BpfmanOperatorFinalizer) // Second reconcile should check bpfProgram Status and write Success condition to tcProgram Status res, err = r.Reconcile(ctx, req) @@ -152,6 +152,6 @@ func TestUprobeProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: Uprobe.Name, Namespace: metav1.NamespaceAll}, Uprobe) require.NoError(t, err) - require.Equal(t, Uprobe.Status.Conditions[0].Type, string(bpfdiov1alpha1.ProgramReconcileSuccess)) + require.Equal(t, Uprobe.Status.Conditions[0].Type, string(bpfmaniov1alpha1.ProgramReconcileSuccess)) } diff --git a/bpfd-operator/controllers/bpfd-operator/xdp-program.go b/bpfman-operator/controllers/bpfman-operator/xdp-program.go similarity index 83% rename from bpfd-operator/controllers/bpfd-operator/xdp-program.go rename to bpfman-operator/controllers/bpfman-operator/xdp-program.go index b599c301b..57433b3cb 100644 --- a/bpfd-operator/controllers/bpfd-operator/xdp-program.go +++ b/bpfman-operator/controllers/bpfman-operator/xdp-program.go @@ -11,7 +11,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" @@ -29,13 +29,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/internal" ) -//+kubebuilder:rbac:groups=bpfd.dev,resources=xdpprograms,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=bpfd.dev,resources=xdpprograms/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=bpfd.dev,resources=xdpprograms/finalizers,verbs=update +//+kubebuilder:rbac:groups=bpfman.io,resources=xdpprograms,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=bpfman.io,resources=xdpprograms/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=bpfman.io,resources=xdpprograms/finalizers,verbs=update type XdpProgramReconciler struct { ReconcilerCommon @@ -52,10 +52,10 @@ func (r *XdpProgramReconciler) getFinalizer() string { // SetupWithManager sets up the controller with the Manager. func (r *XdpProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). - For(&bpfdiov1alpha1.XdpProgram{}). + For(&bpfmaniov1alpha1.XdpProgram{}). // Watch bpfPrograms which are owned by XdpPrograms Watches( - &source.Kind{Type: &bpfdiov1alpha1.BpfProgram{}}, + &source.Kind{Type: &bpfmaniov1alpha1.BpfProgram{}}, &handler.EnqueueRequestForObject{}, builder.WithPredicates(predicate.And(statusChangedPredicate(), internal.BpfProgramTypePredicate(internal.Xdp.String()))), ). @@ -65,13 +65,13 @@ func (r *XdpProgramReconciler) SetupWithManager(mgr ctrl.Manager) error { func (r *XdpProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { r.Logger = log.FromContext(ctx) - xdpProgram := &bpfdiov1alpha1.XdpProgram{} + xdpProgram := &bpfmaniov1alpha1.XdpProgram{} if err := r.Get(ctx, req.NamespacedName, xdpProgram); err != nil { // list all XdpProgram objects with if errors.IsNotFound(err) { // TODO(astoycos) we could simplify this logic by making the name of the // generated bpfProgram object a bit more deterministic - bpfProgram := &bpfdiov1alpha1.BpfProgram{} + bpfProgram := &bpfmaniov1alpha1.BpfProgram{} if err := r.Get(ctx, req.NamespacedName, bpfProgram); err != nil { if errors.IsNotFound(err) { r.Logger.V(1).Info("bpfProgram not found stale reconcile, exiting", "Name", req.NamespacedName) @@ -105,10 +105,10 @@ func (r *XdpProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) return reconcileBpfProgram(ctx, r, xdpProgram) } -func (r *XdpProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfdiov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { +func (r *XdpProgramReconciler) updateStatus(ctx context.Context, name string, cond bpfmaniov1alpha1.ProgramConditionType, message string) (ctrl.Result, error) { // Sometimes we end up with a stale XdpProgram due to races, do this // get to ensure we're up to date before attempting a finalizer removal. - prog := &bpfdiov1alpha1.XdpProgram{} + prog := &bpfmaniov1alpha1.XdpProgram{} if err := r.Get(ctx, types.NamespacedName{Namespace: corev1.NamespaceAll, Name: name}, prog); err != nil { r.Logger.V(1).Error(err, "failed to get fresh XdpProgram object...requeuing") return ctrl.Result{Requeue: true, RequeueAfter: retryDurationOperator}, nil diff --git a/bpfd-operator/controllers/bpfd-operator/xdp-program_test.go b/bpfman-operator/controllers/bpfman-operator/xdp-program_test.go similarity index 72% rename from bpfd-operator/controllers/bpfd-operator/xdp-program_test.go rename to bpfman-operator/controllers/bpfman-operator/xdp-program_test.go index dde54d340..9d1c6671f 100644 --- a/bpfd-operator/controllers/bpfd-operator/xdp-program_test.go +++ b/bpfman-operator/controllers/bpfman-operator/xdp-program_test.go @@ -14,16 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -package bpfdoperator +package bpfmanoperator import ( "context" "fmt" "testing" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - internal "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - testutils "github.com/bpfd-dev/bpfd/bpfd-operator/internal/test-utils" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + internal "github.com/bpfman/bpfman/bpfman-operator/internal" + testutils "github.com/bpfman/bpfman/bpfman-operator/internal/test-utils" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -48,30 +48,30 @@ func TestXdpProgramReconcile(t *testing.T) { bpfProgName = fmt.Sprintf("%s-%s", name, fakeNode.Name) ) // A XdpProgram object with metadata and spec. - Xdp := &bpfdiov1alpha1.XdpProgram{ + Xdp := &bpfmaniov1alpha1.XdpProgram{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: bpfdiov1alpha1.XdpProgramSpec{ - BpfProgramCommon: bpfdiov1alpha1.BpfProgramCommon{ + Spec: bpfmaniov1alpha1.XdpProgramSpec{ + BpfProgramCommon: bpfmaniov1alpha1.BpfProgramCommon{ BpfFunctionName: bpfFunctionName, NodeSelector: metav1.LabelSelector{}, - ByteCode: bpfdiov1alpha1.BytecodeSelector{ + ByteCode: bpfmaniov1alpha1.BytecodeSelector{ Path: &bytecodePath, }, }, - InterfaceSelector: bpfdiov1alpha1.InterfaceSelector{ + InterfaceSelector: bpfmaniov1alpha1.InterfaceSelector{ Interfaces: &[]string{fakeInt}, }, Priority: 0, - ProceedOn: []bpfdiov1alpha1.XdpProceedOnValue{bpfdiov1alpha1.XdpProceedOnValue("pass"), - bpfdiov1alpha1.XdpProceedOnValue("dispatcher_return"), + ProceedOn: []bpfmaniov1alpha1.XdpProceedOnValue{bpfmaniov1alpha1.XdpProceedOnValue("pass"), + bpfmaniov1alpha1.XdpProceedOnValue("dispatcher_return"), }, }, } // The expected accompanying BpfProgram object - expectedBpfProg := &bpfdiov1alpha1.BpfProgram{ + expectedBpfProg := &bpfmaniov1alpha1.BpfProgram{ ObjectMeta: metav1.ObjectMeta{ Name: bpfProgName, OwnerReferences: []metav1.OwnerReference{ @@ -83,11 +83,11 @@ func TestXdpProgramReconcile(t *testing.T) { Labels: map[string]string{internal.BpfProgramOwnerLabel: Xdp.Name, internal.K8sHostLabel: fakeNode.Name}, Finalizers: []string{internal.TcProgramControllerFinalizer}, }, - Spec: bpfdiov1alpha1.BpfProgramSpec{ + Spec: bpfmaniov1alpha1.BpfProgramSpec{ Type: "tc", }, - Status: bpfdiov1alpha1.BpfProgramStatus{ - Conditions: []metav1.Condition{bpfdiov1alpha1.BpfProgCondLoaded.Condition()}, + Status: bpfmaniov1alpha1.BpfProgramStatus{ + Conditions: []metav1.Condition{bpfmaniov1alpha1.BpfProgCondLoaded.Condition()}, }, } @@ -96,10 +96,10 @@ func TestXdpProgramReconcile(t *testing.T) { // Register operator types with the runtime scheme. s := scheme.Scheme - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, Xdp) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.TcProgramList{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgram{}) - s.AddKnownTypes(bpfdiov1alpha1.SchemeGroupVersion, &bpfdiov1alpha1.BpfProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, Xdp) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.TcProgramList{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgram{}) + s.AddKnownTypes(bpfmaniov1alpha1.SchemeGroupVersion, &bpfmaniov1alpha1.BpfProgramList{}) // Create a fake client to mock API calls. cl := fake.NewClientBuilder().WithRuntimeObjects(objs...).Build() @@ -136,8 +136,8 @@ func TestXdpProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: Xdp.Name, Namespace: metav1.NamespaceAll}, Xdp) require.NoError(t, err) - // Check the bpfd-operator finalizer was successfully added - require.Contains(t, Xdp.GetFinalizers(), internal.BpfdOperatorFinalizer) + // Check the bpfman-operator finalizer was successfully added + require.Contains(t, Xdp.GetFinalizers(), internal.BpfmanOperatorFinalizer) // Second reconcile should check bpfProgram Status and write Success condition to tcProgram Status res, err = r.Reconcile(ctx, req) @@ -152,6 +152,6 @@ func TestXdpProgramReconcile(t *testing.T) { err = cl.Get(ctx, types.NamespacedName{Name: Xdp.Name, Namespace: metav1.NamespaceAll}, Xdp) require.NoError(t, err) - require.Equal(t, Xdp.Status.Conditions[0].Type, string(bpfdiov1alpha1.ProgramReconcileSuccess)) + require.Equal(t, Xdp.Status.Conditions[0].Type, string(bpfmaniov1alpha1.ProgramReconcileSuccess)) } diff --git a/bpfd-operator/hack/api-docs/config.json b/bpfman-operator/hack/api-docs/config.json similarity index 100% rename from bpfd-operator/hack/api-docs/config.json rename to bpfman-operator/hack/api-docs/config.json diff --git a/bpfd-operator/hack/api-docs/generate.sh b/bpfman-operator/hack/api-docs/generate.sh similarity index 95% rename from bpfd-operator/hack/api-docs/generate.sh rename to bpfman-operator/hack/api-docs/generate.sh index bce20cee5..946bb1ba7 100755 --- a/bpfd-operator/hack/api-docs/generate.sh +++ b/bpfman-operator/hack/api-docs/generate.sh @@ -49,5 +49,5 @@ fi gendoc::build gendoc::exec \ - -api-dir "github.com/bpfd-dev/bpfd/bpfd-operator/apis/" \ + -api-dir "github.com/bpfman/bpfman/bpfman-operator/apis/" \ -out-file "${1}" diff --git a/bpfd-operator/hack/api-docs/members.tpl b/bpfman-operator/hack/api-docs/members.tpl similarity index 100% rename from bpfd-operator/hack/api-docs/members.tpl rename to bpfman-operator/hack/api-docs/members.tpl diff --git a/bpfd-operator/hack/api-docs/pkg.tpl b/bpfman-operator/hack/api-docs/pkg.tpl similarity index 100% rename from bpfd-operator/hack/api-docs/pkg.tpl rename to bpfman-operator/hack/api-docs/pkg.tpl diff --git a/bpfd-operator/hack/api-docs/type.tpl b/bpfman-operator/hack/api-docs/type.tpl similarity index 100% rename from bpfd-operator/hack/api-docs/type.tpl rename to bpfman-operator/hack/api-docs/type.tpl diff --git a/bpfd-operator/hack/boilerplate.go.txt b/bpfman-operator/hack/boilerplate.go.txt similarity index 93% rename from bpfd-operator/hack/boilerplate.go.txt rename to bpfman-operator/hack/boilerplate.go.txt index a36e2d5ec..81fbe23bb 100644 --- a/bpfd-operator/hack/boilerplate.go.txt +++ b/bpfman-operator/hack/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -12,4 +12,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -*/ \ No newline at end of file +*/ diff --git a/bpfd-operator/hack/boilerplate.sh.txt b/bpfman-operator/hack/boilerplate.sh.txt similarity index 100% rename from bpfd-operator/hack/boilerplate.sh.txt rename to bpfman-operator/hack/boilerplate.sh.txt diff --git a/bpfd-operator/hack/build-release-yamls.sh b/bpfman-operator/hack/build-release-yamls.sh similarity index 63% rename from bpfd-operator/hack/build-release-yamls.sh rename to bpfman-operator/hack/build-release-yamls.sh index 2c8978802..35d9fb5b5 100755 --- a/bpfd-operator/hack/build-release-yamls.sh +++ b/bpfman-operator/hack/build-release-yamls.sh @@ -30,37 +30,37 @@ KUSTOMIZE=${LOCALBIN}/kustomize # Generate all install yaml's -## 1. bpfd CRD install +## 1. bpfman CRD install # Make clean files with boilerplate -cat hack/boilerplate.sh.txt > release/bpfd-crds-install-v${VERSION}.yaml -sed -i "s/YEAR/$thisyear/g" release/bpfd-crds-install-v${VERSION}.yaml -cat << EOF >> release/bpfd-crds-install-v${VERSION}.yaml +cat hack/boilerplate.sh.txt > release/bpfman-crds-install-v${VERSION}.yaml +sed -i "s/YEAR/$thisyear/g" release/bpfman-crds-install-v${VERSION}.yaml +cat << EOF >> release/bpfman-crds-install-v${VERSION}.yaml # -# bpfd Kubernetes API install +# bpfman Kubernetes API install # EOF -for file in `ls config/crd/bases/bpfd*.yaml` +for file in `ls config/crd/bases/bpfman*.yaml` do - echo "---" >> release/bpfd-crds-install-v${VERSION}.yaml - echo "#" >> release/bpfd-crds-install-v${VERSION}.yaml - echo "# $file" >> release/bpfd-crds-install-v${VERSION}.yaml - echo "#" >> release/bpfd-crds-install-v${VERSION}.yaml - cat $file >> release/bpfd-crds-install-v${VERSION}.yaml + echo "---" >> release/bpfman-crds-install-v${VERSION}.yaml + echo "#" >> release/bpfman-crds-install-v${VERSION}.yaml + echo "# $file" >> release/bpfman-crds-install-v${VERSION}.yaml + echo "#" >> release/bpfman-crds-install-v${VERSION}.yaml + cat $file >> release/bpfman-crds-install-v${VERSION}.yaml done -echo "Generated:" release/bpfd-crds-install-v${VERSION}.yaml +echo "Generated:" release/bpfman-crds-install-v${VERSION}.yaml -## 2. bpfd-operator install yaml +## 2. bpfman-operator install yaml -$(cd ./config/bpfd-operator-deployment && ${KUSTOMIZE} edit set image quay.io/bpfd/bpfd-operator=quay.io/bpfd/bpfd-operator:v${VERSION}) -${KUSTOMIZE} build ./config/default > release/bpfd-operator-install-v${VERSION}.yaml +$(cd ./config/bpfman-operator-deployment && ${KUSTOMIZE} edit set image quay.io/bpfman/bpfman-operator=quay.io/bpfman/bpfman-operator:v${VERSION}) +${KUSTOMIZE} build ./config/default > release/bpfman-operator-install-v${VERSION}.yaml ### replace configmap :latest images with :v${VERSION} -sed -i "s/quay.io\/bpfd\/bpfd-agent:latest/quay.io\/bpfd\/bpfd-agent:v${VERSION}/g" release/bpfd-operator-install-v${VERSION}.yaml -sed -i "s/quay.io\/bpfd\/bpfd:latest/quay.io\/bpfd\/bpfd:v${VERSION}/g" release/bpfd-operator-install-v${VERSION}.yaml +sed -i "s/quay.io\/bpfman\/bpfman-agent:latest/quay.io\/bpfman\/bpfman-agent:v${VERSION}/g" release/bpfman-operator-install-v${VERSION}.yaml +sed -i "s/quay.io\/bpfman\/bpfman:latest/quay.io\/bpfman\/bpfman:v${VERSION}/g" release/bpfman-operator-install-v${VERSION}.yaml -echo "Generated:" release/bpfd-operator-install-v${VERSION}.yaml +echo "Generated:" release/bpfman-operator-install-v${VERSION}.yaml ## 3. examples install yamls diff --git a/bpfd-operator/hack/kind-config.yaml b/bpfman-operator/hack/kind-config.yaml similarity index 100% rename from bpfd-operator/hack/kind-config.yaml rename to bpfman-operator/hack/kind-config.yaml diff --git a/bpfd-operator/hack/kubectl-bpfprogramconfigs b/bpfman-operator/hack/kubectl-bpfprogramconfigs similarity index 100% rename from bpfd-operator/hack/kubectl-bpfprogramconfigs rename to bpfman-operator/hack/kubectl-bpfprogramconfigs diff --git a/bpfd-operator/hack/kubectl-bpfprograms b/bpfman-operator/hack/kubectl-bpfprograms similarity index 100% rename from bpfd-operator/hack/kubectl-bpfprograms rename to bpfman-operator/hack/kubectl-bpfprograms diff --git a/bpfd-operator/hack/ocp-scc-hacks.yaml b/bpfman-operator/hack/ocp-scc-hacks.yaml similarity index 68% rename from bpfd-operator/hack/ocp-scc-hacks.yaml rename to bpfman-operator/hack/ocp-scc-hacks.yaml index 8dfbcc4fb..85fc8e95c 100644 --- a/bpfd-operator/hack/ocp-scc-hacks.yaml +++ b/bpfman-operator/hack/ocp-scc-hacks.yaml @@ -10,9 +10,9 @@ # pod-security.kubernetes.io/warn: privileged # annotations: # openshift.io/node-selector: "" -# openshift.io/description: "Openshift bpfd components" +# openshift.io/description: "Openshift bpfman components" # workload.openshift.io/allowed: "management" -# name: openshift-bpfd +# name: openshift-bpfman # --- # apiVersion: rbac.authorization.k8s.io/v1 # kind: ClusterRoleBinding @@ -24,16 +24,16 @@ # name: system:openshift:scc:privileged # subjects: # - kind: ServiceAccount -# name: bpfd-daemon -# namespace: openshift-bpfd +# name: bpfman-daemon +# namespace: openshift-bpfman --- apiVersion: cert-manager.io/v1 kind: Certificate metadata: - name: bpfd-agent-cert - namespace: openshift-bpfd + name: bpfman-agent-cert + namespace: openshift-bpfman spec: - commonName: bpfd-agent + commonName: bpfman-agent dnsNames: - localhost ipAddresses: @@ -41,34 +41,34 @@ spec: issuerRef: group: cert-manager.io kind: Issuer - name: bpfd-cert-issuer + name: bpfman-cert-issuer privateKey: algorithm: RSA - secretName: bpfd-agent-cert-secret + secretName: bpfman-agent-cert-secret --- apiVersion: cert-manager.io/v1 kind: Certificate metadata: - name: bpfd-ca - namespace: openshift-bpfd + name: bpfman-ca + namespace: openshift-bpfman spec: - commonName: bpfd-ca + commonName: bpfman-ca isCA: true issuerRef: group: cert-manager.io kind: ClusterIssuer - name: bpfd-cert-cluster-issuer + name: bpfman-cert-cluster-issuer privateKey: algorithm: RSA - secretName: bpfd-ca + secretName: bpfman-ca --- apiVersion: cert-manager.io/v1 kind: Certificate metadata: - name: bpfd-cert - namespace: openshift-bpfd + name: bpfman-cert + namespace: openshift-bpfman spec: - commonName: bpfd + commonName: bpfman dnsNames: - localhost ipAddresses: @@ -76,24 +76,24 @@ spec: issuerRef: group: cert-manager.io kind: Issuer - name: bpfd-cert-issuer + name: bpfman-cert-issuer privateKey: algorithm: RSA - secretName: bpfd-cert-secret + secretName: bpfman-cert-secret --- apiVersion: cert-manager.io/v1 kind: ClusterIssuer metadata: - name: bpfd-cert-cluster-issuer - namespace: openshift-bpfd + name: bpfman-cert-cluster-issuer + namespace: openshift-bpfman spec: selfSigned: {} --- apiVersion: cert-manager.io/v1 kind: Issuer metadata: - name: bpfd-cert-issuer - namespace: openshift-bpfd + name: bpfman-cert-issuer + namespace: openshift-bpfman spec: ca: - secretName: bpfd-ca + secretName: bpfman-ca diff --git a/bpfd-operator/hack/tools.go b/bpfman-operator/hack/tools.go similarity index 100% rename from bpfd-operator/hack/tools.go rename to bpfman-operator/hack/tools.go diff --git a/bpfd-operator/hack/verify-codegen.sh b/bpfman-operator/hack/verify-codegen.sh similarity index 94% rename from bpfd-operator/hack/verify-codegen.sh rename to bpfman-operator/hack/verify-codegen.sh index a4e259359..d6034245a 100755 --- a/bpfd-operator/hack/verify-codegen.sh +++ b/bpfman-operator/hack/verify-codegen.sh @@ -16,7 +16,7 @@ # This script is used to determine if all of the generated code has been updated # correctly before merging into the main branch. It can be run locally for testing -# and is run automatically in bpfd's github actions. +# and is run automatically in bpfman's github actions. set -o errexit set -o nounset set -o pipefail diff --git a/bpfd-operator/internal/conn/conn.go b/bpfman-operator/internal/conn/conn.go similarity index 96% rename from bpfd-operator/internal/conn/conn.go rename to bpfman-operator/internal/conn/conn.go index 3cb6a34dc..2737e815e 100644 --- a/bpfd-operator/internal/conn/conn.go +++ b/bpfman-operator/internal/conn/conn.go @@ -22,14 +22,14 @@ import ( "io" "os" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" + "github.com/bpfman/bpfman/bpfman-operator/internal" toml "github.com/pelletier/go-toml" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ctrl "sigs.k8s.io/controller-runtime" ) -var log = ctrl.Log.WithName("bpfd-conn") +var log = ctrl.Log.WithName("bpfman-conn") type Endpoint struct { Type string `toml:"type"` diff --git a/bpfd-operator/internal/constants.go b/bpfman-operator/internal/constants.go similarity index 75% rename from bpfd-operator/internal/constants.go rename to bpfman-operator/internal/constants.go index 0a7b6dd5e..90953b824 100644 --- a/bpfd-operator/internal/constants.go +++ b/bpfman-operator/internal/constants.go @@ -19,28 +19,28 @@ package internal import "fmt" const ( - XdpProgramInterface = "bpfd.dev.xdpprogramcontroller/interface" - TcProgramInterface = "bpfd.dev.tcprogramcontroller/interface" - TracepointProgramTracepoint = "bpfd.dev.tracepointprogramcontroller/tracepoint" - KprobeProgramFunction = "bpfd.dev.kprobeprogramcontroller/function" - UprobeProgramTarget = "bpfd.dev.uprobeprogramcontroller/target" - BpfProgramOwnerLabel = "bpfd.dev/ownedByProgram" + XdpProgramInterface = "bpfman.io.xdpprogramcontroller/interface" + TcProgramInterface = "bpfman.io.tcprogramcontroller/interface" + TracepointProgramTracepoint = "bpfman.io.tracepointprogramcontroller/tracepoint" + KprobeProgramFunction = "bpfman.io.kprobeprogramcontroller/function" + UprobeProgramTarget = "bpfman.io.uprobeprogramcontroller/target" + BpfProgramOwnerLabel = "bpfman.io/ownedByProgram" K8sHostLabel = "kubernetes.io/hostname" - DiscoveredLabel = "bpfd.dev/discoveredProgram" - IdAnnotation = "bpfd.dev/ProgramId" - UuidMetadataKey = "bpfd.dev/uuid" - ProgramNameKey = "bpfd.dev/ProgramName" - BpfdNs = "bpfd" - BpfdOperatorName = "bpfd-operator" - BpfdDsName = "bpfd-daemon" - BpfdConfigName = "bpfd-config" - BpfdCsiDriverName = "csi.bpfd.dev" - BpfdDaemonManifestPath = "./config/bpfd-deployment/daemonset.yaml" - BpfdCsiDriverPath = "./config/bpfd-deployment/csidriverinfo.yaml" - BpfdMapFs = "/run/bpfd/fs/maps" - DefaultConfigPath = "/etc/bpfd/bpfd.toml" + DiscoveredLabel = "bpfman.io/discoveredProgram" + IdAnnotation = "bpfman.io/ProgramId" + UuidMetadataKey = "bpfman.io/uuid" + ProgramNameKey = "bpfman.io/ProgramName" + BpfmanNs = "bpfman" + BpfmanOperatorName = "bpfman-operator" + BpfmanDsName = "bpfman-daemon" + BpfmanConfigName = "bpfman-config" + BpfmanCsiDriverName = "csi.bpfman.io" + BpfmanDaemonManifestPath = "./config/bpfman-deployment/daemonset.yaml" + BpfmanCsiDriverPath = "./config/bpfman-deployment/csidriverinfo.yaml" + BpfmanMapFs = "/run/bpfman/fs/maps" + DefaultConfigPath = "/etc/bpfman/bpfman.toml" DefaultType = "tcp" - DefaultPath = "/run/bpfd/bpfd.sock" + DefaultPath = "/run/bpfman/bpfman.sock" DefaultPort = 50051 DefaultEnabled = true ) @@ -50,24 +50,24 @@ const ( // ----------------------------------------------------------------------------- const ( - // BpfdOperatorFinalizer is the finalizer that holds a *Program from + // BpfmanOperatorFinalizer is the finalizer that holds a *Program from // deletion until cleanup can be performed. - BpfdOperatorFinalizer = "bpfd.dev.operator/finalizer" + BpfmanOperatorFinalizer = "bpfman.io.operator/finalizer" // XdpProgramControllerFinalizer is the finalizer that holds an Xdp BpfProgram // object from deletion until cleanup can be performed. - XdpProgramControllerFinalizer = "bpfd.dev.xdpprogramcontroller/finalizer" + XdpProgramControllerFinalizer = "bpfman.io.xdpprogramcontroller/finalizer" // TcProgramControllerFinalizer is the finalizer that holds an Tc BpfProgram // object from deletion until cleanup can be performed. - TcProgramControllerFinalizer = "bpfd.dev.tcprogramcontroller/finalizer" + TcProgramControllerFinalizer = "bpfman.io.tcprogramcontroller/finalizer" // TracepointProgramControllerFinalizer is the finalizer that holds an Tracepoint // BpfProgram object from deletion until cleanup can be performed. - TracepointProgramControllerFinalizer = "bpfd.dev.tracepointprogramcontroller/finalizer" + TracepointProgramControllerFinalizer = "bpfman.io.tracepointprogramcontroller/finalizer" // KprobeProgramControllerFinalizer is the finalizer that holds a Kprobe // BpfProgram object from deletion until cleanup can be performed. - KprobeProgramControllerFinalizer = "bpfd.dev.kprobeprogramcontroller/finalizer" + KprobeProgramControllerFinalizer = "bpfman.io.kprobeprogramcontroller/finalizer" // KprobeProgramControllerFinalizer is the finalizer that holds a Uprobe // BpfProgram object from deletion until cleanup can be performed. - UprobeProgramControllerFinalizer = "bpfd.dev.uprobeprogramcontroller/finalizer" + UprobeProgramControllerFinalizer = "bpfman.io.uprobeprogramcontroller/finalizer" ) // Must match the kernel's `bpf_prog_type` enum. diff --git a/bpfd-operator/internal/k8s.go b/bpfman-operator/internal/k8s.go similarity index 85% rename from bpfd-operator/internal/k8s.go rename to bpfman-operator/internal/k8s.go index c59c6a22c..db46b6fd7 100644 --- a/bpfd-operator/internal/k8s.go +++ b/bpfman-operator/internal/k8s.go @@ -22,23 +22,23 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" ) // Only reconcile if a bpfprogram has been created for the controller's program type. func BpfProgramTypePredicate(kind string) predicate.Funcs { return predicate.Funcs{ GenericFunc: func(e event.GenericEvent) bool { - return e.Object.(*bpfdiov1alpha1.BpfProgram).Spec.Type == kind + return e.Object.(*bpfmaniov1alpha1.BpfProgram).Spec.Type == kind }, CreateFunc: func(e event.CreateEvent) bool { - return e.Object.(*bpfdiov1alpha1.BpfProgram).Spec.Type == kind + return e.Object.(*bpfmaniov1alpha1.BpfProgram).Spec.Type == kind }, UpdateFunc: func(e event.UpdateEvent) bool { - return e.ObjectNew.(*bpfdiov1alpha1.BpfProgram).Spec.Type == kind + return e.ObjectNew.(*bpfmaniov1alpha1.BpfProgram).Spec.Type == kind }, DeleteFunc: func(e event.DeleteEvent) bool { - return e.Object.(*bpfdiov1alpha1.BpfProgram).Spec.Type == kind + return e.Object.(*bpfmaniov1alpha1.BpfProgram).Spec.Type == kind }, } } @@ -92,8 +92,8 @@ func StatusChangedPredicate() predicate.Funcs { return false }, UpdateFunc: func(e event.UpdateEvent) bool { - oldObject := e.ObjectOld.(*bpfdiov1alpha1.BpfProgram) - newObject := e.ObjectNew.(*bpfdiov1alpha1.BpfProgram) + oldObject := e.ObjectOld.(*bpfmaniov1alpha1.BpfProgram) + newObject := e.ObjectNew.(*bpfmaniov1alpha1.BpfProgram) return !reflect.DeepEqual(oldObject.Status, newObject.Status) }, DeleteFunc: func(e event.DeleteEvent) bool { diff --git a/bpfd-operator/internal/test-utils/helpers.go b/bpfman-operator/internal/test-utils/helpers.go similarity index 100% rename from bpfd-operator/internal/test-utils/helpers.go rename to bpfman-operator/internal/test-utils/helpers.go diff --git a/bpfd-operator/pkg/client/clientset/versioned/clientset.go b/bpfman-operator/pkg/client/clientset/versioned/clientset.go similarity index 85% rename from bpfd-operator/pkg/client/clientset/versioned/clientset.go rename to bpfman-operator/pkg/client/clientset/versioned/clientset.go index aa8045139..e20c15d71 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/clientset.go +++ b/bpfman-operator/pkg/client/clientset/versioned/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import ( "fmt" "net/http" - bpfdv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1" + bpfmanv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -29,18 +29,18 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - BpfdV1alpha1() bpfdv1alpha1.BpfdV1alpha1Interface + BpfmanV1alpha1() bpfmanv1alpha1.BpfmanV1alpha1Interface } // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient - bpfdV1alpha1 *bpfdv1alpha1.BpfdV1alpha1Client + bpfmanV1alpha1 *bpfmanv1alpha1.BpfmanV1alpha1Client } -// BpfdV1alpha1 retrieves the BpfdV1alpha1Client -func (c *Clientset) BpfdV1alpha1() bpfdv1alpha1.BpfdV1alpha1Interface { - return c.bpfdV1alpha1 +// BpfmanV1alpha1 retrieves the BpfmanV1alpha1Client +func (c *Clientset) BpfmanV1alpha1() bpfmanv1alpha1.BpfmanV1alpha1Interface { + return c.bpfmanV1alpha1 } // Discovery retrieves the DiscoveryClient @@ -87,7 +87,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error - cs.bpfdV1alpha1, err = bpfdv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.bpfmanV1alpha1, err = bpfmanv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -112,7 +112,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.bpfdV1alpha1 = bpfdv1alpha1.New(c) + cs.bpfmanV1alpha1 = bpfmanv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/bpfd-operator/pkg/client/clientset/versioned/doc.go b/bpfman-operator/pkg/client/clientset/versioned/doc.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/doc.go rename to bpfman-operator/pkg/client/clientset/versioned/doc.go index bb2ba7a59..b7179e900 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/doc.go +++ b/bpfman-operator/pkg/client/clientset/versioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/pkg/client/clientset/versioned/fake/clientset_generated.go b/bpfman-operator/pkg/client/clientset/versioned/fake/clientset_generated.go similarity index 81% rename from bpfd-operator/pkg/client/clientset/versioned/fake/clientset_generated.go rename to bpfman-operator/pkg/client/clientset/versioned/fake/clientset_generated.go index 612d1bf0a..bd7a1c584 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/bpfman-operator/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,9 +18,9 @@ limitations under the License. package fake import ( - clientset "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - bpfdv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1" - fakebpfdv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake" + clientset "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + bpfmanv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1" + fakebpfmanv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -78,7 +78,7 @@ var ( _ testing.FakeClient = &Clientset{} ) -// BpfdV1alpha1 retrieves the BpfdV1alpha1Client -func (c *Clientset) BpfdV1alpha1() bpfdv1alpha1.BpfdV1alpha1Interface { - return &fakebpfdv1alpha1.FakeBpfdV1alpha1{Fake: &c.Fake} +// BpfmanV1alpha1 retrieves the BpfmanV1alpha1Client +func (c *Clientset) BpfmanV1alpha1() bpfmanv1alpha1.BpfmanV1alpha1Interface { + return &fakebpfmanv1alpha1.FakeBpfmanV1alpha1{Fake: &c.Fake} } diff --git a/bpfd-operator/pkg/client/clientset/versioned/fake/doc.go b/bpfman-operator/pkg/client/clientset/versioned/fake/doc.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/fake/doc.go rename to bpfman-operator/pkg/client/clientset/versioned/fake/doc.go index eb1bc6b5b..1d2134ad6 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/fake/doc.go +++ b/bpfman-operator/pkg/client/clientset/versioned/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/pkg/client/clientset/versioned/fake/register.go b/bpfman-operator/pkg/client/clientset/versioned/fake/register.go similarity index 92% rename from bpfd-operator/pkg/client/clientset/versioned/fake/register.go rename to bpfman-operator/pkg/client/clientset/versioned/fake/register.go index d05f95e73..320e47d99 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/fake/register.go +++ b/bpfman-operator/pkg/client/clientset/versioned/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package fake import ( - bpfdv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + bpfmanv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,7 +30,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - bpfdv1alpha1.AddToScheme, + bpfmanv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/bpfd-operator/pkg/client/clientset/versioned/scheme/doc.go b/bpfman-operator/pkg/client/clientset/versioned/scheme/doc.go similarity index 95% rename from bpfd-operator/pkg/client/clientset/versioned/scheme/doc.go rename to bpfman-operator/pkg/client/clientset/versioned/scheme/doc.go index c76f8baf1..19c6633f8 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/scheme/doc.go +++ b/bpfman-operator/pkg/client/clientset/versioned/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/pkg/client/clientset/versioned/scheme/register.go b/bpfman-operator/pkg/client/clientset/versioned/scheme/register.go similarity index 92% rename from bpfd-operator/pkg/client/clientset/versioned/scheme/register.go rename to bpfman-operator/pkg/client/clientset/versioned/scheme/register.go index 0e5c1e1cf..de8bf4d87 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/scheme/register.go +++ b/bpfman-operator/pkg/client/clientset/versioned/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package scheme import ( - bpfdv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + bpfmanv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,7 +30,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - bpfdv1alpha1.AddToScheme, + bpfmanv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go similarity index 61% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go index 6f2f3f4ed..7df4ac867 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,12 +20,12 @@ package v1alpha1 import ( "net/http" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/scheme" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type BpfdV1alpha1Interface interface { +type BpfmanV1alpha1Interface interface { RESTClient() rest.Interface BpfProgramsGetter KprobeProgramsGetter @@ -35,39 +35,39 @@ type BpfdV1alpha1Interface interface { XdpProgramsGetter } -// BpfdV1alpha1Client is used to interact with features provided by the bpfd.dev group. -type BpfdV1alpha1Client struct { +// BpfmanV1alpha1Client is used to interact with features provided by the bpfman.io group. +type BpfmanV1alpha1Client struct { restClient rest.Interface } -func (c *BpfdV1alpha1Client) BpfPrograms() BpfProgramInterface { +func (c *BpfmanV1alpha1Client) BpfPrograms() BpfProgramInterface { return newBpfPrograms(c) } -func (c *BpfdV1alpha1Client) KprobePrograms() KprobeProgramInterface { +func (c *BpfmanV1alpha1Client) KprobePrograms() KprobeProgramInterface { return newKprobePrograms(c) } -func (c *BpfdV1alpha1Client) TcPrograms() TcProgramInterface { +func (c *BpfmanV1alpha1Client) TcPrograms() TcProgramInterface { return newTcPrograms(c) } -func (c *BpfdV1alpha1Client) TracepointPrograms() TracepointProgramInterface { +func (c *BpfmanV1alpha1Client) TracepointPrograms() TracepointProgramInterface { return newTracepointPrograms(c) } -func (c *BpfdV1alpha1Client) UprobePrograms() UprobeProgramInterface { +func (c *BpfmanV1alpha1Client) UprobePrograms() UprobeProgramInterface { return newUprobePrograms(c) } -func (c *BpfdV1alpha1Client) XdpPrograms() XdpProgramInterface { +func (c *BpfmanV1alpha1Client) XdpPrograms() XdpProgramInterface { return newXdpPrograms(c) } -// NewForConfig creates a new BpfdV1alpha1Client for the given config. +// NewForConfig creates a new BpfmanV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*BpfdV1alpha1Client, error) { +func NewForConfig(c *rest.Config) (*BpfmanV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -79,9 +79,9 @@ func NewForConfig(c *rest.Config) (*BpfdV1alpha1Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new BpfdV1alpha1Client for the given config and http client. +// NewForConfigAndClient creates a new BpfmanV1alpha1Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BpfdV1alpha1Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BpfmanV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -90,12 +90,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BpfdV1alpha1Client, if err != nil { return nil, err } - return &BpfdV1alpha1Client{client}, nil + return &BpfmanV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new BpfdV1alpha1Client for the given config and +// NewForConfigOrDie creates a new BpfmanV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *BpfdV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *BpfmanV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -103,9 +103,9 @@ func NewForConfigOrDie(c *rest.Config) *BpfdV1alpha1Client { return client } -// New creates a new BpfdV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *BpfdV1alpha1Client { - return &BpfdV1alpha1Client{c} +// New creates a new BpfmanV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *BpfmanV1alpha1Client { + return &BpfmanV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -123,7 +123,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *BpfdV1alpha1Client) RESTClient() rest.Interface { +func (c *BpfmanV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/bpfprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/bpfprogram.go similarity index 96% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/bpfprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/bpfprogram.go index 683dc2a06..b3a94a48d 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/bpfprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/bpfprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import ( "context" "time" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - scheme "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/scheme" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + scheme "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -55,7 +55,7 @@ type bpfPrograms struct { } // newBpfPrograms returns a BpfPrograms -func newBpfPrograms(c *BpfdV1alpha1Client) *bpfPrograms { +func newBpfPrograms(c *BpfmanV1alpha1Client) *bpfPrograms { return &bpfPrograms{ client: c.RESTClient(), } diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go index 8a903e5a3..a47d86894 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go index 1a9995c4d..fe81f65a2 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go similarity index 60% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go index 4af312189..065a2c6f4 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,42 +18,42 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeBpfdV1alpha1 struct { +type FakeBpfmanV1alpha1 struct { *testing.Fake } -func (c *FakeBpfdV1alpha1) BpfPrograms() v1alpha1.BpfProgramInterface { +func (c *FakeBpfmanV1alpha1) BpfPrograms() v1alpha1.BpfProgramInterface { return &FakeBpfPrograms{c} } -func (c *FakeBpfdV1alpha1) KprobePrograms() v1alpha1.KprobeProgramInterface { +func (c *FakeBpfmanV1alpha1) KprobePrograms() v1alpha1.KprobeProgramInterface { return &FakeKprobePrograms{c} } -func (c *FakeBpfdV1alpha1) TcPrograms() v1alpha1.TcProgramInterface { +func (c *FakeBpfmanV1alpha1) TcPrograms() v1alpha1.TcProgramInterface { return &FakeTcPrograms{c} } -func (c *FakeBpfdV1alpha1) TracepointPrograms() v1alpha1.TracepointProgramInterface { +func (c *FakeBpfmanV1alpha1) TracepointPrograms() v1alpha1.TracepointProgramInterface { return &FakeTracepointPrograms{c} } -func (c *FakeBpfdV1alpha1) UprobePrograms() v1alpha1.UprobeProgramInterface { +func (c *FakeBpfmanV1alpha1) UprobePrograms() v1alpha1.UprobeProgramInterface { return &FakeUprobePrograms{c} } -func (c *FakeBpfdV1alpha1) XdpPrograms() v1alpha1.XdpProgramInterface { +func (c *FakeBpfmanV1alpha1) XdpPrograms() v1alpha1.XdpProgramInterface { return &FakeXdpPrograms{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeBpfdV1alpha1) RESTClient() rest.Interface { +func (c *FakeBpfmanV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_bpfprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_bpfprogram.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_bpfprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_bpfprogram.go index d411105d7..10e840857 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_bpfprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_bpfprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package fake import ( "context" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,12 +31,12 @@ import ( // FakeBpfPrograms implements BpfProgramInterface type FakeBpfPrograms struct { - Fake *FakeBpfdV1alpha1 + Fake *FakeBpfmanV1alpha1 } -var bpfprogramsResource = schema.GroupVersionResource{Group: "bpfd.dev", Version: "v1alpha1", Resource: "bpfprograms"} +var bpfprogramsResource = schema.GroupVersionResource{Group: "bpfman.io", Version: "v1alpha1", Resource: "bpfprograms"} -var bpfprogramsKind = schema.GroupVersionKind{Group: "bpfd.dev", Version: "v1alpha1", Kind: "BpfProgram"} +var bpfprogramsKind = schema.GroupVersionKind{Group: "bpfman.io", Version: "v1alpha1", Kind: "BpfProgram"} // Get takes name of the bpfProgram, and returns the corresponding bpfProgram object, and an error if there is any. func (c *FakeBpfPrograms) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BpfProgram, err error) { diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_kprobeprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_kprobeprogram.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_kprobeprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_kprobeprogram.go index ad84b4d84..f68c42b47 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_kprobeprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_kprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package fake import ( "context" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,12 +31,12 @@ import ( // FakeKprobePrograms implements KprobeProgramInterface type FakeKprobePrograms struct { - Fake *FakeBpfdV1alpha1 + Fake *FakeBpfmanV1alpha1 } -var kprobeprogramsResource = schema.GroupVersionResource{Group: "bpfd.dev", Version: "v1alpha1", Resource: "kprobeprograms"} +var kprobeprogramsResource = schema.GroupVersionResource{Group: "bpfman.io", Version: "v1alpha1", Resource: "kprobeprograms"} -var kprobeprogramsKind = schema.GroupVersionKind{Group: "bpfd.dev", Version: "v1alpha1", Kind: "KprobeProgram"} +var kprobeprogramsKind = schema.GroupVersionKind{Group: "bpfman.io", Version: "v1alpha1", Kind: "KprobeProgram"} // Get takes name of the kprobeProgram, and returns the corresponding kprobeProgram object, and an error if there is any. func (c *FakeKprobePrograms) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.KprobeProgram, err error) { diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tcprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tcprogram.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tcprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tcprogram.go index 18316e308..fab3b1caa 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tcprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tcprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package fake import ( "context" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,12 +31,12 @@ import ( // FakeTcPrograms implements TcProgramInterface type FakeTcPrograms struct { - Fake *FakeBpfdV1alpha1 + Fake *FakeBpfmanV1alpha1 } -var tcprogramsResource = schema.GroupVersionResource{Group: "bpfd.dev", Version: "v1alpha1", Resource: "tcprograms"} +var tcprogramsResource = schema.GroupVersionResource{Group: "bpfman.io", Version: "v1alpha1", Resource: "tcprograms"} -var tcprogramsKind = schema.GroupVersionKind{Group: "bpfd.dev", Version: "v1alpha1", Kind: "TcProgram"} +var tcprogramsKind = schema.GroupVersionKind{Group: "bpfman.io", Version: "v1alpha1", Kind: "TcProgram"} // Get takes name of the tcProgram, and returns the corresponding tcProgram object, and an error if there is any. func (c *FakeTcPrograms) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TcProgram, err error) { diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tracepointprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tracepointprogram.go similarity index 95% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tracepointprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tracepointprogram.go index 32b4533c8..24361afed 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tracepointprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_tracepointprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package fake import ( "context" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,12 +31,12 @@ import ( // FakeTracepointPrograms implements TracepointProgramInterface type FakeTracepointPrograms struct { - Fake *FakeBpfdV1alpha1 + Fake *FakeBpfmanV1alpha1 } -var tracepointprogramsResource = schema.GroupVersionResource{Group: "bpfd.dev", Version: "v1alpha1", Resource: "tracepointprograms"} +var tracepointprogramsResource = schema.GroupVersionResource{Group: "bpfman.io", Version: "v1alpha1", Resource: "tracepointprograms"} -var tracepointprogramsKind = schema.GroupVersionKind{Group: "bpfd.dev", Version: "v1alpha1", Kind: "TracepointProgram"} +var tracepointprogramsKind = schema.GroupVersionKind{Group: "bpfman.io", Version: "v1alpha1", Kind: "TracepointProgram"} // Get takes name of the tracepointProgram, and returns the corresponding tracepointProgram object, and an error if there is any. func (c *FakeTracepointPrograms) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TracepointProgram, err error) { diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_uprobeprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_uprobeprogram.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_uprobeprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_uprobeprogram.go index 8354dd874..2d21bfe19 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_uprobeprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_uprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package fake import ( "context" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,12 +31,12 @@ import ( // FakeUprobePrograms implements UprobeProgramInterface type FakeUprobePrograms struct { - Fake *FakeBpfdV1alpha1 + Fake *FakeBpfmanV1alpha1 } -var uprobeprogramsResource = schema.GroupVersionResource{Group: "bpfd.dev", Version: "v1alpha1", Resource: "uprobeprograms"} +var uprobeprogramsResource = schema.GroupVersionResource{Group: "bpfman.io", Version: "v1alpha1", Resource: "uprobeprograms"} -var uprobeprogramsKind = schema.GroupVersionKind{Group: "bpfd.dev", Version: "v1alpha1", Kind: "UprobeProgram"} +var uprobeprogramsKind = schema.GroupVersionKind{Group: "bpfman.io", Version: "v1alpha1", Kind: "UprobeProgram"} // Get takes name of the uprobeProgram, and returns the corresponding uprobeProgram object, and an error if there is any. func (c *FakeUprobePrograms) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.UprobeProgram, err error) { diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_xdpprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_xdpprogram.go similarity index 94% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_xdpprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_xdpprogram.go index 3ee2ce50a..37ff9a11b 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_xdpprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_xdpprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package fake import ( "context" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,12 +31,12 @@ import ( // FakeXdpPrograms implements XdpProgramInterface type FakeXdpPrograms struct { - Fake *FakeBpfdV1alpha1 + Fake *FakeBpfmanV1alpha1 } -var xdpprogramsResource = schema.GroupVersionResource{Group: "bpfd.dev", Version: "v1alpha1", Resource: "xdpprograms"} +var xdpprogramsResource = schema.GroupVersionResource{Group: "bpfman.io", Version: "v1alpha1", Resource: "xdpprograms"} -var xdpprogramsKind = schema.GroupVersionKind{Group: "bpfd.dev", Version: "v1alpha1", Kind: "XdpProgram"} +var xdpprogramsKind = schema.GroupVersionKind{Group: "bpfman.io", Version: "v1alpha1", Kind: "XdpProgram"} // Get takes name of the xdpProgram, and returns the corresponding xdpProgram object, and an error if there is any. func (c *FakeXdpPrograms) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.XdpProgram, err error) { diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go similarity index 95% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go index 70b3d43eb..95f0e6483 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/kprobeprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/kprobeprogram.go similarity index 96% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/kprobeprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/kprobeprogram.go index dadeda1d2..5fbdcfe59 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/kprobeprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/kprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import ( "context" "time" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - scheme "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/scheme" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + scheme "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -55,7 +55,7 @@ type kprobePrograms struct { } // newKprobePrograms returns a KprobePrograms -func newKprobePrograms(c *BpfdV1alpha1Client) *kprobePrograms { +func newKprobePrograms(c *BpfmanV1alpha1Client) *kprobePrograms { return &kprobePrograms{ client: c.RESTClient(), } diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tcprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tcprogram.go similarity index 96% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tcprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tcprogram.go index 1f21e611b..5baa971a4 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tcprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tcprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import ( "context" "time" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - scheme "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/scheme" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + scheme "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -55,7 +55,7 @@ type tcPrograms struct { } // newTcPrograms returns a TcPrograms -func newTcPrograms(c *BpfdV1alpha1Client) *tcPrograms { +func newTcPrograms(c *BpfmanV1alpha1Client) *tcPrograms { return &tcPrograms{ client: c.RESTClient(), } diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tracepointprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tracepointprogram.go similarity index 96% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tracepointprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tracepointprogram.go index 0ac8c67dc..e65fe8997 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tracepointprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/tracepointprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import ( "context" "time" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - scheme "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/scheme" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + scheme "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -55,7 +55,7 @@ type tracepointPrograms struct { } // newTracepointPrograms returns a TracepointPrograms -func newTracepointPrograms(c *BpfdV1alpha1Client) *tracepointPrograms { +func newTracepointPrograms(c *BpfmanV1alpha1Client) *tracepointPrograms { return &tracepointPrograms{ client: c.RESTClient(), } diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/uprobeprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/uprobeprogram.go similarity index 96% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/uprobeprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/uprobeprogram.go index 0f39119d1..4752bc6fe 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/uprobeprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/uprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import ( "context" "time" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - scheme "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/scheme" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + scheme "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -55,7 +55,7 @@ type uprobePrograms struct { } // newUprobePrograms returns a UprobePrograms -func newUprobePrograms(c *BpfdV1alpha1Client) *uprobePrograms { +func newUprobePrograms(c *BpfmanV1alpha1Client) *uprobePrograms { return &uprobePrograms{ client: c.RESTClient(), } diff --git a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/xdpprogram.go b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/xdpprogram.go similarity index 96% rename from bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/xdpprogram.go rename to bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/xdpprogram.go index e71e2a70f..7032681cd 100644 --- a/bpfd-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/xdpprogram.go +++ b/bpfman-operator/pkg/client/clientset/versioned/typed/apis/v1alpha1/xdpprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import ( "context" "time" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - scheme "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned/scheme" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + scheme "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -55,7 +55,7 @@ type xdpPrograms struct { } // newXdpPrograms returns a XdpPrograms -func newXdpPrograms(c *BpfdV1alpha1Client) *xdpPrograms { +func newXdpPrograms(c *BpfmanV1alpha1Client) *xdpPrograms { return &xdpPrograms{ client: c.RESTClient(), } diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/interface.go b/bpfman-operator/pkg/client/informers/externalversions/apis/interface.go similarity index 84% rename from bpfd-operator/pkg/client/informers/externalversions/apis/interface.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/interface.go index df0007bc2..60f381797 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/interface.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,8 +18,8 @@ limitations under the License. package apis import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/bpfprogram.go b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/bpfprogram.go similarity index 84% rename from bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/bpfprogram.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/bpfprogram.go index 6adbdc7ec..ef19de4d2 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/bpfprogram.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/bpfprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ import ( "context" time "time" - apisv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/listers/apis/v1alpha1" + apisv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/listers/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -60,13 +60,13 @@ func NewFilteredBpfProgramInformer(client versioned.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().BpfPrograms().List(context.TODO(), options) + return client.BpfmanV1alpha1().BpfPrograms().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().BpfPrograms().Watch(context.TODO(), options) + return client.BpfmanV1alpha1().BpfPrograms().Watch(context.TODO(), options) }, }, &apisv1alpha1.BpfProgram{}, diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/interface.go b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/interface.go similarity index 94% rename from bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/interface.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/interface.go index 8241a203a..2a020b4aa 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/interface.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 import ( - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/kprobeprogram.go b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/kprobeprogram.go similarity index 84% rename from bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/kprobeprogram.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/kprobeprogram.go index 871d6f0ba..f371908b9 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/kprobeprogram.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/kprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ import ( "context" time "time" - apisv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/listers/apis/v1alpha1" + apisv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/listers/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -60,13 +60,13 @@ func NewFilteredKprobeProgramInformer(client versioned.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().KprobePrograms().List(context.TODO(), options) + return client.BpfmanV1alpha1().KprobePrograms().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().KprobePrograms().Watch(context.TODO(), options) + return client.BpfmanV1alpha1().KprobePrograms().Watch(context.TODO(), options) }, }, &apisv1alpha1.KprobeProgram{}, diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/tcprogram.go b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/tcprogram.go similarity index 84% rename from bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/tcprogram.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/tcprogram.go index c4a132efd..9dd1907ed 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/tcprogram.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/tcprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ import ( "context" time "time" - apisv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/listers/apis/v1alpha1" + apisv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/listers/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -60,13 +60,13 @@ func NewFilteredTcProgramInformer(client versioned.Interface, resyncPeriod time. if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().TcPrograms().List(context.TODO(), options) + return client.BpfmanV1alpha1().TcPrograms().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().TcPrograms().Watch(context.TODO(), options) + return client.BpfmanV1alpha1().TcPrograms().Watch(context.TODO(), options) }, }, &apisv1alpha1.TcProgram{}, diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/tracepointprogram.go b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/tracepointprogram.go similarity index 84% rename from bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/tracepointprogram.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/tracepointprogram.go index a9a7747c7..6c3e4cb95 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/tracepointprogram.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/tracepointprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ import ( "context" time "time" - apisv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/listers/apis/v1alpha1" + apisv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/listers/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -60,13 +60,13 @@ func NewFilteredTracepointProgramInformer(client versioned.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().TracepointPrograms().List(context.TODO(), options) + return client.BpfmanV1alpha1().TracepointPrograms().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().TracepointPrograms().Watch(context.TODO(), options) + return client.BpfmanV1alpha1().TracepointPrograms().Watch(context.TODO(), options) }, }, &apisv1alpha1.TracepointProgram{}, diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/uprobeprogram.go b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/uprobeprogram.go similarity index 84% rename from bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/uprobeprogram.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/uprobeprogram.go index b287f1437..430f2a6fa 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/uprobeprogram.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/uprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ import ( "context" time "time" - apisv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/listers/apis/v1alpha1" + apisv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/listers/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -60,13 +60,13 @@ func NewFilteredUprobeProgramInformer(client versioned.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().UprobePrograms().List(context.TODO(), options) + return client.BpfmanV1alpha1().UprobePrograms().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().UprobePrograms().Watch(context.TODO(), options) + return client.BpfmanV1alpha1().UprobePrograms().Watch(context.TODO(), options) }, }, &apisv1alpha1.UprobeProgram{}, diff --git a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/xdpprogram.go b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/xdpprogram.go similarity index 84% rename from bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/xdpprogram.go rename to bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/xdpprogram.go index 33cd5137e..f3bc9e8a2 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/apis/v1alpha1/xdpprogram.go +++ b/bpfman-operator/pkg/client/informers/externalversions/apis/v1alpha1/xdpprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,10 +21,10 @@ import ( "context" time "time" - apisv1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/listers/apis/v1alpha1" + apisv1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/pkg/client/listers/apis/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -60,13 +60,13 @@ func NewFilteredXdpProgramInformer(client versioned.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().XdpPrograms().List(context.TODO(), options) + return client.BpfmanV1alpha1().XdpPrograms().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BpfdV1alpha1().XdpPrograms().Watch(context.TODO(), options) + return client.BpfmanV1alpha1().XdpPrograms().Watch(context.TODO(), options) }, }, &apisv1alpha1.XdpProgram{}, diff --git a/bpfd-operator/pkg/client/informers/externalversions/factory.go b/bpfman-operator/pkg/client/informers/externalversions/factory.go similarity index 95% rename from bpfd-operator/pkg/client/informers/externalversions/factory.go rename to bpfman-operator/pkg/client/informers/externalversions/factory.go index 5e00caba0..04965035d 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/factory.go +++ b/bpfman-operator/pkg/client/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,9 @@ import ( sync "sync" time "time" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - apis "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/apis" - internalinterfaces "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + apis "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/apis" + internalinterfaces "github.com/bpfman/bpfman/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -242,9 +242,9 @@ type SharedInformerFactory interface { // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer - Bpfd() apis.Interface + Bpfman() apis.Interface } -func (f *sharedInformerFactory) Bpfd() apis.Interface { +func (f *sharedInformerFactory) Bpfman() apis.Interface { return apis.New(f, f.namespace, f.tweakListOptions) } diff --git a/bpfd-operator/pkg/client/informers/externalversions/generic.go b/bpfman-operator/pkg/client/informers/externalversions/generic.go similarity index 82% rename from bpfd-operator/pkg/client/informers/externalversions/generic.go rename to bpfman-operator/pkg/client/informers/externalversions/generic.go index 1633ae1a2..4bcf6d181 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/generic.go +++ b/bpfman-operator/pkg/client/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -51,19 +51,19 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=bpfd.dev, Version=v1alpha1 + // Group=bpfman.io, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("bpfprograms"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfd().V1alpha1().BpfPrograms().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfman().V1alpha1().BpfPrograms().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("kprobeprograms"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfd().V1alpha1().KprobePrograms().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfman().V1alpha1().KprobePrograms().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("tcprograms"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfd().V1alpha1().TcPrograms().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfman().V1alpha1().TcPrograms().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("tracepointprograms"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfd().V1alpha1().TracepointPrograms().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfman().V1alpha1().TracepointPrograms().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("uprobeprograms"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfd().V1alpha1().UprobePrograms().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfman().V1alpha1().UprobePrograms().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("xdpprograms"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfd().V1alpha1().XdpPrograms().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Bpfman().V1alpha1().XdpPrograms().Informer()}, nil } diff --git a/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go similarity index 91% rename from bpfd-operator/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go rename to bpfman-operator/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index 1eca410be..a5db4b06c 100644 --- a/bpfd-operator/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/bpfman-operator/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ package internalinterfaces import ( time "time" - versioned "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" + versioned "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/bpfd-operator/pkg/client/listers/apis/v1alpha1/bpfprogram.go b/bpfman-operator/pkg/client/listers/apis/v1alpha1/bpfprogram.go similarity index 95% rename from bpfd-operator/pkg/client/listers/apis/v1alpha1/bpfprogram.go rename to bpfman-operator/pkg/client/listers/apis/v1alpha1/bpfprogram.go index de4317946..0a613e747 100644 --- a/bpfd-operator/pkg/client/listers/apis/v1alpha1/bpfprogram.go +++ b/bpfman-operator/pkg/client/listers/apis/v1alpha1/bpfprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/bpfd-operator/pkg/client/listers/apis/v1alpha1/expansion_generated.go b/bpfman-operator/pkg/client/listers/apis/v1alpha1/expansion_generated.go similarity index 97% rename from bpfd-operator/pkg/client/listers/apis/v1alpha1/expansion_generated.go rename to bpfman-operator/pkg/client/listers/apis/v1alpha1/expansion_generated.go index 69762f8ef..68073a95d 100644 --- a/bpfd-operator/pkg/client/listers/apis/v1alpha1/expansion_generated.go +++ b/bpfman-operator/pkg/client/listers/apis/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/bpfd-operator/pkg/client/listers/apis/v1alpha1/kprobeprogram.go b/bpfman-operator/pkg/client/listers/apis/v1alpha1/kprobeprogram.go similarity index 95% rename from bpfd-operator/pkg/client/listers/apis/v1alpha1/kprobeprogram.go rename to bpfman-operator/pkg/client/listers/apis/v1alpha1/kprobeprogram.go index 6e7dd30a3..65efa0070 100644 --- a/bpfd-operator/pkg/client/listers/apis/v1alpha1/kprobeprogram.go +++ b/bpfman-operator/pkg/client/listers/apis/v1alpha1/kprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/bpfd-operator/pkg/client/listers/apis/v1alpha1/tcprogram.go b/bpfman-operator/pkg/client/listers/apis/v1alpha1/tcprogram.go similarity index 95% rename from bpfd-operator/pkg/client/listers/apis/v1alpha1/tcprogram.go rename to bpfman-operator/pkg/client/listers/apis/v1alpha1/tcprogram.go index b61856818..905c3c279 100644 --- a/bpfd-operator/pkg/client/listers/apis/v1alpha1/tcprogram.go +++ b/bpfman-operator/pkg/client/listers/apis/v1alpha1/tcprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/bpfd-operator/pkg/client/listers/apis/v1alpha1/tracepointprogram.go b/bpfman-operator/pkg/client/listers/apis/v1alpha1/tracepointprogram.go similarity index 95% rename from bpfd-operator/pkg/client/listers/apis/v1alpha1/tracepointprogram.go rename to bpfman-operator/pkg/client/listers/apis/v1alpha1/tracepointprogram.go index 81f451f90..dc7ec6107 100644 --- a/bpfd-operator/pkg/client/listers/apis/v1alpha1/tracepointprogram.go +++ b/bpfman-operator/pkg/client/listers/apis/v1alpha1/tracepointprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/bpfd-operator/pkg/client/listers/apis/v1alpha1/uprobeprogram.go b/bpfman-operator/pkg/client/listers/apis/v1alpha1/uprobeprogram.go similarity index 95% rename from bpfd-operator/pkg/client/listers/apis/v1alpha1/uprobeprogram.go rename to bpfman-operator/pkg/client/listers/apis/v1alpha1/uprobeprogram.go index 7ae468d5a..78af46298 100644 --- a/bpfd-operator/pkg/client/listers/apis/v1alpha1/uprobeprogram.go +++ b/bpfman-operator/pkg/client/listers/apis/v1alpha1/uprobeprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/bpfd-operator/pkg/client/listers/apis/v1alpha1/xdpprogram.go b/bpfman-operator/pkg/client/listers/apis/v1alpha1/xdpprogram.go similarity index 95% rename from bpfd-operator/pkg/client/listers/apis/v1alpha1/xdpprogram.go rename to bpfman-operator/pkg/client/listers/apis/v1alpha1/xdpprogram.go index d570f51d0..d485a39aa 100644 --- a/bpfd-operator/pkg/client/listers/apis/v1alpha1/xdpprogram.go +++ b/bpfman-operator/pkg/client/listers/apis/v1alpha1/xdpprogram.go @@ -1,5 +1,5 @@ /* -Copyright 2023 The bpfd Authors. +Copyright 2023 The bpfman Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + v1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/bpfd-operator/pkg/helpers/helpers.go b/bpfman-operator/pkg/helpers/helpers.go similarity index 70% rename from bpfd-operator/pkg/helpers/helpers.go rename to bpfman-operator/pkg/helpers/helpers.go index aec35ed70..c58be99f5 100644 --- a/bpfd-operator/pkg/helpers/helpers.go +++ b/bpfman-operator/pkg/helpers/helpers.go @@ -21,8 +21,8 @@ import ( "fmt" "time" - //bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" - bpfdclientset "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" + //bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" + bpfmanclientset "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" //"k8s.io/apimachinery/pkg/api/errors" //"k8s.io/apimachinery/pkg/runtime" ctrl "sigs.k8s.io/controller-runtime" @@ -35,10 +35,10 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - bpfdiov1alpha1 "github.com/bpfd-dev/bpfd/bpfd-operator/apis/v1alpha1" + bpfmaniov1alpha1 "github.com/bpfman/bpfman/bpfman-operator/apis/v1alpha1" ) -// Must match the internal bpfd-api mappings +// Must match the internal bpfman-api mappings type ProgramType int32 const ( @@ -104,7 +104,7 @@ func (t TcProgramDirection) String() string { } } -var log = ctrl.Log.WithName("bpfd-helpers") +var log = ctrl.Log.WithName("bpfman-helpers") // getk8sConfig gets a kubernetes config automatically detecting if it should // be the in or out of cluster config. If this step fails panic. @@ -126,10 +126,10 @@ func getk8sConfigOrDie() *rest.Config { return config } -// GetClientOrDie gets the bpfd Kubernetes Client dynamically switching between in cluster and out of +// GetClientOrDie gets the bpfman Kubernetes Client dynamically switching between in cluster and out of // cluster config setup. -func GetClientOrDie() *bpfdclientset.Clientset { - return bpfdclientset.NewForConfigOrDie(getk8sConfigOrDie()) +func GetClientOrDie() *bpfmanclientset.Clientset { + return bpfmanclientset.NewForConfigOrDie(getk8sConfigOrDie()) } // Returns true if loaded. False if not. Also returns the condition type. @@ -143,19 +143,19 @@ func isProgLoaded(conditions *[]metav1.Condition) (bool, string) { condition := (*conditions)[0] - if condition.Type != string(bpfdiov1alpha1.ProgramReconcileSuccess) { + if condition.Type != string(bpfmaniov1alpha1.ProgramReconcileSuccess) { return false, condition.Type } return true, condition.Type } -func isKprobebpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) wait.ConditionFunc { +func isKprobebpfmanProgLoaded(c *bpfmanclientset.Clientset, progConfName string) wait.ConditionFunc { ctx := context.Background() return func() (bool, error) { log.Info(".") // progress bar! - bpfProgConfig, err := c.BpfdV1alpha1().KprobePrograms().Get(ctx, progConfName, metav1.GetOptions{}) + bpfProgConfig, err := c.BpfmanV1alpha1().KprobePrograms().Get(ctx, progConfName, metav1.GetOptions{}) if err != nil { return false, err } @@ -171,12 +171,12 @@ func isKprobebpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) wai } } -func isTcbpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) wait.ConditionFunc { +func isTcbpfmanProgLoaded(c *bpfmanclientset.Clientset, progConfName string) wait.ConditionFunc { ctx := context.Background() return func() (bool, error) { log.Info(".") // progress bar! - bpfProgConfig, err := c.BpfdV1alpha1().TcPrograms().Get(ctx, progConfName, metav1.GetOptions{}) + bpfProgConfig, err := c.BpfmanV1alpha1().TcPrograms().Get(ctx, progConfName, metav1.GetOptions{}) if err != nil { return false, err } @@ -192,12 +192,12 @@ func isTcbpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) wait.Co } } -func isTracepointbpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) wait.ConditionFunc { +func isTracepointbpfmanProgLoaded(c *bpfmanclientset.Clientset, progConfName string) wait.ConditionFunc { ctx := context.Background() return func() (bool, error) { log.Info(".") // progress bar! - bpfProgConfig, err := c.BpfdV1alpha1().TracepointPrograms().Get(ctx, progConfName, metav1.GetOptions{}) + bpfProgConfig, err := c.BpfmanV1alpha1().TracepointPrograms().Get(ctx, progConfName, metav1.GetOptions{}) if err != nil { return false, err } @@ -213,12 +213,12 @@ func isTracepointbpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) } } -func isXdpbpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) wait.ConditionFunc { +func isXdpbpfmanProgLoaded(c *bpfmanclientset.Clientset, progConfName string) wait.ConditionFunc { ctx := context.Background() return func() (bool, error) { log.Info(".") // progress bar! - bpfProgConfig, err := c.BpfdV1alpha1().XdpPrograms().Get(ctx, progConfName, metav1.GetOptions{}) + bpfProgConfig, err := c.BpfmanV1alpha1().XdpPrograms().Get(ctx, progConfName, metav1.GetOptions{}) if err != nil { return false, err } @@ -236,16 +236,16 @@ func isXdpbpfdProgLoaded(c *bpfdclientset.Clientset, progConfName string) wait.C // WaitForBpfProgConfLoad ensures the Program object is loaded and deployed successfully, specifically // it checks the config objects' conditions to look for the `Loaded` state. -func WaitForBpfProgConfLoad(c *bpfdclientset.Clientset, progName string, timeout time.Duration, progType ProgramType) error { +func WaitForBpfProgConfLoad(c *bpfmanclientset.Clientset, progName string, timeout time.Duration, progType ProgramType) error { switch progType { case Kprobe: - return wait.PollImmediate(time.Second, timeout, isKprobebpfdProgLoaded(c, progName)) + return wait.PollImmediate(time.Second, timeout, isKprobebpfmanProgLoaded(c, progName)) case Tc: - return wait.PollImmediate(time.Second, timeout, isTcbpfdProgLoaded(c, progName)) + return wait.PollImmediate(time.Second, timeout, isTcbpfmanProgLoaded(c, progName)) case Xdp: - return wait.PollImmediate(time.Second, timeout, isXdpbpfdProgLoaded(c, progName)) + return wait.PollImmediate(time.Second, timeout, isXdpbpfmanProgLoaded(c, progName)) case Tracepoint: - return wait.PollImmediate(time.Second, timeout, isTracepointbpfdProgLoaded(c, progName)) + return wait.PollImmediate(time.Second, timeout, isTracepointbpfmanProgLoaded(c, progName)) // TODO: case Uprobe: not covered. Since Uprobe has the same ProgramType as // Kprobe, we need a different way to distinguish them. Options include // creating an internal ProgramType for Uprobe or using a different @@ -255,9 +255,9 @@ func WaitForBpfProgConfLoad(c *bpfdclientset.Clientset, progName string, timeout } } -// IsBpfdDeployed is used to check for the existence of bpfd in a Kubernetes cluster. Specifically it checks for -// the existence of the bpfd.dev CRD api group within the apiserver. If getting the k8s config fails this will panic. -func IsBpfdDeployed() bool { +// IsBpfmanDeployed is used to check for the existence of bpfman in a Kubernetes cluster. Specifically it checks for +// the existence of the bpfman.io CRD api group within the apiserver. If getting the k8s config fails this will panic. +func IsBpfmanDeployed() bool { config := getk8sConfigOrDie() client, err := discovery.NewDiscoveryClientForConfig(config) @@ -272,9 +272,9 @@ func IsBpfdDeployed() bool { } for _, v := range apiList.Groups { - if v.Name == "bpfd.dev" { + if v.Name == "bpfman.io" { - log.Info("bpfd.dev found in apis, bpfd is deployed") + log.Info("bpfman.io found in apis, bpfman is deployed") return true } } @@ -294,11 +294,11 @@ func IsBpfProgramConditionFailure(conditions *[]metav1.Condition) bool { log.Info("more than one BpfProgramCondition", "numConditions", numConditions) } - if (*conditions)[0].Type == string(bpfdiov1alpha1.BpfProgCondNotLoaded) || - (*conditions)[0].Type == string(bpfdiov1alpha1.BpfProgCondNotUnloaded) || - (*conditions)[0].Type == string(bpfdiov1alpha1.BpfProgCondMapOwnerNotFound) || - (*conditions)[0].Type == string(bpfdiov1alpha1.BpfProgCondMapOwnerNotLoaded) || - (*conditions)[0].Type == string(bpfdiov1alpha1.BpfProgCondBytecodeSelectorError) { + if (*conditions)[0].Type == string(bpfmaniov1alpha1.BpfProgCondNotLoaded) || + (*conditions)[0].Type == string(bpfmaniov1alpha1.BpfProgCondNotUnloaded) || + (*conditions)[0].Type == string(bpfmaniov1alpha1.BpfProgCondMapOwnerNotFound) || + (*conditions)[0].Type == string(bpfmaniov1alpha1.BpfProgCondMapOwnerNotLoaded) || + (*conditions)[0].Type == string(bpfmaniov1alpha1.BpfProgCondBytecodeSelectorError) { return true } diff --git a/bpfd-operator/test/integration/suite_test.go b/bpfman-operator/test/integration/suite_test.go similarity index 63% rename from bpfd-operator/test/integration/suite_test.go rename to bpfman-operator/test/integration/suite_test.go index ee81e9192..f11e354cb 100644 --- a/bpfd-operator/test/integration/suite_test.go +++ b/bpfman-operator/test/integration/suite_test.go @@ -17,25 +17,25 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/bpfd-dev/bpfd/bpfd-operator/internal" - "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/client/clientset/versioned" - bpfdHelpers "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/helpers" + "github.com/bpfman/bpfman/bpfman-operator/internal" + "github.com/bpfman/bpfman/bpfman-operator/pkg/client/clientset/versioned" + bpfmanHelpers "github.com/bpfman/bpfman/bpfman-operator/pkg/helpers" ) var ( - ctx context.Context - cancel context.CancelFunc - env environments.Environment - bpfdClient *versioned.Clientset + ctx context.Context + cancel context.CancelFunc + env environments.Environment + bpfmanClient *versioned.Clientset // These images should already be built on the node so they can // be loaded into kind. - bpfdImage = os.Getenv("BPFD_IMG") - bpfdAgentImage = os.Getenv("BPFD_AGENT_IMG") - bpfdOperatorImage = os.Getenv("BPFD_OPERATOR_IMG") - tcExampleUsImage = "quay.io/bpfd-userspace/go-tc-counter:latest" - xdpExampleUsImage = "quay.io/bpfd-userspace/go-xdp-counter:latest" - tpExampleUsImage = "quay.io/bpfd-userspace/go-tracepoint-counter:latest" + bpfmanImage = os.Getenv("BPFMAN_IMG") + bpfmanAgentImage = os.Getenv("BPFMAN_AGENT_IMG") + bpfmanOperatorImage = os.Getenv("BPFMAN_OPERATOR_IMG") + tcExampleUsImage = "quay.io/bpfman-userspace/go-tc-counter:latest" + xdpExampleUsImage = "quay.io/bpfman-userspace/go-xdp-counter:latest" + tpExampleUsImage = "quay.io/bpfman-userspace/go-tracepoint-counter:latest" existingCluster = os.Getenv("USE_EXISTING_KIND_CLUSTER") keepTestCluster = func() bool { return os.Getenv("TEST_KEEP_CLUSTER") == "true" || existingCluster != "" }() @@ -45,28 +45,28 @@ var ( ) const ( - bpfdKustomize = "../../config/test" - bpfdConfigMap = "../../config/bpfd-deployment/config.yaml" + bpfmanKustomize = "../../config/test" + bpfmanConfigMap = "../../config/bpfman-deployment/config.yaml" ) func TestMain(m *testing.M) { - // check that we have the bpfd, bpfd-agent, and bpfd-operator images to use for the tests. + // check that we have the bpfman, bpfman-agent, and bpfman-operator images to use for the tests. // generally the runner of the tests should have built these from the latest // changes prior to the tests and fed them to the test suite. - if bpfdImage == "" || bpfdAgentImage == "" || bpfdOperatorImage == "" { - exitOnErr(fmt.Errorf("BPFD_IMG, BPFD_AGENT_IMG, and BPFD_OPERATOR_IMG must be provided")) + if bpfmanImage == "" || bpfmanAgentImage == "" || bpfmanOperatorImage == "" { + exitOnErr(fmt.Errorf("BPFMAN_IMG, BPFMAN_AGENT_IMG, and BPFMAN_OPERATOR_IMG must be provided")) } ctx, cancel = context.WithCancel(context.Background()) defer cancel() - // to use the provided bpfd, bpfd-agent, and bpfd-operator images we will need to add + // to use the provided bpfman, bpfman-agent, and bpfman-operator images we will need to add // them as images to load in the test cluster via an addon. - loadImages, err := loadimage.NewBuilder().WithImage(bpfdImage) + loadImages, err := loadimage.NewBuilder().WithImage(bpfmanImage) exitOnErr(err) - loadImages, err = loadImages.WithImage(bpfdAgentImage) + loadImages, err = loadImages.WithImage(bpfmanAgentImage) exitOnErr(err) - loadImages, err = loadImages.WithImage(bpfdOperatorImage) + loadImages, err = loadImages.WithImage(bpfmanOperatorImage) exitOnErr(err) loadImages, err = loadImages.WithImage(tcExampleUsImage) exitOnErr(err) @@ -99,27 +99,27 @@ func TestMain(m *testing.M) { }) } - // deploy the BPFD Operator and revelevant CRDs - fmt.Println("INFO: deploying bpfd operator to test cluster") - exitOnErr(clusters.KustomizeDeployForCluster(ctx, env.Cluster(), bpfdKustomize)) + // deploy the BPFMAN Operator and revelevant CRDs + fmt.Println("INFO: deploying bpfman operator to test cluster") + exitOnErr(clusters.KustomizeDeployForCluster(ctx, env.Cluster(), bpfmanKustomize)) if !keepKustomizeDeploys { addCleanup(func(context.Context) error { - cleanupLog("delete bpfd configmap to cleanup bpfd daemon") - env.Cluster().Client().CoreV1().ConfigMaps(internal.BpfdNs).Delete(ctx, internal.BpfdConfigName, metav1.DeleteOptions{}) - clusters.DeleteManifestByYAML(ctx, env.Cluster(), bpfdConfigMap) - waitForBpfdConfigDelete(ctx, env) - cleanupLog("deleting bpfd namespace") - return env.Cluster().Client().CoreV1().Namespaces().Delete(ctx, internal.BpfdNs, metav1.DeleteOptions{}) + cleanupLog("delete bpfman configmap to cleanup bpfman daemon") + env.Cluster().Client().CoreV1().ConfigMaps(internal.BpfmanNs).Delete(ctx, internal.BpfmanConfigName, metav1.DeleteOptions{}) + clusters.DeleteManifestByYAML(ctx, env.Cluster(), bpfmanConfigMap) + waitForBpfmanConfigDelete(ctx, env) + cleanupLog("deleting bpfman namespace") + return env.Cluster().Client().CoreV1().Namespaces().Delete(ctx, internal.BpfmanNs, metav1.DeleteOptions{}) }) } - bpfdClient = bpfdHelpers.GetClientOrDie() - exitOnErr(waitForBpfdReadiness(ctx, env)) + bpfmanClient = bpfmanHelpers.GetClientOrDie() + exitOnErr(waitForBpfmanReadiness(ctx, env)) exit := m.Run() // If there's any errors in e2e tests dump diagnostics if exit != 0 { - _, err := env.Cluster().DumpDiagnostics(ctx, "bpfd-e2e-test") + _, err := env.Cluster().DumpDiagnostics(ctx, "bpfman-e2e-test") exitOnErr(err) } @@ -167,7 +167,7 @@ func runCleanup() (cleanupErr error) { return } -func waitForBpfdReadiness(ctx context.Context, env environments.Environment) error { +func waitForBpfmanReadiness(ctx context.Context, env environments.Environment) error { for { time.Sleep(2 * time.Second) select { @@ -177,13 +177,13 @@ func waitForBpfdReadiness(ctx context.Context, env environments.Environment) err } return fmt.Errorf("context completed while waiting for components") default: - fmt.Println("INFO: waiting for bpfd") + fmt.Println("INFO: waiting for bpfman") var controlplaneReady, dataplaneReady bool - controlplane, err := env.Cluster().Client().AppsV1().Deployments(internal.BpfdNs).Get(ctx, internal.BpfdOperatorName, metav1.GetOptions{}) + controlplane, err := env.Cluster().Client().AppsV1().Deployments(internal.BpfmanNs).Get(ctx, internal.BpfmanOperatorName, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { - fmt.Println("INFO: bpfd-operator dep not found yet") + fmt.Println("INFO: bpfman-operator dep not found yet") continue } return err @@ -192,10 +192,10 @@ func waitForBpfdReadiness(ctx context.Context, env environments.Environment) err controlplaneReady = true } - dataplane, err := env.Cluster().Client().AppsV1().DaemonSets(internal.BpfdNs).Get(ctx, internal.BpfdDsName, metav1.GetOptions{}) + dataplane, err := env.Cluster().Client().AppsV1().DaemonSets(internal.BpfmanNs).Get(ctx, internal.BpfmanDsName, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { - fmt.Println("INFO: bpfd daemon not found yet") + fmt.Println("INFO: bpfman daemon not found yet") continue } return err @@ -205,14 +205,14 @@ func waitForBpfdReadiness(ctx context.Context, env environments.Environment) err } if controlplaneReady && dataplaneReady { - fmt.Println("INFO: bpfd-operator is ready") + fmt.Println("INFO: bpfman-operator is ready") return nil } } } } -func waitForBpfdConfigDelete(ctx context.Context, env environments.Environment) error { +func waitForBpfmanConfigDelete(ctx context.Context, env environments.Environment) error { for { time.Sleep(2 * time.Second) select { @@ -222,12 +222,12 @@ func waitForBpfdConfigDelete(ctx context.Context, env environments.Environment) } return fmt.Errorf("context completed while waiting for components") default: - fmt.Println("INFO: waiting for bpfd config deletion") + fmt.Println("INFO: waiting for bpfman config deletion") - _, err := env.Cluster().Client().CoreV1().ConfigMaps(internal.BpfdNs).Get(ctx, internal.BpfdConfigName, metav1.GetOptions{}) + _, err := env.Cluster().Client().CoreV1().ConfigMaps(internal.BpfmanNs).Get(ctx, internal.BpfmanConfigName, metav1.GetOptions{}) if err != nil { if errors.IsNotFound(err) { - fmt.Println("INFO: bpfd configmap deleted successfully") + fmt.Println("INFO: bpfman configmap deleted successfully") return nil } return err diff --git a/bpfd-operator/test/integration/tc_test.go b/bpfman-operator/test/integration/tc_test.go similarity index 100% rename from bpfd-operator/test/integration/tc_test.go rename to bpfman-operator/test/integration/tc_test.go diff --git a/bpfd-operator/test/integration/tracepoint_test.go b/bpfman-operator/test/integration/tracepoint_test.go similarity index 100% rename from bpfd-operator/test/integration/tracepoint_test.go rename to bpfman-operator/test/integration/tracepoint_test.go diff --git a/bpfd-operator/test/integration/xdp_test.go b/bpfman-operator/test/integration/xdp_test.go similarity index 78% rename from bpfd-operator/test/integration/xdp_test.go rename to bpfman-operator/test/integration/xdp_test.go index f8903b0dd..ccb1ff6da 100644 --- a/bpfd-operator/test/integration/xdp_test.go +++ b/bpfman-operator/test/integration/xdp_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - bpfdHelpers "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/helpers" + bpfmanHelpers "github.com/bpfman/bpfman/bpfman-operator/pkg/helpers" "github.com/kong/kubernetes-testing-framework/pkg/clusters" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" @@ -25,10 +25,10 @@ const ( ) func TestXdpPassPrivate(t *testing.T) { - t.Log("deploying secret for privated xdp bytecode image in the bpfd namespace") + t.Log("deploying secret for privated xdp bytecode image in the bpfman namespace") // Generated from /* - kubectl create secret -n bpfd docker-registry regcred --docker-server=quay.io --docker-username=bpfd-bytecode+bpfdcreds --docker-password=JOGZ3FA6A9L2297JAT4FFN6CJU87LKTIY6X1ZGKWJ0W0XLKY0KPT5YKTBBEAGSF5 + kubectl create secret -n bpfman docker-registry regcred --docker-server=quay.io --docker-username=bpfman-bytecode+bpfmancreds --docker-password=D49CKWI1MMOFGRCAT8SHW5A56FSVP30TGYX54BBWKY2J129XRI6Q5TVH2ZZGTJ1M */ xdpPassPrivateSecretYAML := `--- --- @@ -39,7 +39,7 @@ metadata: namespace: default type: kubernetes.io/dockerconfigjson data: - .dockerconfigjson: eyJhdXRocyI6eyJxdWF5LmlvIjp7InVzZXJuYW1lIjoiYnBmZC1ieXRlY29kZSticGZkY3JlZHMiLCJwYXNzd29yZCI6IkpPR1ozRkE2QTlMMjI5N0pBVDRGRk42Q0pVODdMS1RJWTZYMVpHS1dKMFcwWExLWTBLUFQ1WUtUQkJFQUdTRjUiLCJhdXRoIjoiWW5CbVpDMWllWFJsWTI5a1pTdGljR1prWTNKbFpITTZTazlIV2pOR1FUWkJPVXd5TWprM1NrRlVORVpHVGpaRFNsVTROMHhMVkVsWk5sZ3hXa2RMVjBvd1Z6QllURXRaTUV0UVZEVlpTMVJDUWtWQlIxTkdOUT09In19fQ== + .dockerconfigjson: eyJhdXRocyI6eyJxdWF5LmlvIjp7InVzZXJuYW1lIjoiYnBmbWFuLWJ5dGVjb2RlK2JwZm1hbmNyZWRzIiwicGFzc3dvcmQiOiJENDlDS1dJMU1NT0ZHUkNBVDhTSFc1QTU2RlNWUDMwVEdZWDU0QkJXS1kySjEyOVhSSTZRNVRWSDJaWkdUSjFNIiwiYXV0aCI6IlluQm1iV0Z1TFdKNWRHVmpiMlJsSzJKd1ptMWhibU55WldSek9rUTBPVU5MVjBreFRVMVBSa2RTUTBGVU9GTklWelZCTlRaR1UxWlFNekJVUjFsWU5UUkNRbGRMV1RKS01USTVXRkpKTmxFMVZGWklNbHBhUjFSS01VMD0ifX19 ` require.NoError(t, clusters.ApplyManifestByYAML(ctx, env.Cluster(), xdpPassPrivateSecretYAML)) @@ -50,7 +50,7 @@ data: xdpPassPrivateXdpProgramYAML := `--- --- -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -69,18 +69,18 @@ spec: imagepullsecret: name: regcred namespace: default - url: quay.io/bpfd-bytecode/xdp_pass_private:latest + url: quay.io/bpfman-bytecode/xdp_pass_private:latest ` t.Log("deploying private xdp pass bpf program") require.NoError(t, clusters.ApplyManifestByYAML(ctx, env.Cluster(), xdpPassPrivateXdpProgramYAML)) addCleanup(func(ctx context.Context) error { - cleanupLog("cleaning up xdp pass private bpfd program") + cleanupLog("cleaning up xdp pass private bpfman program") return clusters.DeleteManifestByYAML(ctx, env.Cluster(), xdpPassPrivateXdpProgramYAML) }) // Make sure the bpfProgram was successfully deployed - require.NoError(t, bpfdHelpers.WaitForBpfProgConfLoad(bpfdClient, "xdp-pass-private-all-nodes", time.Duration(time.Second*10), bpfdHelpers.Xdp)) + require.NoError(t, bpfmanHelpers.WaitForBpfProgConfLoad(bpfmanClient, "xdp-pass-private-all-nodes", time.Duration(time.Second*10), bpfmanHelpers.Xdp)) t.Log("private xdp pass bpf program successfully deployed") } diff --git a/bpfd/Cargo.toml b/bpfman/Cargo.toml similarity index 91% rename from bpfd/Cargo.toml rename to bpfman/Cargo.toml index 0f83a6215..e961f44b3 100644 --- a/bpfd/Cargo.toml +++ b/bpfman/Cargo.toml @@ -2,12 +2,12 @@ description = "A system daemon for loading BPF programs" edition = "2021" license = "Apache-2.0" -name = "bpfd" -repository = "https://github.com/bpfd-dev/bpfd" +name = "bpfman" +repository = "https://github.com/bpfman/bpfman" version = "0.3.1" [[bin]] -name = "bpfd" +name = "bpfman" path = "src/main.rs" [dependencies] @@ -15,8 +15,8 @@ anyhow = { workspace = true, features = ["std"] } async-trait = { workspace = true } aya = { workspace = true } base16ct = { workspace = true, features = ["alloc"] } -bpfd-api = { workspace = true } -bpfd-csi = { workspace = true } +bpfman-api = { workspace = true } +bpfman-csi = { workspace = true } caps = { workspace = true } chrono = { workspace = true } clap = { workspace = true, features = ["derive", "std"] } diff --git a/bpfd/src/bpf.rs b/bpfman/src/bpf.rs similarity index 89% rename from bpfd/src/bpf.rs rename to bpfman/src/bpf.rs index cbf47198e..6fd4105b6 100644 --- a/bpfd/src/bpf.rs +++ b/bpfman/src/bpf.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{ collections::HashMap, @@ -15,7 +15,7 @@ use aya::{ }, BpfLoader, }; -use bpfd_api::{ +use bpfman_api::{ config::Config, util::directories::*, ProbeType::{self, *}, @@ -36,7 +36,7 @@ use crate::{ Direction::{Egress, Ingress}, Program, ProgramData, PullBytecodeArgs, TcProgram, UnloadArgs, }, - errors::BpfdError, + errors::BpfmanError, multiprog::{Dispatcher, DispatcherId, DispatcherInfo, TcDispatcher, XdpDispatcher}, oci_utils::image_manager::Command as ImageManagerCommand, serve::shutdown_handler, @@ -119,7 +119,7 @@ impl ProgramMap { b.priority(), b.attached().unwrap(), b.data() - .expect("All Bpfd programs should have ProgramData") + .expect("All Bpfman programs should have ProgramData") .name() .to_owned(), ) @@ -133,9 +133,9 @@ impl ProgramMap { self.programs.values().map(|p| { let kernel_info = p .data() - .expect("All Bpfd programs should have ProgramData") + .expect("All Bpfman programs should have ProgramData") .kernel_info() - .expect("Loaded Bpfd programs should have kernel information"); + .expect("Loaded Bpfman programs should have kernel information"); (kernel_info.id, p) }) @@ -194,7 +194,7 @@ impl BpfManager { while let Some(entry) = programs_dir.next_entry().await? { let id = entry.file_name().to_string_lossy().parse().unwrap(); let mut program = Program::load(id) - .map_err(|e| BpfdError::Error(format!("cant read program state {e}")))?; + .map_err(|e| BpfmanError::Error(format!("cant read program state {e}")))?; // TODO: Should probably check for pinned prog on bpffs rather than assuming they are attached program.set_attached(); debug!("rebuilding state for program {}", id); @@ -270,7 +270,10 @@ impl BpfManager { Ok(()) } - pub(crate) async fn add_program(&mut self, mut program: Program) -> Result { + pub(crate) async fn add_program( + &mut self, + mut program: Program, + ) -> Result { let map_owner_id = program.data()?.map_owner_id(); // Set map_pin_path if we're using another program's maps if let Some(map_owner_id) = map_owner_id { @@ -309,7 +312,7 @@ impl BpfManager { ); // Now that program is successfully loaded, update the id, maps hash table, - // and allow access to all maps by bpfd group members. + // and allow access to all maps by bpfman group members. self.save_map(&mut program, id, map_owner_id).await?; // Only add program to bpfManager if we've completed all mutations and it's successfully loaded. @@ -334,7 +337,7 @@ impl BpfManager { pub(crate) async fn add_multi_attach_program( &mut self, program: &mut Program, - ) -> Result { + ) -> Result { debug!("BpfManager::add_multi_attach_program()"); let name = program.data()?.name(); @@ -348,16 +351,16 @@ impl BpfManager { match ext_loader.program_mut(name) { Some(_) => Ok(()), - None => Err(BpfdError::BpfFunctionNameNotValid(name.to_owned())), + None => Err(BpfmanError::BpfFunctionNameNotValid(name.to_owned())), }?; let did = program .dispatcher_id() - .ok_or(BpfdError::DispatcherNotRequired)?; + .ok_or(BpfmanError::DispatcherNotRequired)?; let next_available_id = self.dispatchers.attached_programs(&did); if next_available_id >= 10 { - return Err(BpfdError::TooManyPrograms); + return Err(BpfmanError::TooManyPrograms); } debug!("next_available_id={next_available_id}"); @@ -402,7 +405,7 @@ impl BpfManager { if let Some(info) = program.kernel_info() { program .delete(info.id) - .map_err(BpfdError::BpfdProgramDeleteError)?; + .map_err(BpfmanError::BpfmanProgramDeleteError)?; } Err(e) })?; @@ -416,7 +419,7 @@ impl BpfManager { program.set_attached(); program .save(id) - .map_err(|e| BpfdError::Error(format!("unable to save program state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("unable to save program state: {e}")))?; Ok(id) } @@ -424,7 +427,7 @@ impl BpfManager { pub(crate) async fn add_single_attach_program( &mut self, p: &mut Program, - ) -> Result { + ) -> Result { debug!("BpfManager::add_single_attach_program()"); let name = p.data()?.name(); let mut bpf = BpfLoader::new(); @@ -449,13 +452,13 @@ impl BpfManager { let raw_program = loader .program_mut(name) - .ok_or(BpfdError::BpfFunctionNameNotValid(name.to_owned()))?; + .ok_or(BpfmanError::BpfFunctionNameNotValid(name.to_owned()))?; let res = match p { Program::Tracepoint(ref mut program) => { let parts: Vec<&str> = program.tracepoint.split('/').collect(); if parts.len() != 2 { - return Err(BpfdError::InvalidAttach(program.tracepoint.to_string())); + return Err(BpfmanError::InvalidAttach(program.tracepoint.to_string())); } let category = parts[0].to_owned(); let name = parts[1].to_owned(); @@ -478,11 +481,11 @@ impl BpfManager { fd_link .pin(format!("{RTDIR_FS}/prog_{}_link", id)) - .map_err(BpfdError::UnableToPinLink)?; + .map_err(BpfmanError::UnableToPinLink)?; tracepoint .pin(format!("{RTDIR_FS}/prog_{id}")) - .map_err(BpfdError::UnableToPinProgram)?; + .map_err(BpfmanError::UnableToPinProgram)?; Ok(id) } @@ -493,7 +496,7 @@ impl BpfManager { }; if requested_probe_type == Kretprobe && program.offset != 0 { - return Err(BpfdError::Error(format!( + return Err(BpfmanError::Error(format!( "offset not allowed for {Kretprobe}" ))); } @@ -505,7 +508,7 @@ impl BpfManager { // user requested let loaded_probe_type = ProbeType::from(kprobe.kind()); if requested_probe_type != loaded_probe_type { - return Err(BpfdError::Error(format!( + return Err(BpfmanError::Error(format!( "expected {requested_probe_type}, loaded program is {loaded_probe_type}" ))); } @@ -525,11 +528,11 @@ impl BpfManager { fd_link .pin(format!("{RTDIR_FS}/prog_{}_link", id)) - .map_err(BpfdError::UnableToPinLink)?; + .map_err(BpfmanError::UnableToPinLink)?; kprobe .pin(format!("{RTDIR_FS}/prog_{id}")) - .map_err(BpfdError::UnableToPinProgram)?; + .map_err(BpfmanError::UnableToPinProgram)?; Ok(id) } @@ -546,7 +549,7 @@ impl BpfManager { // user requested let loaded_probe_type = ProbeType::from(uprobe.kind()); if requested_probe_type != loaded_probe_type { - return Err(BpfdError::Error(format!( + return Err(BpfmanError::Error(format!( "expected {requested_probe_type}, loaded program is {loaded_probe_type}" ))); } @@ -571,11 +574,11 @@ impl BpfManager { fd_link .pin(format!("{RTDIR_FS}/prog_{}_link", id)) - .map_err(BpfdError::UnableToPinLink)?; + .map_err(BpfmanError::UnableToPinLink)?; uprobe .pin(format!("{RTDIR_FS}/prog_{id}")) - .map_err(BpfdError::UnableToPinProgram)?; + .map_err(BpfmanError::UnableToPinProgram)?; Ok(id) } @@ -599,20 +602,22 @@ impl BpfManager { map_pin_path.join(name).display() ); map.pin(map_pin_path.join(name)) - .map_err(BpfdError::UnableToPinMap)?; + .map_err(BpfmanError::UnableToPinMap)?; } } p.save(id) // we might want to log or ignore this error instead of returning here... // because otherwise it will hide the original error (from res above) - .map_err(|_| BpfdError::Error("unable to persist program data".to_string()))?; + .map_err(|_| { + BpfmanError::Error("unable to persist program data".to_string()) + })?; } Err(_) => { // If kernel ID was never set there's no pins to cleanup here so just continue if let Some(info) = p.kernel_info() { p.delete(info.id) - .map_err(BpfdError::BpfdProgramDeleteError)?; + .map_err(BpfmanError::BpfmanProgramDeleteError)?; }; } }; @@ -620,13 +625,13 @@ impl BpfManager { res } - pub(crate) async fn remove_program(&mut self, id: u32) -> Result<(), BpfdError> { + pub(crate) async fn remove_program(&mut self, id: u32) -> Result<(), BpfmanError> { info!("Removing program with id: {id}"); let mut prog = match self.programs.remove(&id) { Some(p) => p, None => { - return Err(BpfdError::Error(format!( - "Program {0} does not exist or was not created by bpfd", + return Err(BpfmanError::Error(format!( + "Program {0} does not exist or was not created by bpfman", id, ))); } @@ -634,7 +639,8 @@ impl BpfManager { let map_owner_id = prog.data()?.map_owner_id(); - prog.delete(id).map_err(BpfdError::BpfdProgramDeleteError)?; + prog.delete(id) + .map_err(BpfmanError::BpfmanProgramDeleteError)?; match prog { Program::Xdp(_) | Program::Tc(_) => self.remove_multi_attach_program(&mut prog).await?, @@ -651,12 +657,12 @@ impl BpfManager { pub(crate) async fn remove_multi_attach_program( &mut self, program: &mut Program, - ) -> Result<(), BpfdError> { + ) -> Result<(), BpfmanError> { debug!("BpfManager::remove_multi_attach_program()"); let did = program .dispatcher_id() - .ok_or(BpfdError::DispatcherNotRequired)?; + .ok_or(BpfmanError::DispatcherNotRequired)?; let next_available_id = self.dispatchers.attached_programs(&did) - 1; debug!("next_available_id = {next_available_id}"); @@ -710,7 +716,7 @@ impl BpfManager { &mut self, mut filter_prog: Program, did: DispatcherId, - ) -> Result<(), BpfdError> { + ) -> Result<(), BpfmanError> { let program_type = filter_prog.kind(); let if_index = filter_prog.if_index(); let direction = filter_prog.direction(); @@ -733,7 +739,7 @@ impl BpfManager { if programs.is_empty() { return old.delete(true); } else if programs.len() > 10 { - return Err(BpfdError::TooManyPrograms); + return Err(BpfmanError::TooManyPrograms); } let if_name = old.if_name(); @@ -764,21 +770,21 @@ impl BpfManager { Ok(()) } - pub(crate) fn list_programs(&mut self) -> Result, BpfdError> { + pub(crate) fn list_programs(&mut self) -> Result, BpfmanError> { debug!("BpfManager::list_programs()"); - // Get an iterator for the bpfd load programs, a hash map indexed by program id. - let mut bpfd_progs: HashMap = self.programs.get_programs_iter().collect(); + // Get an iterator for the bpfman load programs, a hash map indexed by program id. + let mut bpfman_progs: HashMap = self.programs.get_programs_iter().collect(); // Call Aya to get ALL the loaded eBPF programs, and loop through each one. loaded_programs() .map(|p| { - let prog = p.map_err(BpfdError::BpfProgramError)?; + let prog = p.map_err(BpfmanError::BpfProgramError)?; let prog_id = prog.id(); - // If the program was loaded by bpfd (check the hash map), then us it. + // If the program was loaded by bpfman (check the hash map), then us it. // Otherwise, convert the data returned from Aya into an Unsupported Program Object. - match bpfd_progs.remove(&prog_id) { + match bpfman_progs.remove(&prog_id) { Some(p) => Ok(p.to_owned()), None => Ok(Program::Unsupported(prog.try_into()?)), } @@ -786,9 +792,9 @@ impl BpfManager { .collect() } - pub(crate) fn get_program(&mut self, id: u32) -> Result { + pub(crate) fn get_program(&mut self, id: u32) -> Result { debug!("Getting program with id: {id}"); - // If the program was loaded by bpfd, then use it. + // If the program was loaded by bpfman, then use it. // Otherwise, call Aya to get ALL the loaded eBPF programs, and convert the data // returned from Aya into an Unsupported Program Object. match self.programs.get(&id) { @@ -802,7 +808,10 @@ impl BpfManager { None } }) - .ok_or(BpfdError::Error(format!("Program {0} does not exist", id))), + .ok_or(BpfmanError::Error(format!( + "Program {0} does not exist", + id + ))), } } @@ -822,7 +831,7 @@ impl BpfManager { info!("Successfully pulled bytecode"); Ok(()) } - Err(e) => Err(e).map_err(|e| BpfdError::BpfBytecodeError(e.into())), + Err(e) => Err(e).map_err(|e| BpfmanError::BpfBytecodeError(e.into())), }; let _ = args.responder.send(res); Ok(()) @@ -871,14 +880,16 @@ impl BpfManager { } // This function checks to see if the user provided map_owner_id is valid. - fn is_map_owner_id_valid(&mut self, map_owner_id: u32) -> Result { + fn is_map_owner_id_valid(&mut self, map_owner_id: u32) -> Result { let map_pin_path = calc_map_pin_path(map_owner_id); if self.maps.contains_key(&map_owner_id) { // Return the map_pin_path return Ok(map_pin_path); } - Err(BpfdError::Error("map_owner_id does not exists".to_string())) + Err(BpfmanError::Error( + "map_owner_id does not exists".to_string(), + )) } // This function is called if the program's map directory was created, @@ -892,11 +903,11 @@ impl BpfManager { &mut self, map_pin_path: &Path, map_owner_id: Option, - ) -> Result<(), BpfdError> { + ) -> Result<(), BpfmanError> { if map_owner_id.is_none() { let _ = fs::remove_dir_all(map_pin_path) .await - .map_err(|e| BpfdError::Error(format!("can't delete map dir: {e}"))); + .map_err(|e| BpfmanError::Error(format!("can't delete map dir: {e}"))); Ok(()) } else { Ok(()) @@ -905,7 +916,7 @@ impl BpfManager { // This function writes the map to the map hash table. If this eBPF // program is the map owner, then a new entry is add to the map hash - // table and permissions on the directory are updated to grant bpfd + // table and permissions on the directory are updated to grant bpfman // user group access to all the maps in the directory. If this eBPF // program is not the owner, then the eBPF program ID is added to // the Used-By array. @@ -916,7 +927,7 @@ impl BpfManager { program: &mut Program, id: u32, map_owner_id: Option, - ) -> Result<(), BpfdError> { + ) -> Result<(), BpfmanError> { let data = program.data_mut()?; match map_owner_id { @@ -934,14 +945,16 @@ impl BpfManager { if let Ok(data) = program.data_mut() { data.set_maps_used_by(Some(map.used_by.clone())); } else { - return Err(BpfdError::Error( + return Err(BpfmanError::Error( "unable to retrieve data for {id}".to_string(), )); } } } } else { - return Err(BpfdError::Error("map_owner_id does not exists".to_string())); + return Err(BpfmanError::Error( + "map_owner_id does not exists".to_string(), + )); } } None => { @@ -957,14 +970,14 @@ impl BpfManager { if let Some(path) = map_pin_path.to_str() { set_dir_permissions(path, MAPS_MODE).await; } else { - return Err(BpfdError::Error(format!( + return Err(BpfmanError::Error(format!( "invalid map_pin_path {} for {}", map_pin_path.display(), id ))); } } else { - return Err(BpfdError::Error(format!( + return Err(BpfmanError::Error(format!( "map_pin_path should be set for {}", id ))); @@ -981,7 +994,7 @@ impl BpfManager { // directory is removed. If this eBPF program is referencing a // map from another eBPF program, then this eBPF programs ID // is removed from the UsedBy array. - async fn delete_map(&mut self, id: u32, map_owner_id: Option) -> Result<(), BpfdError> { + async fn delete_map(&mut self, id: u32, map_owner_id: Option) -> Result<(), BpfmanError> { let index = match map_owner_id { Some(i) => i, None => id, @@ -998,7 +1011,7 @@ impl BpfManager { self.maps.remove(&index.clone()); fs::remove_dir_all(path) .await - .map_err(|e| BpfdError::Error(format!("can't delete map dir: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("can't delete map dir: {e}")))?; } else { // Update all the programs still using the same map with the updated map_used_by. for id in map.used_by.iter() { @@ -1010,7 +1023,9 @@ impl BpfManager { } } } else { - return Err(BpfdError::Error("map_pin_path does not exists".to_string())); + return Err(BpfmanError::Error( + "map_pin_path does not exists".to_string(), + )); } Ok(()) @@ -1065,7 +1080,7 @@ impl BpfManager { } // map_pin_path is a the directory the maps are located. Currently, it -// is a fixed bpfd location containing the map_index, which is a ID. +// is a fixed bpfman location containing the map_index, which is a ID. // The ID is either the programs ID, or the ID of another program // that map_owner_id references. pub fn calc_map_pin_path(id: u32) -> PathBuf { @@ -1073,8 +1088,8 @@ pub fn calc_map_pin_path(id: u32) -> PathBuf { } // Create the map_pin_path for a given program. -pub async fn create_map_pin_path(p: &Path) -> Result<(), BpfdError> { +pub async fn create_map_pin_path(p: &Path) -> Result<(), BpfmanError> { fs::create_dir_all(p) .await - .map_err(|e| BpfdError::Error(format!("can't create map dir: {e}"))) + .map_err(|e| BpfmanError::Error(format!("can't create map dir: {e}"))) } diff --git a/bpfd/src/command.rs b/bpfman/src/command.rs similarity index 93% rename from bpfd/src/command.rs rename to bpfman/src/command.rs index faccb43cd..b9f0c284d 100644 --- a/bpfd/src/command.rs +++ b/bpfman/src/command.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman //! Commands between the RPC thread and the BPF thread use std::{ @@ -10,7 +10,7 @@ use std::{ }; use aya::programs::ProgramInfo as AyaProgInfo; -use bpfd_api::{ +use bpfman_api::{ util::directories::{RTDIR_FS, RTDIR_PROGRAMS}, v1::{ attach_info::Info, bytecode_location::Location as V1Location, AttachInfo, BytecodeLocation, @@ -25,7 +25,7 @@ use serde::{Deserialize, Serialize}; use tokio::sync::{mpsc::Sender, oneshot}; use crate::{ - errors::BpfdError, + errors::BpfmanError, multiprog::{DispatcherId, DispatcherInfo}, oci_utils::image_manager::{BytecodeImage, Command as ImageManagerCommand}, }; @@ -41,7 +41,7 @@ pub(crate) enum Command { Load(LoadArgs), Unload(UnloadArgs), List { - responder: Responder, BpfdError>>, + responder: Responder, BpfmanError>>, }, Get(GetArgs), PullBytecode(PullBytecodeArgs), @@ -50,7 +50,7 @@ pub(crate) enum Command { #[derive(Debug)] pub(crate) struct LoadArgs { pub(crate) program: Program, - pub(crate) responder: Responder>, + pub(crate) responder: Responder>, } #[derive(Debug, Serialize, Deserialize, Clone)] @@ -66,19 +66,19 @@ pub(crate) enum Program { #[derive(Debug)] pub(crate) struct UnloadArgs { pub(crate) id: u32, - pub(crate) responder: Responder>, + pub(crate) responder: Responder>, } #[derive(Debug)] pub(crate) struct GetArgs { pub(crate) id: u32, - pub(crate) responder: Responder>, + pub(crate) responder: Responder>, } #[derive(Debug)] pub(crate) struct PullBytecodeArgs { pub(crate) image: BytecodeImage, - pub(crate) responder: Responder>, + pub(crate) responder: Responder>, } #[derive(Debug, Serialize, Deserialize, Clone)] @@ -99,7 +99,7 @@ impl Location { async fn get_program_bytes( &self, image_manager: Sender, - ) -> Result<(Vec, String), BpfdError> { + ) -> Result<(Vec, String), BpfmanError> { match self { Location::File(l) => Ok((crate::utils::read(l).await?, "".to_owned())), Location::Image(l) => { @@ -113,21 +113,21 @@ impl Location { resp: tx, }) .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let (path, bpf_function_name) = rx .await - .map_err(BpfdError::RpcError)? - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(BpfmanError::RpcError)? + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let (tx, rx) = oneshot::channel(); image_manager .send(ImageManagerCommand::GetBytecode { path, resp: tx }) .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let bytecode = rx .await - .map_err(BpfdError::RpcError)? - .map_err(|e| BpfdError::Error(format!("Bytecode loading error: {e}")))?; + .map_err(BpfmanError::RpcError)? + .map_err(|e| BpfmanError::Error(format!("Bytecode loading error: {e}")))?; Ok((bytecode, bpf_function_name)) } @@ -184,7 +184,7 @@ pub(crate) struct KernelProgramInfo { } impl TryFrom for KernelProgramInfo { - type Error = BpfdError; + type Error = BpfmanError; fn try_from(prog: AyaProgInfo) -> Result { Ok(KernelProgramInfo { @@ -199,19 +199,19 @@ impl TryFrom for KernelProgramInfo { .to_string(), tag: format!("{:x}", prog.tag()), gpl_compatible: prog.gpl_compatible(), - map_ids: prog.map_ids().map_err(BpfdError::BpfProgramError)?, + map_ids: prog.map_ids().map_err(BpfmanError::BpfProgramError)?, btf_id: prog.btf_id().map_or(0, |n| n.into()), bytes_xlated: prog.size_translated(), jited: prog.size_jitted() != 0, bytes_jited: prog.size_jitted(), - bytes_memlock: prog.memory_locked().map_err(BpfdError::BpfProgramError)?, + bytes_memlock: prog.memory_locked().map_err(BpfmanError::BpfProgramError)?, verified_insns: prog.verified_instruction_count(), }) } } impl TryFrom<&Program> for V1ProgramInfo { - type Error = BpfdError; + type Error = BpfmanError; fn try_from(program: &Program) -> Result { let data = program.data()?; @@ -220,7 +220,7 @@ impl TryFrom<&Program> for V1ProgramInfo { Some(l) => match l { crate::command::Location::Image(m) => { Some(BytecodeLocation { - location: Some(V1Location::Image(bpfd_api::v1::BytecodeImage { + location: Some(V1Location::Image(bpfman_api::v1::BytecodeImage { url: m.get_url().to_string(), image_pull_policy: m.get_pull_policy().to_owned() as i32, // Never dump Plaintext Credentials @@ -272,7 +272,7 @@ impl TryFrom<&Program> for V1ProgramInfo { }, }; - // Populate the Program Info with bpfd data + // Populate the Program Info with bpfman data Ok(V1ProgramInfo { name: data.name().to_owned(), bytecode, @@ -291,11 +291,11 @@ impl TryFrom<&Program> for V1ProgramInfo { } impl TryFrom<&Program> for V1KernelProgramInfo { - type Error = BpfdError; + type Error = BpfmanError; fn try_from(program: &Program) -> Result { // Get the Kernel Info. - let kernel_info = program.kernel_info().ok_or(BpfdError::Error( + let kernel_info = program.kernel_info().ok_or(BpfmanError::Error( "program kernel info not available".to_string(), ))?; @@ -319,7 +319,7 @@ impl TryFrom<&Program> for V1KernelProgramInfo { } /// ProgramInfo stores information about bpf programs that are loaded and managed -/// by bpfd. +/// by bpfman. #[derive(Debug, Serialize, Deserialize, Clone, Default)] pub(crate) struct ProgramData { // known at load time, set by user @@ -421,7 +421,7 @@ impl ProgramData { pub(crate) async fn set_program_bytes( &mut self, image_manager: Sender, - ) -> Result<(), BpfdError> { + ) -> Result<(), BpfmanError> { match self.location.get_program_bytes(image_manager).await { Err(e) => Err(e), Ok((v, s)) => { @@ -439,7 +439,7 @@ impl ProgramData { if provided_name.is_empty() { self.name = s; } else if s != provided_name { - return Err(BpfdError::BytecodeMetaDataMismatch { + return Err(BpfmanError::BytecodeMetaDataMismatch { image_prog_name: s, provided_prog_name: provided_name, }); @@ -626,27 +626,27 @@ impl Program { } } - pub(crate) fn data_mut(&mut self) -> Result<&mut ProgramData, BpfdError> { + pub(crate) fn data_mut(&mut self) -> Result<&mut ProgramData, BpfmanError> { match self { Program::Xdp(p) => Ok(&mut p.data), Program::Tracepoint(p) => Ok(&mut p.data), Program::Tc(p) => Ok(&mut p.data), Program::Kprobe(p) => Ok(&mut p.data), Program::Uprobe(p) => Ok(&mut p.data), - Program::Unsupported(_) => Err(BpfdError::Error( + Program::Unsupported(_) => Err(BpfmanError::Error( "Unsupported program type has no ProgramData".to_string(), )), } } - pub(crate) fn data(&self) -> Result<&ProgramData, BpfdError> { + pub(crate) fn data(&self) -> Result<&ProgramData, BpfmanError> { match self { Program::Xdp(p) => Ok(&p.data), Program::Tracepoint(p) => Ok(&p.data), Program::Tc(p) => Ok(&p.data), Program::Kprobe(p) => Ok(&p.data), Program::Uprobe(p) => Ok(&p.data), - Program::Unsupported(_) => Err(BpfdError::Error( + Program::Unsupported(_) => Err(BpfmanError::Error( "Unsupported program type has no ProgramData".to_string(), )), } diff --git a/bpfd/src/dispatcher_config.rs b/bpfman/src/dispatcher_config.rs similarity index 98% rename from bpfd/src/dispatcher_config.rs rename to bpfman/src/dispatcher_config.rs index 6c6751824..4e75889f4 100644 --- a/bpfd/src/dispatcher_config.rs +++ b/bpfman/src/dispatcher_config.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman // XDP Defines // pub (crate) const XDP_METADATA_SECTION: &str = "xdp_metadata"; diff --git a/bpfd/src/errors.rs b/bpfman/src/errors.rs similarity index 93% rename from bpfd/src/errors.rs rename to bpfman/src/errors.rs index ac07dbaa8..be5bbe854 100644 --- a/bpfd/src/errors.rs +++ b/bpfman/src/errors.rs @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use thiserror::Error; use tokio::sync::oneshot; #[derive(Debug, Error)] -pub enum BpfdError { +pub enum BpfmanError { #[error("An error occurred. {0}")] Error(String), #[error(transparent)] @@ -38,7 +38,7 @@ pub enum BpfdError { provided_prog_name: String, }, #[error("Unable to delete program {0}")] - BpfdProgramDeleteError(#[source] anyhow::Error), + BpfmanProgramDeleteError(#[source] anyhow::Error), #[error(transparent)] RpcError(#[from] oneshot::error::RecvError), #[error("Failed to pin map {0}")] diff --git a/bpfd/src/main.rs b/bpfman/src/main.rs similarity index 89% rename from bpfd/src/main.rs rename to bpfman/src/main.rs index 746c78780..924ed5297 100644 --- a/bpfd/src/main.rs +++ b/bpfman/src/main.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{ env, @@ -21,7 +21,7 @@ mod storage; mod utils; use anyhow::{bail, Context}; -use bpfd_api::{config::Config, util::directories::*}; +use bpfman_api::{config::Config, util::directories::*}; use clap::Parser; use log::{debug, error, info, warn}; use nix::{ @@ -33,7 +33,7 @@ use systemd_journal_logger::{connected_to_journal, JournalLog}; use utils::{create_bpffs, set_dir_permissions}; use crate::{serve::serve, utils::read_to_string}; -const BPFD_ENV_LOG_LEVEL: &str = "RUST_LOG"; +const BPFMAN_ENV_LOG_LEVEL: &str = "RUST_LOG"; #[derive(Parser)] #[clap(author, version, about, long_about = None)] @@ -53,7 +53,7 @@ fn main() -> anyhow::Result<()> { .block_on(async { let args = Args::parse(); if connected_to_journal() { - // If bpfd is running as a service, log to journald. + // If bpfman is running as a service, log to journald. JournalLog::default() .with_extra_fields(vec![("VERSION", env!("CARGO_PKG_VERSION"))]) .install() @@ -71,7 +71,7 @@ fn main() -> anyhow::Result<()> { setrlimit(Resource::RLIMIT_MEMLOCK, RLIM_INFINITY, RLIM_INFINITY).unwrap(); - // Create directories associated with bpfd + // Create directories associated with bpfman create_dir_all(RTDIR).context("unable to create runtime directory")?; create_dir_all(RTDIR_FS).context("unable to create mountpoint")?; create_dir_all(RTDIR_TC_INGRESS_DISPATCHER) @@ -91,8 +91,8 @@ fn main() -> anyhow::Result<()> { create_dir_all(RTDIR_FS_TC_EGRESS) .context("unable to create tc egress dispatcher dir")?; create_dir_all(RTDIR_FS_MAPS).context("unable to create maps directory")?; - create_dir_all(RTDIR_BPFD_CSI).context("unable to create CSI directory")?; - create_dir_all(RTDIR_BPFD_CSI_FS).context("unable to create socket directory")?; + create_dir_all(RTDIR_BPFMAN_CSI).context("unable to create CSI directory")?; + create_dir_all(RTDIR_BPFMAN_CSI_FS).context("unable to create socket directory")?; create_dir_all(CFGDIR_STATIC_PROGRAMS) .context("unable to create static programs directory")?; @@ -104,7 +104,7 @@ fn main() -> anyhow::Result<()> { set_dir_permissions(RTDIR, RTDIR_MODE).await; set_dir_permissions(STDIR, STDIR_MODE).await; - let config = if let Ok(c) = read_to_string(CFGPATH_BPFD_CONFIG).await { + let config = if let Ok(c) = read_to_string(CFGPATH_BPFMAN_CONFIG).await { c.parse().unwrap_or_else(|_| { warn!("Unable to parse config file, using defaults"); Config::default() @@ -123,8 +123,8 @@ fn manage_journal_log_level() { // env_logger uses the environment variable RUST_LOG to set the log // level. Parse RUST_LOG to set the log level for journald. log::set_max_level(log::LevelFilter::Error); - if env::var(BPFD_ENV_LOG_LEVEL).is_ok() { - let rust_log = log::LevelFilter::from_str(&env::var(BPFD_ENV_LOG_LEVEL).unwrap()); + if env::var(BPFMAN_ENV_LOG_LEVEL).is_ok() { + let rust_log = log::LevelFilter::from_str(&env::var(BPFMAN_ENV_LOG_LEVEL).unwrap()); match rust_log { Ok(value) => log::set_max_level(value), Err(e) => log::error!("Invalid Log Level: {}", e), @@ -157,7 +157,7 @@ fn drop_linux_capabilities() { } }; - if res.name == "bpfd" { + if res.name == "bpfman" { debug!( "Running as user {}, dropping all capabilities for spawned threads", res.name @@ -185,7 +185,7 @@ fn is_bpffs_mounted() -> Result { if parts.len() != 6 { bail!("expected 6 parts in proc mount") } - if parts[0] == "none" && parts[1].contains("bpfd") && parts[2] == "bpf" { + if parts[0] == "none" && parts[1].contains("bpfman") && parts[2] == "bpf" { return Ok(true); } } diff --git a/bpfd/src/multiprog/mod.rs b/bpfman/src/multiprog/mod.rs similarity index 83% rename from bpfd/src/multiprog/mod.rs rename to bpfman/src/multiprog/mod.rs index f9199e3d7..fc1dad522 100644 --- a/bpfd/src/multiprog/mod.rs +++ b/bpfman/src/multiprog/mod.rs @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman mod tc; mod xdp; -use bpfd_api::{ +use bpfman_api::{ config::{InterfaceConfig, XdpMode}, ProgramType, }; @@ -15,7 +15,7 @@ pub use xdp::XdpDispatcher; use crate::{ command::{Direction, Program}, - errors::BpfdError, + errors::BpfmanError, oci_utils::image_manager::Command as ImageManagerCommand, }; @@ -31,17 +31,17 @@ impl Dispatcher { revision: u32, old_dispatcher: Option, image_manager: Sender, - ) -> Result { + ) -> Result { debug!("Dispatcher::new()"); let p = programs .first() - .ok_or_else(|| BpfdError::Error("No programs to load".to_string()))?; + .ok_or_else(|| BpfmanError::Error("No programs to load".to_string()))?; let if_index = p .if_index() - .ok_or_else(|| BpfdError::Error("missing ifindex".to_string()))?; + .ok_or_else(|| BpfmanError::Error("missing ifindex".to_string()))?; let if_name = p .if_name() - .ok_or_else(|| BpfdError::Error("missing ifname".to_string()))?; + .ok_or_else(|| BpfmanError::Error("missing ifname".to_string()))?; let direction = p.direction(); let xdp_mode = if let Some(c) = config { c.xdp_mode @@ -63,8 +63,8 @@ impl Dispatcher { Dispatcher::Xdp(x) } ProgramType::Tc => { - let direction = - direction.ok_or_else(|| BpfdError::Error("direction required".to_string()))?; + let direction = direction + .ok_or_else(|| BpfmanError::Error("direction required".to_string()))?; let t = TcDispatcher::new( direction, &if_index, @@ -77,12 +77,12 @@ impl Dispatcher { .await?; Dispatcher::Tc(t) } - _ => return Err(BpfdError::DispatcherNotRequired), + _ => return Err(BpfmanError::DispatcherNotRequired), }; Ok(d) } - pub(crate) fn delete(&mut self, full: bool) -> Result<(), BpfdError> { + pub(crate) fn delete(&mut self, full: bool) -> Result<(), BpfmanError> { debug!("Dispatcher::delete()"); match self { Dispatcher::Xdp(d) => d.delete(full), diff --git a/bpfd/src/multiprog/tc.rs b/bpfman/src/multiprog/tc.rs similarity index 90% rename from bpfd/src/multiprog/tc.rs rename to bpfman/src/multiprog/tc.rs index 37b06f7d3..b4a61f11f 100644 --- a/bpfd/src/multiprog/tc.rs +++ b/bpfman/src/multiprog/tc.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{fs, io::BufReader, mem}; @@ -11,7 +11,7 @@ use aya::{ }, Bpf, BpfLoader, }; -use bpfd_api::{util::directories::*, ImagePullPolicy}; +use bpfman_api::{util::directories::*, ImagePullPolicy}; use futures::stream::TryStreamExt; use log::debug; use netlink_packet_route::tc::Nla; @@ -27,7 +27,7 @@ use crate::{ Program, TcProgram, }, dispatcher_config::TcDispatcherConfig, - errors::BpfdError, + errors::BpfmanError, oci_utils::image_manager::{BytecodeImage, Command as ImageManagerCommand}, utils::should_map_be_pinned, }; @@ -58,7 +58,7 @@ impl TcDispatcher { revision: u32, old_dispatcher: Option, image_manager: Sender, - ) -> Result { + ) -> Result { debug!("TcDispatcher::new() for if_index {if_index}, revision {revision}"); let mut extensions: Vec<&mut TcProgram> = programs .iter_mut() @@ -80,7 +80,7 @@ impl TcDispatcher { debug!("tc dispatcher config: {:?}", config); let image = BytecodeImage::new( - "quay.io/bpfd/tc-dispatcher:v1".to_string(), + "quay.io/bpfman/tc-dispatcher:v1".to_string(), ImagePullPolicy::IfNotPresent as i32, None, None, @@ -95,22 +95,22 @@ impl TcDispatcher { resp: tx, }) .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let (path, bpf_function_name) = rx .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))? - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))? + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let (tx, rx) = oneshot::channel(); image_manager .send(ImageManagerCommand::GetBytecode { path, resp: tx }) .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let program_bytes = rx .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))? - .map_err(BpfdError::BpfBytecodeError)?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))? + .map_err(BpfmanError::BpfBytecodeError)?; let mut loader = BpfLoader::new() .set_global("CONFIG", &config, true) @@ -161,7 +161,7 @@ impl TcDispatcher { Ok(false) } - async fn attach(&mut self, old_dispatcher: Option) -> Result<(), BpfdError> { + async fn attach(&mut self, old_dispatcher: Option) -> Result<(), BpfmanError> { debug!( "TcDispatcher::attach() for if_index {}, revision {}", self.if_index, self.revision @@ -182,7 +182,7 @@ impl TcDispatcher { // if ingress qdisc exists, return error. } else if TcDispatcher::has_qdisc("ingress".to_string(), self.if_index as i32).await? { debug!("ingress qdisc found for if_index {}", self.if_index); - return Err(BpfdError::InvalidAttach(format!( + return Err(BpfmanError::InvalidAttach(format!( "Ingress qdisc found for if_index {}", self.if_index ))); @@ -199,7 +199,7 @@ impl TcDispatcher { let new_dispatcher: &mut SchedClassifier = self .loader .as_mut() - .ok_or(BpfdError::NotLoaded)? + .ok_or(BpfmanError::NotLoaded)? .program_mut(self.program_name.clone().unwrap().as_str()) .unwrap() .try_into()?; @@ -240,7 +240,7 @@ impl TcDispatcher { async fn attach_extensions( &mut self, extensions: &mut [&mut TcProgram], - ) -> Result<(), BpfdError> { + ) -> Result<(), BpfmanError> { debug!( "TcDispatcher::attach_extensions() for if_index {}, revision {}", self.if_index, self.revision @@ -249,7 +249,7 @@ impl TcDispatcher { let dispatcher: &mut SchedClassifier = self .loader .as_mut() - .ok_or(BpfdError::NotLoaded)? + .ok_or(BpfmanError::NotLoaded)? .program_mut(self.program_name.clone().unwrap().as_str()) .unwrap() .try_into()?; @@ -274,7 +274,7 @@ impl TcDispatcher { Direction::Egress => RTDIR_FS_TC_EGRESS, }; let path = format!("{base}/dispatcher_{if_index}_{}/link_{id}", self.revision); - new_link.pin(path).map_err(BpfdError::UnableToPinLink)?; + new_link.pin(path).map_err(BpfmanError::UnableToPinLink)?; } else { let name = v.data.name(); let global_data = v.data.global_data(); @@ -296,11 +296,11 @@ impl TcDispatcher { let mut loader = bpf .load(v.data.program_bytes()) - .map_err(BpfdError::BpfLoadError)?; + .map_err(BpfmanError::BpfLoadError)?; let ext: &mut Extension = loader .program_mut(name) - .ok_or_else(|| BpfdError::BpfFunctionNameNotValid(name.to_string()))? + .ok_or_else(|| BpfmanError::BpfFunctionNameNotValid(name.to_string()))? .try_into()?; let target_fn = format!("prog{i}"); @@ -315,7 +315,7 @@ impl TcDispatcher { .id; ext.pin(format!("{RTDIR_FS}/prog_{id}")) - .map_err(BpfdError::UnableToPinProgram)?; + .map_err(BpfmanError::UnableToPinProgram)?; let new_link_id = ext.attach()?; let new_link = ext.take_link(new_link_id)?; let fd_link: FdLink = new_link.into(); @@ -328,7 +328,7 @@ impl TcDispatcher { "{base}/dispatcher_{if_index}_{}/link_{id}", self.revision, )) - .map_err(BpfdError::UnableToPinLink)?; + .map_err(BpfmanError::UnableToPinLink)?; // If this program is the map(s) owner pin all maps (except for .rodata and .bss) by name. if v.data.map_pin_path().is_none() { @@ -345,7 +345,7 @@ impl TcDispatcher { map_pin_path.join(name).display() ); map.pin(map_pin_path.join(name)) - .map_err(BpfdError::UnableToPinMap)?; + .map_err(BpfmanError::UnableToPinMap)?; } } } @@ -353,7 +353,7 @@ impl TcDispatcher { Ok(()) } - fn save(&self) -> Result<(), BpfdError> { + fn save(&self) -> Result<(), BpfmanError> { debug!( "TcDispatcher::save() for if_index {}, revision {}", self.if_index, self.revision @@ -364,7 +364,7 @@ impl TcDispatcher { }; let path = format!("{base}/{}_{}", self.if_index, self.revision); serde_json::to_writer(&fs::File::create(path).unwrap(), &self) - .map_err(|e| BpfdError::Error(format!("can't save state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("can't save state: {e}")))?; Ok(()) } @@ -386,7 +386,7 @@ impl TcDispatcher { Ok(prog) } - pub(crate) fn delete(&mut self, full: bool) -> Result<(), BpfdError> { + pub(crate) fn delete(&mut self, full: bool) -> Result<(), BpfmanError> { debug!( "TcDispatcher::delete() for if_index {}, revision {}", self.if_index, self.revision @@ -397,7 +397,7 @@ impl TcDispatcher { }; let path = format!("{base}/{}_{}", self.if_index, self.revision); fs::remove_file(path) - .map_err(|e| BpfdError::Error(format!("unable to cleanup state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("unable to cleanup state: {e}")))?; let base = match self.direction { Direction::Ingress => RTDIR_FS_TC_INGRESS, @@ -405,7 +405,7 @@ impl TcDispatcher { }; let path = format!("{base}/dispatcher_{}_{}", self.if_index, self.revision); fs::remove_dir_all(path) - .map_err(|e| BpfdError::Error(format!("unable to cleanup state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("unable to cleanup state: {e}")))?; if full { // Also detach the old dispatcher. diff --git a/bpfd/src/multiprog/xdp.rs b/bpfman/src/multiprog/xdp.rs similarity index 85% rename from bpfd/src/multiprog/xdp.rs rename to bpfman/src/multiprog/xdp.rs index 97d994d5e..ffcb7f486 100644 --- a/bpfd/src/multiprog/xdp.rs +++ b/bpfman/src/multiprog/xdp.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{fs, io::BufReader, path::PathBuf}; @@ -10,7 +10,7 @@ use aya::{ }, Bpf, BpfLoader, }; -use bpfd_api::{config::XdpMode, util::directories::*, ImagePullPolicy}; +use bpfman_api::{config::XdpMode, util::directories::*, ImagePullPolicy}; use log::debug; use serde::{Deserialize, Serialize}; use tokio::sync::{mpsc::Sender, oneshot}; @@ -20,7 +20,7 @@ use crate::{ bpf::{calc_map_pin_path, create_map_pin_path}, command::{Program, XdpProgram}, dispatcher_config::XdpDispatcherConfig, - errors::BpfdError, + errors::BpfmanError, oci_utils::image_manager::{BytecodeImage, Command as ImageManagerCommand}, utils::should_map_be_pinned, }; @@ -48,7 +48,7 @@ impl XdpDispatcher { revision: u32, old_dispatcher: Option, image_manager: Sender, - ) -> Result { + ) -> Result { debug!("XdpDispatcher::new() for if_index {if_index}, revision {revision}"); let mut extensions: Vec<&mut XdpProgram> = programs .iter_mut() @@ -74,7 +74,7 @@ impl XdpDispatcher { debug!("xdp dispatcher config: {:?}", config); let image = BytecodeImage::new( - "quay.io/bpfd/xdp-dispatcher:v2".to_string(), + "quay.io/bpfman/xdp-dispatcher:v2".to_string(), ImagePullPolicy::IfNotPresent as i32, None, None, @@ -89,22 +89,22 @@ impl XdpDispatcher { resp: tx, }) .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let (path, bpf_function_name) = rx .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))? - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))? + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let (tx, rx) = oneshot::channel(); image_manager .send(ImageManagerCommand::GetBytecode { path, resp: tx }) .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))?; let program_bytes = rx .await - .map_err(|e| BpfdError::BpfBytecodeError(e.into()))? - .map_err(BpfdError::BpfBytecodeError)?; + .map_err(|e| BpfmanError::BpfBytecodeError(e.into()))? + .map_err(BpfmanError::BpfBytecodeError)?; let mut loader = BpfLoader::new() .set_global("conf", &config, true) .load(&program_bytes)?; @@ -134,7 +134,7 @@ impl XdpDispatcher { Ok(dispatcher) } - pub(crate) fn attach(&mut self) -> Result<(), BpfdError> { + pub(crate) fn attach(&mut self) -> Result<(), BpfmanError> { debug!( "XdpDispatcher::attach() for if_index {}, revision {}", self.if_index, self.revision @@ -144,7 +144,7 @@ impl XdpDispatcher { let dispatcher: &mut Xdp = self .loader .as_mut() - .ok_or(BpfdError::NotLoaded)? + .ok_or(BpfmanError::NotLoaded)? .program_mut(self.program_name.clone().unwrap().as_str()) .unwrap() .try_into()?; @@ -163,7 +163,7 @@ impl XdpDispatcher { let _ = TryInto::::try_into(owned_link) .unwrap() // TODO: Don't unwrap, although due to minimum kernel version this shouldn't ever panic .pin(path) - .map_err(BpfdError::UnableToPinLink)?; + .map_err(BpfmanError::UnableToPinLink)?; } Ok(()) } @@ -171,7 +171,7 @@ impl XdpDispatcher { async fn attach_extensions( &mut self, extensions: &mut [&mut XdpProgram], - ) -> Result<(), BpfdError> { + ) -> Result<(), BpfmanError> { debug!( "XdpDispatcher::attach_extensions() for if_index {}, revision {}", self.if_index, self.revision @@ -180,7 +180,7 @@ impl XdpDispatcher { let dispatcher: &mut Xdp = self .loader .as_mut() - .ok_or(BpfdError::NotLoaded)? + .ok_or(BpfmanError::NotLoaded)? .program_mut(self.program_name.clone().unwrap().as_str()) .unwrap() .try_into()?; @@ -202,7 +202,7 @@ impl XdpDispatcher { "{RTDIR_FS_XDP}/dispatcher_{if_index}_{}/link_{id}", self.revision ); - new_link.pin(path).map_err(BpfdError::UnableToPinLink)?; + new_link.pin(path).map_err(BpfmanError::UnableToPinLink)?; } else { let name = v.data.name(); let global_data = v.data.global_data(); @@ -224,11 +224,11 @@ impl XdpDispatcher { let mut loader = bpf .load(v.data.program_bytes()) - .map_err(BpfdError::BpfLoadError)?; + .map_err(BpfmanError::BpfLoadError)?; let ext: &mut Extension = loader .program_mut(name) - .ok_or_else(|| BpfdError::BpfFunctionNameNotValid(name.to_string()))? + .ok_or_else(|| BpfmanError::BpfFunctionNameNotValid(name.to_string()))? .try_into()?; let target_fn = format!("prog{i}"); @@ -243,7 +243,7 @@ impl XdpDispatcher { .id; ext.pin(format!("{RTDIR_FS}/prog_{id}")) - .map_err(BpfdError::UnableToPinProgram)?; + .map_err(BpfmanError::UnableToPinProgram)?; let new_link_id = ext.attach()?; let new_link = ext.take_link(new_link_id)?; let fd_link: FdLink = new_link.into(); @@ -252,7 +252,7 @@ impl XdpDispatcher { "{RTDIR_FS_XDP}/dispatcher_{if_index}_{}/link_{id}", self.revision, )) - .map_err(BpfdError::UnableToPinLink)?; + .map_err(BpfmanError::UnableToPinLink)?; // If this program is the map(s) owner pin all maps (except for .rodata and .bss) by name. if v.data.map_pin_path().is_none() { @@ -269,7 +269,7 @@ impl XdpDispatcher { map_pin_path.join(name).display() ); map.pin(map_pin_path.join(name)) - .map_err(BpfdError::UnableToPinMap)?; + .map_err(BpfmanError::UnableToPinMap)?; } } } @@ -277,14 +277,14 @@ impl XdpDispatcher { Ok(()) } - fn save(&self) -> Result<(), BpfdError> { + fn save(&self) -> Result<(), BpfmanError> { debug!( "XdpDispatcher::save() for if_index {}, revision {}", self.if_index, self.revision ); let path = format!("{RTDIR_XDP_DISPATCHER}/{}_{}", self.if_index, self.revision); serde_json::to_writer(&fs::File::create(path).unwrap(), &self) - .map_err(|e| BpfdError::Error(format!("can't save state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("can't save state: {e}")))?; Ok(()) } @@ -298,25 +298,25 @@ impl XdpDispatcher { Ok(prog) } - pub(crate) fn delete(&self, full: bool) -> Result<(), BpfdError> { + pub(crate) fn delete(&self, full: bool) -> Result<(), BpfmanError> { debug!( "XdpDispatcher::delete() for if_index {}, revision {}", self.if_index, self.revision ); let path = format!("{RTDIR_XDP_DISPATCHER}/{}_{}", self.if_index, self.revision); fs::remove_file(path) - .map_err(|e| BpfdError::Error(format!("unable to cleanup state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("unable to cleanup state: {e}")))?; let path = format!( "{RTDIR_FS_XDP}/dispatcher_{}_{}", self.if_index, self.revision ); fs::remove_dir_all(path) - .map_err(|e| BpfdError::Error(format!("unable to cleanup state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("unable to cleanup state: {e}")))?; if full { let path_link = format!("{RTDIR_FS_XDP}/dispatcher_{}_link", self.if_index); fs::remove_file(path_link) - .map_err(|e| BpfdError::Error(format!("unable to cleanup state: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("unable to cleanup state: {e}")))?; } Ok(()) } diff --git a/bpfd/src/oci_utils/cosign.rs b/bpfman/src/oci_utils/cosign.rs similarity index 99% rename from bpfd/src/oci_utils/cosign.rs rename to bpfman/src/oci_utils/cosign.rs index 16b70745a..2ec75df8d 100644 --- a/bpfd/src/oci_utils/cosign.rs +++ b/bpfman/src/oci_utils/cosign.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::str::FromStr; diff --git a/bpfd/src/oci_utils/image_manager.rs b/bpfman/src/oci_utils/image_manager.rs similarity index 97% rename from bpfd/src/oci_utils/image_manager.rs rename to bpfman/src/oci_utils/image_manager.rs index 9bc0b9635..2bffde7b6 100644 --- a/bpfd/src/oci_utils/image_manager.rs +++ b/bpfman/src/oci_utils/image_manager.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{ fs, @@ -9,7 +9,7 @@ use std::{ }; use anyhow::Context; -use bpfd_api::ImagePullPolicy; +use bpfman_api::ImagePullPolicy; use flate2::read::GzDecoder; use log::{debug, info, trace}; use oci_distribution::{ @@ -80,8 +80,8 @@ impl BytecodeImage { } } -impl From for BytecodeImage { - fn from(value: bpfd_api::v1::BytecodeImage) -> Self { +impl From for BytecodeImage { + fn from(value: bpfman_api::v1::BytecodeImage) -> Self { // This function is mapping an empty string to None for // username and password. let username = if value.username.is_some() { @@ -523,7 +523,7 @@ mod tests { let (path, _) = mgr .get_image( - "quay.io/bpfd-bytecode/xdp_pass:latest", + "quay.io/bpfman-bytecode/xdp_pass:latest", ImagePullPolicy::Always, None, None, @@ -551,7 +551,7 @@ mod tests { let mut mgr = ImageManager::new(&tmpdir, true, rx).await.unwrap(); mgr.get_image( - "quay.io/bpfd-bytecode/xdp_pass_private:latest", + "quay.io/bpfman-bytecode/xdp_pass_private:latest", ImagePullPolicy::Always, None, None, @@ -569,10 +569,10 @@ mod tests { let (path, _) = mgr .get_image( - "quay.io/bpfd-bytecode/xdp_pass_private:latest", + "quay.io/bpfman-bytecode/xdp_pass_private:latest", ImagePullPolicy::Always, - Some("bpfd-bytecode+bpfdcreds".to_owned()), - Some("JOGZ3FA6A9L2297JAT4FFN6CJU87LKTIY6X1ZGKWJ0W0XLKY0KPT5YKTBBEAGSF5".to_owned()), + Some("bpfman-bytecode+bpfmancreds".to_owned()), + Some("D49CKWI1MMOFGRCAT8SHW5A56FSVP30TGYX54BBWKY2J129XRI6Q5TVH2ZZGTJ1M".to_owned()), ) .await .expect("failed to pull bytecode"); @@ -597,7 +597,7 @@ mod tests { let result = mgr .get_image( - "quay.io/bpfd-bytecode/xdp_pass:latest", + "quay.io/bpfman-bytecode/xdp_pass:latest", ImagePullPolicy::Never, None, None, diff --git a/bpfd/src/oci_utils/mod.rs b/bpfman/src/oci_utils/mod.rs similarity index 96% rename from bpfd/src/oci_utils/mod.rs rename to bpfman/src/oci_utils/mod.rs index 16911d1dc..986ffd42d 100644 --- a/bpfd/src/oci_utils/mod.rs +++ b/bpfman/src/oci_utils/mod.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman pub(crate) mod cosign; pub(crate) mod image_manager; diff --git a/bpfd/src/rpc.rs b/bpfman/src/rpc.rs similarity index 91% rename from bpfd/src/rpc.rs rename to bpfman/src/rpc.rs index 7f929acef..d4c41e7e2 100644 --- a/bpfd/src/rpc.rs +++ b/bpfman/src/rpc.rs @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd -use bpfd_api::{ +// Copyright Authors of bpfman +use bpfman_api::{ v1::{ - attach_info::Info, bpfd_server::Bpfd, bytecode_location::Location, + attach_info::Info, bpfman_server::Bpfman, bytecode_location::Location, list_response::ListResult, GetRequest, GetResponse, KprobeAttachInfo, ListRequest, ListResponse, LoadRequest, LoadResponse, PullBytecodeRequest, PullBytecodeResponse, TcAttachInfo, TracepointAttachInfo, UnloadRequest, UnloadResponse, UprobeAttachInfo, @@ -20,18 +20,18 @@ use crate::command::{ }; #[derive(Debug)] -pub struct BpfdLoader { +pub struct BpfmanLoader { tx: Sender, } -impl BpfdLoader { - pub(crate) fn new(tx: mpsc::Sender) -> BpfdLoader { - BpfdLoader { tx } +impl BpfmanLoader { + pub(crate) fn new(tx: mpsc::Sender) -> BpfmanLoader { + BpfmanLoader { tx } } } #[tonic::async_trait] -impl Bpfd for BpfdLoader { +impl Bpfman for BpfmanLoader { async fn load(&self, request: Request) -> Result, Status> { let request = request.into_inner(); @@ -138,7 +138,7 @@ impl Bpfd for BpfdLoader { Ok(Response::new(reply_entry)) } Err(e) => { - warn!("BPFD load error: {:#?}", e); + warn!("BPFMAN load error: {:#?}", e); Err(Status::aborted(format!("{e}"))) } }, @@ -172,7 +172,7 @@ impl Bpfd for BpfdLoader { Ok(res) => match res { Ok(_) => Ok(Response::new(reply)), Err(e) => { - warn!("BPFD unload error: {}", e); + warn!("BPFMAN unload error: {}", e); Err(Status::aborted(format!("{e}"))) } }, @@ -213,7 +213,7 @@ impl Bpfd for BpfdLoader { Ok(Response::new(reply_entry)) } Err(e) => { - warn!("BPFD get error: {}", e); + warn!("BPFMAN get error: {}", e); Err(Status::aborted(format!("{e}"))) } }, @@ -246,15 +246,15 @@ impl Bpfd for BpfdLoader { } match r.data() { - // If filtering on `bpfd Only`, this program is of type Unsupported so skip + // If filtering on `bpfman Only`, this program is of type Unsupported so skip Err(_) => { - if request.get_ref().bpfd_programs_only() + if request.get_ref().bpfman_programs_only() || !request.get_ref().match_metadata.is_empty() { continue; } } - // Bpfd Program + // Bpfman Program Ok(data) => { // Filter on the input metadata field if provided let mut meta_match = true; @@ -292,7 +292,7 @@ impl Bpfd for BpfdLoader { Ok(Response::new(reply)) } Err(e) => { - warn!("BPFD list error: {}", e); + warn!("BPFMAN list error: {}", e); Err(Status::aborted(format!("{e}"))) } }, @@ -328,7 +328,7 @@ impl Bpfd for BpfdLoader { Ok(Response::new(reply)) } Err(e) => { - warn!("BPFD pull_bytecode error: {:#?}", e); + warn!("BPFMAN pull_bytecode error: {:#?}", e); Err(Status::aborted(format!("{e}"))) } }, @@ -343,7 +343,7 @@ impl Bpfd for BpfdLoader { #[cfg(test)] mod test { - use bpfd_api::v1::{ + use bpfman_api::v1::{ bytecode_location::Location, AttachInfo, BytecodeLocation, LoadRequest, XdpAttachInfo, }; use tokio::sync::mpsc::Receiver; @@ -354,7 +354,7 @@ mod test { #[tokio::test] async fn test_load_with_valid_id() { let (tx, rx) = mpsc::channel(32); - let loader = BpfdLoader::new(tx.clone()); + let loader = BpfmanLoader::new(tx.clone()); let attach_info = AttachInfo { info: Some(Info::XdpAttachInfo(XdpAttachInfo { @@ -366,8 +366,8 @@ mod test { }; let request = LoadRequest { bytecode: Some(BytecodeLocation { - location: Some(Location::Image(bpfd_api::v1::BytecodeImage { - url: "quay.io/bpfd-bytecode/xdp:latest".to_string(), + location: Some(Location::Image(bpfman_api::v1::BytecodeImage { + url: "quay.io/bpfman-bytecode/xdp:latest".to_string(), ..Default::default() })), ..Default::default() @@ -387,12 +387,12 @@ mod test { #[tokio::test] async fn test_pull_bytecode() { let (tx, rx) = mpsc::channel(32); - let loader = BpfdLoader::new(tx.clone()); + let loader = BpfmanLoader::new(tx.clone()); let request = PullBytecodeRequest { - image: Some(bpfd_api::v1::BytecodeImage { - url: String::from("quay.io/bpfd-bytecode/xdp_pass:latest"), - image_pull_policy: bpfd_api::ImagePullPolicy::Always.into(), + image: Some(bpfman_api::v1::BytecodeImage { + url: String::from("quay.io/bpfman-bytecode/xdp_pass:latest"), + image_pull_policy: bpfman_api::ImagePullPolicy::Always.into(), username: Some(String::from("someone")), password: Some(String::from("secret")), }), diff --git a/bpfd/src/serve.rs b/bpfman/src/serve.rs similarity index 94% rename from bpfd/src/serve.rs rename to bpfman/src/serve.rs index d3a4c596e..bd9558349 100644 --- a/bpfd/src/serve.rs +++ b/bpfman/src/serve.rs @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{fs::remove_file, path::Path}; -use bpfd_api::{ +use bpfman_api::{ config::{self, Config}, util::directories::STDIR_BYTECODE_IMAGE_CONTENT_STORE, - v1::bpfd_server::BpfdServer, + v1::bpfman_server::BpfmanServer, }; use log::{debug, info}; use tokio::{ @@ -23,7 +23,7 @@ use tonic::transport::Server; use crate::{ bpf::BpfManager, oci_utils::ImageManager, - rpc::BpfdLoader, + rpc::BpfmanLoader, static_program::get_static_programs, storage::StorageManager, utils::{set_file_permissions, SOCK_MODE}, @@ -36,8 +36,8 @@ pub async fn serve( ) -> anyhow::Result<()> { let (tx, rx) = mpsc::channel(32); - let loader = BpfdLoader::new(tx.clone()); - let service = BpfdServer::new(loader); + let loader = BpfmanLoader::new(tx.clone()); + let service = BpfmanServer::new(loader); let mut listeners: Vec<_> = Vec::new(); @@ -131,7 +131,7 @@ async fn join_listeners(listeners: Vec>) { async fn serve_unix( path: String, - service: BpfdServer, + service: BpfmanServer, ) -> anyhow::Result> { // Listen on Unix socket if Path::new(&path).exists() { diff --git a/bpfd/src/static_program.rs b/bpfman/src/static_program.rs similarity index 94% rename from bpfd/src/static_program.rs rename to bpfman/src/static_program.rs index 54c287668..2fd306fe9 100644 --- a/bpfd/src/static_program.rs +++ b/bpfman/src/static_program.rs @@ -1,12 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{ collections::HashMap, path::{Path, PathBuf}, }; use anyhow::bail; -use bpfd_api::{util::directories::CFGDIR_STATIC_PROGRAMS, ProgramType, TcProceedOn, XdpProceedOn}; +use bpfman_api::{ + util::directories::CFGDIR_STATIC_PROGRAMS, ProgramType, TcProceedOn, XdpProceedOn, +}; use log::{info, warn}; use serde::Deserialize; use tokio::fs; @@ -221,21 +223,21 @@ mod test { [[programs]] name = "pass" - bytecode_image = { image_url = "quay.io/bpfd-bytecode/xdp_pass:latest", image_pull_policy="Always" } + bytecode_image = { image_url = "quay.io/bpfman-bytecode/xdp_pass:latest", image_pull_policy="Always" } global_data = { } program_type ="Xdp" xdp_attach = { iface = "eth0", priority = 55, proceed_on = [], position=0 } [[programs]] name = "counter" - bytecode_image = { image_url = "quay.io/bpfd-bytecode/xdp_pass:latest", image_pull_policy="Always" } + bytecode_image = { image_url = "quay.io/bpfman-bytecode/xdp_pass:latest", image_pull_policy="Always" } global_data = { } program_type ="Tc" tc_attach = { iface = "eth0", priority = 55, proceed_on = [], position=0, direction="Ingress" } [[programs]] name = "tracepoint" - bytecode_image = { image_url = "quay.io/bpfd-bytecode/tracepoint:latest", image_pull_policy="Always" } + bytecode_image = { image_url = "quay.io/bpfman-bytecode/tracepoint:latest", image_pull_policy="Always" } global_data = { } program_type ="Tracepoint" tracepoint_attach = { tracepoint = "syscalls/sys_enter_openat" } diff --git a/bpfd/src/storage.rs b/bpfman/src/storage.rs similarity index 93% rename from bpfd/src/storage.rs rename to bpfman/src/storage.rs index 0077bf922..3d9685637 100644 --- a/bpfd/src/storage.rs +++ b/bpfman/src/storage.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{ collections::HashMap, @@ -10,8 +10,8 @@ use std::{ use anyhow::{Context, Result}; use async_trait::async_trait; use aya::maps::MapData; -use bpfd_api::util::directories::{RTDIR_BPFD_CSI_FS, RTPATH_BPFD_CSI_SOCKET}; -use bpfd_csi::v1::{ +use bpfman_api::util::directories::{RTDIR_BPFMAN_CSI_FS, RTPATH_BPFMAN_CSI_SOCKET}; +use bpfman_csi::v1::{ identity_server::{Identity, IdentityServer}, node_server::{Node, NodeServer}, node_service_capability, GetPluginCapabilitiesRequest, GetPluginCapabilitiesResponse, @@ -38,10 +38,10 @@ use crate::{ utils::{create_bpffs, set_dir_permissions, set_file_permissions, SOCK_MODE}, }; -const DRIVER_NAME: &str = "csi.bpfd.dev"; -const MAPS_KEY: &str = "csi.bpfd.dev/maps"; -const PROGRAM_KEY: &str = "csi.bpfd.dev/program"; -const OPERATOR_PROGRAM_KEY: &str = "bpfd.dev/ProgramName"; +const DRIVER_NAME: &str = "csi.bpfman.io"; +const MAPS_KEY: &str = "csi.bpfman.io/maps"; +const PROGRAM_KEY: &str = "csi.bpfman.io/program"; +const OPERATOR_PROGRAM_KEY: &str = "bpfman.io/ProgramName"; // Node Publish Volume Error code constant mirrored from: https://github.com/container-storage-interface/spec/blob/master/spec.md#nodepublishvolume-errors const NPV_NOT_FOUND: i32 = 5; const OWNER_READ_WRITE: u32 = 0o0750; @@ -160,7 +160,7 @@ impl Node for CsiNode { }) .ok_or(Status::new( NPV_NOT_FOUND.into(), - format!("Bpfd Program {program_name} not found"), + format!("Bpfman Program {program_name} not found"), ))?; Ok(prog_data .data().expect("program data is valid because we just checked it") @@ -170,12 +170,12 @@ impl Node for CsiNode { } Err(_) => Err(Status::new( NPV_NOT_FOUND.into(), - format!("Bpfd Program {program_name} not found"), + format!("Bpfman Program {program_name} not found"), )), }, Err(_) => Err(Status::new( NPV_NOT_FOUND.into(), - format!("Unable to list bpfd programs {program_name} not found"), + format!("Unable to list bpfman programs {program_name} not found"), )), }?; @@ -192,7 +192,7 @@ impl Node for CsiNode { } // Make a new bpf fs specifically for the pod. - let path = &Path::new(RTDIR_BPFD_CSI_FS).join(volume_id); + let path = &Path::new(RTDIR_BPFMAN_CSI_FS).join(volume_id); // Volume_id is unique to the instance of the pod, if it get's restarted it will // be new. @@ -284,7 +284,7 @@ impl Node for CsiNode { })?; // unmount the bpffs - let path = &Path::new(RTDIR_BPFD_CSI_FS).join(volume_id); + let path = &Path::new(RTDIR_BPFMAN_CSI_FS).join(volume_id); unmount(path.to_str().unwrap()).map_err(|e| { Status::new( 5.into(), @@ -346,7 +346,7 @@ impl StorageManager { pub fn new(tx: mpsc::Sender) -> Self { const VERSION: &str = env!("CARGO_PKG_VERSION"); let node_id = std::env::var("KUBE_NODE_NAME") - .expect("cannot start bpfd csi driver if KUBE_NODE_NAME not set"); + .expect("cannot start bpfman csi driver if KUBE_NODE_NAME not set"); let csi_identity = CsiIdentity { name: DRIVER_NAME.to_string(), @@ -362,7 +362,7 @@ impl StorageManager { } pub async fn run(self) { - let path: &Path = Path::new(RTPATH_BPFD_CSI_SOCKET); + let path: &Path = Path::new(RTPATH_BPFMAN_CSI_SOCKET); // Listen on Unix socket if path.exists() { // Attempt to remove the socket, since bind fails if it exists @@ -370,9 +370,9 @@ impl StorageManager { } let uds = UnixListener::bind(path) - .unwrap_or_else(|_| panic!("failed to bind {RTPATH_BPFD_CSI_SOCKET}")); + .unwrap_or_else(|_| panic!("failed to bind {RTPATH_BPFMAN_CSI_SOCKET}")); let uds_stream = UnixListenerStream::new(uds); - set_file_permissions(RTPATH_BPFD_CSI_SOCKET, SOCK_MODE).await; + set_file_permissions(RTPATH_BPFMAN_CSI_SOCKET, SOCK_MODE).await; let node_service = NodeServer::new(self.csi_node); let identity_service = IdentityServer::new(self.csi_identity); diff --git a/bpfd/src/utils.rs b/bpfman/src/utils.rs similarity index 80% rename from bpfd/src/utils.rs rename to bpfman/src/utils.rs index 8c7272615..73cf3327b 100644 --- a/bpfd/src/utils.rs +++ b/bpfman/src/utils.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman use std::{os::unix::fs::PermissionsExt, path::Path, str}; @@ -11,43 +11,43 @@ use nix::{ }; use tokio::{fs, io::AsyncReadExt}; -use crate::errors::BpfdError; +use crate::errors::BpfmanError; -// The bpfd socket should always allow the same users and members of the same group +// The bpfman socket should always allow the same users and members of the same group // to Read/Write to it. pub(crate) const SOCK_MODE: u32 = 0o0660; // Like tokio::fs::read, but with O_NOCTTY set -pub(crate) async fn read>(path: P) -> Result, BpfdError> { +pub(crate) async fn read>(path: P) -> Result, BpfmanError> { let mut data = vec![]; tokio::fs::OpenOptions::new() .custom_flags(nix::libc::O_NOCTTY) .read(true) .open(path) .await - .map_err(|e| BpfdError::Error(format!("can't open file: {e}")))? + .map_err(|e| BpfmanError::Error(format!("can't open file: {e}")))? .read_to_end(&mut data) .await - .map_err(|e| BpfdError::Error(format!("can't read file: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("can't read file: {e}")))?; Ok(data) } // Like tokio::fs::read_to_string, but with O_NOCTTY set -pub(crate) async fn read_to_string>(path: P) -> Result { +pub(crate) async fn read_to_string>(path: P) -> Result { let mut buffer = String::new(); tokio::fs::OpenOptions::new() .custom_flags(nix::libc::O_NOCTTY) .read(true) .open(path) .await - .map_err(|e| BpfdError::Error(format!("can't open file: {e}")))? + .map_err(|e| BpfmanError::Error(format!("can't open file: {e}")))? .read_to_string(&mut buffer) .await - .map_err(|e| BpfdError::Error(format!("can't read file: {e}")))?; + .map_err(|e| BpfmanError::Error(format!("can't read file: {e}")))?; Ok(buffer) } -pub(crate) fn get_ifindex(iface: &str) -> Result { +pub(crate) fn get_ifindex(iface: &str) -> Result { match if_nametoindex(iface) { Ok(index) => { debug!("Map {} to {}", iface, index); @@ -55,7 +55,7 @@ pub(crate) fn get_ifindex(iface: &str) -> Result { } Err(_) => { info!("Unable to validate interface {}", iface); - Err(BpfdError::InvalidInterface) + Err(BpfmanError::InvalidInterface) } } } diff --git a/changelogs/CHANGELOG-v0.1.0.md b/changelogs/CHANGELOG-v0.1.0.md index 7d21afe0b..3c090326a 100644 --- a/changelogs/CHANGELOG-v0.1.0.md +++ b/changelogs/CHANGELOG-v0.1.0.md @@ -1,3 +1,3 @@ # v0.1.0 -Introductory non official bpfd core and GRPC API release. +Introductory non official bpfman core and GRPC API release. diff --git a/changelogs/CHANGELOG-v0.2.0.md b/changelogs/CHANGELOG-v0.2.0.md index 43212a8f3..2147ae258 100644 --- a/changelogs/CHANGELOG-v0.2.0.md +++ b/changelogs/CHANGELOG-v0.2.0.md @@ -1,4 +1,4 @@ -The v0.2.0 release is our first official minor release of the bpfd project. +The v0.2.0 release is our first official minor release of the bpfman project. Major new enhancements include: diff --git a/changelogs/CHANGELOG-v0.2.1.md b/changelogs/CHANGELOG-v0.2.1.md index e9a8d9664..9a00b8c0f 100644 --- a/changelogs/CHANGELOG-v0.2.1.md +++ b/changelogs/CHANGELOG-v0.2.1.md @@ -1,6 +1,6 @@ The v0.2.1 release is a patch release following first official minor release of -the bpfd project (v0.2.0). +the bpfman project (v0.2.0). It includes a single fix (modified version of the changes in #539) which allows the v0.2.X tree to run with newer builds of the -quay.io/bpfd/xdp-dispatcher:v1 container image. \ No newline at end of file +quay.io/bpfman/xdp-dispatcher:v1 container image. diff --git a/changelogs/CHANGELOG-v0.3.0.md b/changelogs/CHANGELOG-v0.3.0.md index b963d156b..3644ef372 100644 --- a/changelogs/CHANGELOG-v0.3.0.md +++ b/changelogs/CHANGELOG-v0.3.0.md @@ -1,16 +1,16 @@ -The v0.3.0 release is our second official minor release of the the bpfd project. +The v0.3.0 release is our second official minor release of the the bpfman project. > **WARNING** -This release contains breaking changes for both the core bpfd GRPC API +This release contains breaking changes for both the core bpfman GRPC API as well as the Kubernetes CRDs. There is no backwards compatibility or guarantees with any of our previous releases at this point. The following describes some of the major new features/updates: - The ability to list and get kernel information for ALL programs regardless -of whether they were loaded by bpfd or another process +of whether they were loaded by bpfman or another process -- Deprecation of bpfd specific UUIDs for each loaded program in favor of the +- Deprecation of bpfman specific UUIDs for each loaded program in favor of the standard generated kernel ID for all programs regardless of what process loaded them. - Support for some new bpf program types: @@ -25,19 +25,19 @@ standard generated kernel ID for all programs regardless of what process loaded * The ability to get a program based on Kernel ID * The ability to load a program with user determined metadata labels which the user can later use to filter via a `bpfctl` list - * Much better formatting and both kernel + bpfd information feedback on `load`, `list` + * Much better formatting and both kernel + bpfman information feedback on `load`, `list` and `get` calls - For maps, multiple programs can now share the same maps via the `map_owner_id` field -allowing for data sharing across various programs which are loaded via bpfd +allowing for data sharing across various programs which are loaded via bpfman -- Removal of the cert-manager dependency in the bpfd kubernetes deployment +- Removal of the cert-manager dependency in the bpfman kubernetes deployment - Preliminary CSI(Container Storage Interface) support which allows applications to receive their maps in kubernetes applications with a simple custom volume type ## New Contributors -* @maryamtahhan made their first contribution in https://github.com/bpfd-dev/bpfd/pull/540 -* @navarrothiago made their first contribution in https://github.com/bpfd-dev/bpfd/pull/720 +* @maryamtahhan made their first contribution in https://github.com/bpfman/bpfman/pull/540 +* @navarrothiago made their first contribution in https://github.com/bpfman/bpfman/pull/720 -**Full Changelog**: https://github.com/bpfd-dev/bpfd/compare/v0.2.1...v0.3.0 \ No newline at end of file +**Full Changelog**: https://github.com/bpfman/bpfman/compare/v0.2.1...v0.3.0 diff --git a/changelogs/CHANGELOG-v0.3.1.md b/changelogs/CHANGELOG-v0.3.1.md index e544b0b26..8ccb003aa 100644 --- a/changelogs/CHANGELOG-v0.3.1.md +++ b/changelogs/CHANGELOG-v0.3.1.md @@ -1,5 +1,5 @@ The v0.3.1 release is a patch release which includes some bug fixes and makes -the ability for BPF enabled applications to receive their maps via bpfd's +the ability for BPF enabled applications to receive their maps via bpfman's custom CSI plugin default. This enablement means that most applications can now access their maps **WITHOUT** @@ -10,7 +10,7 @@ The CSI feature still requires a privileged application on distributions which enable SELinux by default (i.e Red Hat Openshift). Therefore we've shipped a set of deployment configs specifically for openshift in this release, see the additional `go--counter-install-ocp-v0.3.1.yaml` artifacts included in the release -payload. Stay tuned to [#829](https://github.com/bpfd-dev/bpfd/issues/829) for +payload. Stay tuned to [#829](https://github.com/bpfman/bpfman/issues/829) for updates. The new yaml syntax that should be used by BPF enabled applications resembles @@ -34,42 +34,42 @@ spec: volumes: - name: bpf-maps csi: - driver: csi.bpfd.dev + driver: csi.bpfman.io volumeAttributes: - csi.bpfd.dev/program: <*Program_Name> - csi.bpfd.dev/maps: + csi.bpfman.io/program: <*Program_Name> + csi.bpfman.io/maps: ``` -Additionally, this release removes all dependencies involved with deploying bpfd +Additionally, this release removes all dependencies involved with deploying bpfman with TLS, which means that cert-manager dependencies are completely removed from the operator, therefore simplifying the deployment considerably. -Lastly, the bpfd user and user group was removed which will only effect users -that run bpfd via a systemd service and try to use `bpfctl` without root +Lastly, the bpfman user and user group was removed which will only effect users +that run bpfman via a systemd service and try to use `bpfctl` without root privileges. This helped reduce internal complexity and allows us to focus instead -on finetuning the permissions of the bpfd process itself, see the [linux -capabilities guide](https://bpfd.dev/developer-guide/linux-capabilities/) for more information. +on finetuning the permissions of the bpfman process itself, see the [linux +capabilities guide](https://bpfman.io/developer-guide/linux-capabilities/) for more information. ## What's Changed (excluding dependency bumps) -* release: automate release yamls by @astoycos in https://github.com/bpfd-dev/bpfd/pull/775 -* bpf: returns an error when adding a tc program to existence clsact qdisc by @navarrothiago in https://github.com/bpfd-dev/bpfd/pull/761 -* workspace-ified the netlink dependencies by @anfredette in https://github.com/bpfd-dev/bpfd/pull/783 -* Don't try and pin .data maps by @astoycos in https://github.com/bpfd-dev/bpfd/pull/794 -* .github: Add actions to dependabot by @dave-tucker in https://github.com/bpfd-dev/bpfd/pull/803 -* Fix Procceedon bug (Issue #791) by @anfredette in https://github.com/bpfd-dev/bpfd/pull/792 -* Add script to delete bpfd qdiscs on all interfaces by @anfredette in https://github.com/bpfd-dev/bpfd/pull/780 -* Fix BPF Licensing by @dave-tucker in https://github.com/bpfd-dev/bpfd/pull/796 -* Fix example bytecode image builds add test coverage by @astoycos in https://github.com/bpfd-dev/bpfd/pull/810 -* Relicense userspace to Apache 2.0 only by @dave-tucker in https://github.com/bpfd-dev/bpfd/pull/795 -* bpfd: Use tc dispatcher from container image by @dave-tucker in https://github.com/bpfd-dev/bpfd/pull/817 -* bpfd: Unify the "run as root" and "run as bpfd user" codepaths by @Billy99 in https://github.com/bpfd-dev/bpfd/pull/777 -* bpfd, bpfctl, operator: Remove support for TCP/TLS by @dave-tucker in https://github.com/bpfd-dev/bpfd/pull/819 -* bpfd-operator: Make the CSI deployment default for bpfd-operator by @Billy99 in https://github.com/bpfd-dev/bpfd/pull/811 -* ci: Add YAML formatter by @dave-tucker in https://github.com/bpfd-dev/bpfd/pull/802 -* Fix some panics + add testing and fix for map sharing by @astoycos in https://github.com/bpfd-dev/bpfd/pull/820 -* bpfd: mount default bpffs on kind by @astoycos in https://github.com/bpfd-dev/bpfd/pull/823 -* bpfd: Remove unused file by @dave-tucker in https://github.com/bpfd-dev/bpfd/pull/824 -* Document valid kernel versions by @Billy99 in https://github.com/bpfd-dev/bpfd/pull/827 -* Update documentation on new YAML Linter by @Billy99 in https://github.com/bpfd-dev/bpfd/pull/830 +* release: automate release yamls by @astoycos in https://github.com/bpfman/bpfman/pull/775 +* bpf: returns an error when adding a tc program to existence clsact qdisc by @navarrothiago in https://github.com/bpfman/bpfman/pull/761 +* workspace-ified the netlink dependencies by @anfredette in https://github.com/bpfman/bpfman/pull/783 +* Don't try and pin .data maps by @astoycos in https://github.com/bpfman/bpfman/pull/794 +* .github: Add actions to dependabot by @dave-tucker in https://github.com/bpfman/bpfman/pull/803 +* Fix Procceedon bug (Issue #791) by @anfredette in https://github.com/bpfman/bpfman/pull/792 +* Add script to delete bpfman qdiscs on all interfaces by @anfredette in https://github.com/bpfman/bpfman/pull/780 +* Fix BPF Licensing by @dave-tucker in https://github.com/bpfman/bpfman/pull/796 +* Fix example bytecode image builds add test coverage by @astoycos in https://github.com/bpfman/bpfman/pull/810 +* Relicense userspace to Apache 2.0 only by @dave-tucker in https://github.com/bpfman/bpfman/pull/795 +* bpfman: Use tc dispatcher from container image by @dave-tucker in https://github.com/bpfman/bpfman/pull/817 +* bpfman: Unify the "run as root" and "run as bpfman user" codepaths by @Billy99 in https://github.com/bpfman/bpfman/pull/777 +* bpfman, bpfctl, operator: Remove support for TCP/TLS by @dave-tucker in https://github.com/bpfman/bpfman/pull/819 +* bpfman-operator: Make the CSI deployment default for bpfman-operator by @Billy99 in https://github.com/bpfman/bpfman/pull/811 +* ci: Add YAML formatter by @dave-tucker in https://github.com/bpfman/bpfman/pull/802 +* Fix some panics + add testing and fix for map sharing by @astoycos in https://github.com/bpfman/bpfman/pull/820 +* bpfman: mount default bpffs on kind by @astoycos in https://github.com/bpfman/bpfman/pull/823 +* bpfman: Remove unused file by @dave-tucker in https://github.com/bpfman/bpfman/pull/824 +* Document valid kernel versions by @Billy99 in https://github.com/bpfman/bpfman/pull/827 +* Update documentation on new YAML Linter by @Billy99 in https://github.com/bpfman/bpfman/pull/830 -**Full Changelog**: https://github.com/bpfd-dev/bpfd/compare/v0.3.0...v0.3.1 +**Full Changelog**: https://github.com/bpfman/bpfman/compare/v0.3.0...v0.3.1 diff --git a/clients/gobpfd/v1/bpfd.pb.go b/clients/gobpfman/v1/bpfman.pb.go similarity index 85% rename from clients/gobpfd/v1/bpfd.pb.go rename to clients/gobpfman/v1/bpfman.pb.go index 580e895a9..744623e09 100644 --- a/clients/gobpfd/v1/bpfd.pb.go +++ b/clients/gobpfman/v1/bpfman.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.28.1 // protoc v3.19.4 -// source: bpfd.proto +// source: bpfman.proto package v1 @@ -34,7 +34,7 @@ type BytecodeImage struct { func (x *BytecodeImage) Reset() { *x = BytecodeImage{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[0] + mi := &file_bpfman_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +47,7 @@ func (x *BytecodeImage) String() string { func (*BytecodeImage) ProtoMessage() {} func (x *BytecodeImage) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[0] + mi := &file_bpfman_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +60,7 @@ func (x *BytecodeImage) ProtoReflect() protoreflect.Message { // Deprecated: Use BytecodeImage.ProtoReflect.Descriptor instead. func (*BytecodeImage) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{0} + return file_bpfman_proto_rawDescGZIP(), []int{0} } func (x *BytecodeImage) GetUrl() string { @@ -108,7 +108,7 @@ type BytecodeLocation struct { func (x *BytecodeLocation) Reset() { *x = BytecodeLocation{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[1] + mi := &file_bpfman_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -121,7 +121,7 @@ func (x *BytecodeLocation) String() string { func (*BytecodeLocation) ProtoMessage() {} func (x *BytecodeLocation) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[1] + mi := &file_bpfman_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -134,7 +134,7 @@ func (x *BytecodeLocation) ProtoReflect() protoreflect.Message { // Deprecated: Use BytecodeLocation.ProtoReflect.Descriptor instead. func (*BytecodeLocation) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{1} + return file_bpfman_proto_rawDescGZIP(), []int{1} } func (m *BytecodeLocation) GetLocation() isBytecodeLocation_Location { @@ -198,7 +198,7 @@ type KernelProgramInfo struct { func (x *KernelProgramInfo) Reset() { *x = KernelProgramInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[2] + mi := &file_bpfman_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -211,7 +211,7 @@ func (x *KernelProgramInfo) String() string { func (*KernelProgramInfo) ProtoMessage() {} func (x *KernelProgramInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[2] + mi := &file_bpfman_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -224,7 +224,7 @@ func (x *KernelProgramInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use KernelProgramInfo.ProtoReflect.Descriptor instead. func (*KernelProgramInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{2} + return file_bpfman_proto_rawDescGZIP(), []int{2} } func (x *KernelProgramInfo) GetId() uint32 { @@ -337,7 +337,7 @@ type ProgramInfo struct { func (x *ProgramInfo) Reset() { *x = ProgramInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[3] + mi := &file_bpfman_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -350,7 +350,7 @@ func (x *ProgramInfo) String() string { func (*ProgramInfo) ProtoMessage() {} func (x *ProgramInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[3] + mi := &file_bpfman_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -363,7 +363,7 @@ func (x *ProgramInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ProgramInfo.ProtoReflect.Descriptor instead. func (*ProgramInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{3} + return file_bpfman_proto_rawDescGZIP(), []int{3} } func (x *ProgramInfo) GetName() string { @@ -436,7 +436,7 @@ type XDPAttachInfo struct { func (x *XDPAttachInfo) Reset() { *x = XDPAttachInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[4] + mi := &file_bpfman_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -449,7 +449,7 @@ func (x *XDPAttachInfo) String() string { func (*XDPAttachInfo) ProtoMessage() {} func (x *XDPAttachInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[4] + mi := &file_bpfman_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -462,7 +462,7 @@ func (x *XDPAttachInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use XDPAttachInfo.ProtoReflect.Descriptor instead. func (*XDPAttachInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{4} + return file_bpfman_proto_rawDescGZIP(), []int{4} } func (x *XDPAttachInfo) GetPriority() int32 { @@ -508,7 +508,7 @@ type TCAttachInfo struct { func (x *TCAttachInfo) Reset() { *x = TCAttachInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[5] + mi := &file_bpfman_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -521,7 +521,7 @@ func (x *TCAttachInfo) String() string { func (*TCAttachInfo) ProtoMessage() {} func (x *TCAttachInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[5] + mi := &file_bpfman_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -534,7 +534,7 @@ func (x *TCAttachInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use TCAttachInfo.ProtoReflect.Descriptor instead. func (*TCAttachInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{5} + return file_bpfman_proto_rawDescGZIP(), []int{5} } func (x *TCAttachInfo) GetPriority() int32 { @@ -583,7 +583,7 @@ type TracepointAttachInfo struct { func (x *TracepointAttachInfo) Reset() { *x = TracepointAttachInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[6] + mi := &file_bpfman_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -596,7 +596,7 @@ func (x *TracepointAttachInfo) String() string { func (*TracepointAttachInfo) ProtoMessage() {} func (x *TracepointAttachInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[6] + mi := &file_bpfman_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -609,7 +609,7 @@ func (x *TracepointAttachInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use TracepointAttachInfo.ProtoReflect.Descriptor instead. func (*TracepointAttachInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{6} + return file_bpfman_proto_rawDescGZIP(), []int{6} } func (x *TracepointAttachInfo) GetTracepoint() string { @@ -633,7 +633,7 @@ type KprobeAttachInfo struct { func (x *KprobeAttachInfo) Reset() { *x = KprobeAttachInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[7] + mi := &file_bpfman_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -646,7 +646,7 @@ func (x *KprobeAttachInfo) String() string { func (*KprobeAttachInfo) ProtoMessage() {} func (x *KprobeAttachInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[7] + mi := &file_bpfman_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -659,7 +659,7 @@ func (x *KprobeAttachInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use KprobeAttachInfo.ProtoReflect.Descriptor instead. func (*KprobeAttachInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{7} + return file_bpfman_proto_rawDescGZIP(), []int{7} } func (x *KprobeAttachInfo) GetFnName() string { @@ -706,7 +706,7 @@ type UprobeAttachInfo struct { func (x *UprobeAttachInfo) Reset() { *x = UprobeAttachInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[8] + mi := &file_bpfman_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -719,7 +719,7 @@ func (x *UprobeAttachInfo) String() string { func (*UprobeAttachInfo) ProtoMessage() {} func (x *UprobeAttachInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[8] + mi := &file_bpfman_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -732,7 +732,7 @@ func (x *UprobeAttachInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use UprobeAttachInfo.ProtoReflect.Descriptor instead. func (*UprobeAttachInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{8} + return file_bpfman_proto_rawDescGZIP(), []int{8} } func (x *UprobeAttachInfo) GetFnName() string { @@ -794,7 +794,7 @@ type AttachInfo struct { func (x *AttachInfo) Reset() { *x = AttachInfo{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[9] + mi := &file_bpfman_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -807,7 +807,7 @@ func (x *AttachInfo) String() string { func (*AttachInfo) ProtoMessage() {} func (x *AttachInfo) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[9] + mi := &file_bpfman_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -820,7 +820,7 @@ func (x *AttachInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use AttachInfo.ProtoReflect.Descriptor instead. func (*AttachInfo) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{9} + return file_bpfman_proto_rawDescGZIP(), []int{9} } func (m *AttachInfo) GetInfo() isAttachInfo_Info { @@ -917,7 +917,7 @@ type LoadRequest struct { func (x *LoadRequest) Reset() { *x = LoadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[10] + mi := &file_bpfman_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -930,7 +930,7 @@ func (x *LoadRequest) String() string { func (*LoadRequest) ProtoMessage() {} func (x *LoadRequest) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[10] + mi := &file_bpfman_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -943,7 +943,7 @@ func (x *LoadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LoadRequest.ProtoReflect.Descriptor instead. func (*LoadRequest) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{10} + return file_bpfman_proto_rawDescGZIP(), []int{10} } func (x *LoadRequest) GetBytecode() *BytecodeLocation { @@ -1014,7 +1014,7 @@ type LoadResponse struct { func (x *LoadResponse) Reset() { *x = LoadResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[11] + mi := &file_bpfman_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1027,7 +1027,7 @@ func (x *LoadResponse) String() string { func (*LoadResponse) ProtoMessage() {} func (x *LoadResponse) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[11] + mi := &file_bpfman_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1040,7 +1040,7 @@ func (x *LoadResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LoadResponse.ProtoReflect.Descriptor instead. func (*LoadResponse) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{11} + return file_bpfman_proto_rawDescGZIP(), []int{11} } func (x *LoadResponse) GetInfo() *ProgramInfo { @@ -1068,7 +1068,7 @@ type UnloadRequest struct { func (x *UnloadRequest) Reset() { *x = UnloadRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[12] + mi := &file_bpfman_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1081,7 +1081,7 @@ func (x *UnloadRequest) String() string { func (*UnloadRequest) ProtoMessage() {} func (x *UnloadRequest) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[12] + mi := &file_bpfman_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1094,7 +1094,7 @@ func (x *UnloadRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnloadRequest.ProtoReflect.Descriptor instead. func (*UnloadRequest) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{12} + return file_bpfman_proto_rawDescGZIP(), []int{12} } func (x *UnloadRequest) GetId() uint32 { @@ -1113,7 +1113,7 @@ type UnloadResponse struct { func (x *UnloadResponse) Reset() { *x = UnloadResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[13] + mi := &file_bpfman_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1126,7 +1126,7 @@ func (x *UnloadResponse) String() string { func (*UnloadResponse) ProtoMessage() {} func (x *UnloadResponse) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[13] + mi := &file_bpfman_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1139,7 +1139,7 @@ func (x *UnloadResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnloadResponse.ProtoReflect.Descriptor instead. func (*UnloadResponse) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{13} + return file_bpfman_proto_rawDescGZIP(), []int{13} } type ListRequest struct { @@ -1148,14 +1148,14 @@ type ListRequest struct { unknownFields protoimpl.UnknownFields ProgramType *uint32 `protobuf:"varint,1,opt,name=program_type,json=programType,proto3,oneof" json:"program_type,omitempty"` - BpfdProgramsOnly *bool `protobuf:"varint,2,opt,name=bpfd_programs_only,json=bpfdProgramsOnly,proto3,oneof" json:"bpfd_programs_only,omitempty"` + BpfmanProgramsOnly *bool `protobuf:"varint,2,opt,name=bpfman_programs_only,json=bpfmanProgramsOnly,proto3,oneof" json:"bpfman_programs_only,omitempty"` MatchMetadata map[string]string `protobuf:"bytes,3,rep,name=match_metadata,json=matchMetadata,proto3" json:"match_metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *ListRequest) Reset() { *x = ListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[14] + mi := &file_bpfman_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1168,7 +1168,7 @@ func (x *ListRequest) String() string { func (*ListRequest) ProtoMessage() {} func (x *ListRequest) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[14] + mi := &file_bpfman_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1181,7 +1181,7 @@ func (x *ListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. func (*ListRequest) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{14} + return file_bpfman_proto_rawDescGZIP(), []int{14} } func (x *ListRequest) GetProgramType() uint32 { @@ -1191,9 +1191,9 @@ func (x *ListRequest) GetProgramType() uint32 { return 0 } -func (x *ListRequest) GetBpfdProgramsOnly() bool { - if x != nil && x.BpfdProgramsOnly != nil { - return *x.BpfdProgramsOnly +func (x *ListRequest) GetBpfmanProgramsOnly() bool { + if x != nil && x.BpfmanProgramsOnly != nil { + return *x.BpfmanProgramsOnly } return false } @@ -1216,7 +1216,7 @@ type ListResponse struct { func (x *ListResponse) Reset() { *x = ListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[15] + mi := &file_bpfman_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1229,7 +1229,7 @@ func (x *ListResponse) String() string { func (*ListResponse) ProtoMessage() {} func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[15] + mi := &file_bpfman_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1242,7 +1242,7 @@ func (x *ListResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. func (*ListResponse) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{15} + return file_bpfman_proto_rawDescGZIP(), []int{15} } func (x *ListResponse) GetResults() []*ListResponse_ListResult { @@ -1263,7 +1263,7 @@ type PullBytecodeRequest struct { func (x *PullBytecodeRequest) Reset() { *x = PullBytecodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[16] + mi := &file_bpfman_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1276,7 +1276,7 @@ func (x *PullBytecodeRequest) String() string { func (*PullBytecodeRequest) ProtoMessage() {} func (x *PullBytecodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[16] + mi := &file_bpfman_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1289,7 +1289,7 @@ func (x *PullBytecodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PullBytecodeRequest.ProtoReflect.Descriptor instead. func (*PullBytecodeRequest) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{16} + return file_bpfman_proto_rawDescGZIP(), []int{16} } func (x *PullBytecodeRequest) GetImage() *BytecodeImage { @@ -1308,7 +1308,7 @@ type PullBytecodeResponse struct { func (x *PullBytecodeResponse) Reset() { *x = PullBytecodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[17] + mi := &file_bpfman_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1321,7 +1321,7 @@ func (x *PullBytecodeResponse) String() string { func (*PullBytecodeResponse) ProtoMessage() {} func (x *PullBytecodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[17] + mi := &file_bpfman_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1334,7 +1334,7 @@ func (x *PullBytecodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PullBytecodeResponse.ProtoReflect.Descriptor instead. func (*PullBytecodeResponse) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{17} + return file_bpfman_proto_rawDescGZIP(), []int{17} } type GetRequest struct { @@ -1348,7 +1348,7 @@ type GetRequest struct { func (x *GetRequest) Reset() { *x = GetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[18] + mi := &file_bpfman_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1361,7 +1361,7 @@ func (x *GetRequest) String() string { func (*GetRequest) ProtoMessage() {} func (x *GetRequest) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[18] + mi := &file_bpfman_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1374,7 +1374,7 @@ func (x *GetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. func (*GetRequest) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{18} + return file_bpfman_proto_rawDescGZIP(), []int{18} } func (x *GetRequest) GetId() uint32 { @@ -1396,7 +1396,7 @@ type GetResponse struct { func (x *GetResponse) Reset() { *x = GetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[19] + mi := &file_bpfman_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1409,7 +1409,7 @@ func (x *GetResponse) String() string { func (*GetResponse) ProtoMessage() {} func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[19] + mi := &file_bpfman_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1422,7 +1422,7 @@ func (x *GetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. func (*GetResponse) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{19} + return file_bpfman_proto_rawDescGZIP(), []int{19} } func (x *GetResponse) GetInfo() *ProgramInfo { @@ -1451,7 +1451,7 @@ type ListResponse_ListResult struct { func (x *ListResponse_ListResult) Reset() { *x = ListResponse_ListResult{} if protoimpl.UnsafeEnabled { - mi := &file_bpfd_proto_msgTypes[25] + mi := &file_bpfman_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1464,7 +1464,7 @@ func (x *ListResponse_ListResult) String() string { func (*ListResponse_ListResult) ProtoMessage() {} func (x *ListResponse_ListResult) ProtoReflect() protoreflect.Message { - mi := &file_bpfd_proto_msgTypes[25] + mi := &file_bpfman_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1477,7 +1477,7 @@ func (x *ListResponse_ListResult) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponse_ListResult.ProtoReflect.Descriptor instead. func (*ListResponse_ListResult) Descriptor() ([]byte, []int) { - return file_bpfd_proto_rawDescGZIP(), []int{15, 0} + return file_bpfman_proto_rawDescGZIP(), []int{15, 0} } func (x *ListResponse_ListResult) GetInfo() *ProgramInfo { @@ -1494,9 +1494,9 @@ func (x *ListResponse_ListResult) GetKernelInfo() *KernelProgramInfo { return nil } -var File_bpfd_proto protoreflect.FileDescriptor +var File_bpfman_proto protoreflect.FileDescriptor -var file_bpfd_proto_rawDesc = []byte{ +var file_bpfman_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x62, 0x70, 0x66, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x62, 0x70, 0x66, 0x64, 0x2e, 0x76, 0x31, 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x42, 0x79, 0x74, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, @@ -1757,80 +1757,80 @@ var file_bpfd_proto_rawDesc = []byte{ } var ( - file_bpfd_proto_rawDescOnce sync.Once - file_bpfd_proto_rawDescData = file_bpfd_proto_rawDesc + file_bpfman_proto_rawDescOnce sync.Once + file_bpfman_proto_rawDescData = file_bpfman_proto_rawDesc ) -func file_bpfd_proto_rawDescGZIP() []byte { - file_bpfd_proto_rawDescOnce.Do(func() { - file_bpfd_proto_rawDescData = protoimpl.X.CompressGZIP(file_bpfd_proto_rawDescData) +func file_bpfman_proto_rawDescGZIP() []byte { + file_bpfman_proto_rawDescOnce.Do(func() { + file_bpfman_proto_rawDescData = protoimpl.X.CompressGZIP(file_bpfman_proto_rawDescData) }) - return file_bpfd_proto_rawDescData -} - -var file_bpfd_proto_msgTypes = make([]protoimpl.MessageInfo, 26) -var file_bpfd_proto_goTypes = []interface{}{ - (*BytecodeImage)(nil), // 0: bpfd.v1.BytecodeImage - (*BytecodeLocation)(nil), // 1: bpfd.v1.BytecodeLocation - (*KernelProgramInfo)(nil), // 2: bpfd.v1.KernelProgramInfo - (*ProgramInfo)(nil), // 3: bpfd.v1.ProgramInfo - (*XDPAttachInfo)(nil), // 4: bpfd.v1.XDPAttachInfo - (*TCAttachInfo)(nil), // 5: bpfd.v1.TCAttachInfo - (*TracepointAttachInfo)(nil), // 6: bpfd.v1.TracepointAttachInfo - (*KprobeAttachInfo)(nil), // 7: bpfd.v1.KprobeAttachInfo - (*UprobeAttachInfo)(nil), // 8: bpfd.v1.UprobeAttachInfo - (*AttachInfo)(nil), // 9: bpfd.v1.AttachInfo - (*LoadRequest)(nil), // 10: bpfd.v1.LoadRequest - (*LoadResponse)(nil), // 11: bpfd.v1.LoadResponse - (*UnloadRequest)(nil), // 12: bpfd.v1.UnloadRequest - (*UnloadResponse)(nil), // 13: bpfd.v1.UnloadResponse - (*ListRequest)(nil), // 14: bpfd.v1.ListRequest - (*ListResponse)(nil), // 15: bpfd.v1.ListResponse - (*PullBytecodeRequest)(nil), // 16: bpfd.v1.PullBytecodeRequest - (*PullBytecodeResponse)(nil), // 17: bpfd.v1.PullBytecodeResponse - (*GetRequest)(nil), // 18: bpfd.v1.GetRequest - (*GetResponse)(nil), // 19: bpfd.v1.GetResponse - nil, // 20: bpfd.v1.ProgramInfo.GlobalDataEntry - nil, // 21: bpfd.v1.ProgramInfo.MetadataEntry - nil, // 22: bpfd.v1.LoadRequest.MetadataEntry - nil, // 23: bpfd.v1.LoadRequest.GlobalDataEntry - nil, // 24: bpfd.v1.ListRequest.MatchMetadataEntry - (*ListResponse_ListResult)(nil), // 25: bpfd.v1.ListResponse.ListResult -} -var file_bpfd_proto_depIdxs = []int32{ - 0, // 0: bpfd.v1.BytecodeLocation.image:type_name -> bpfd.v1.BytecodeImage - 1, // 1: bpfd.v1.ProgramInfo.bytecode:type_name -> bpfd.v1.BytecodeLocation - 9, // 2: bpfd.v1.ProgramInfo.attach:type_name -> bpfd.v1.AttachInfo - 20, // 3: bpfd.v1.ProgramInfo.global_data:type_name -> bpfd.v1.ProgramInfo.GlobalDataEntry - 21, // 4: bpfd.v1.ProgramInfo.metadata:type_name -> bpfd.v1.ProgramInfo.MetadataEntry - 4, // 5: bpfd.v1.AttachInfo.xdp_attach_info:type_name -> bpfd.v1.XDPAttachInfo - 5, // 6: bpfd.v1.AttachInfo.tc_attach_info:type_name -> bpfd.v1.TCAttachInfo - 6, // 7: bpfd.v1.AttachInfo.tracepoint_attach_info:type_name -> bpfd.v1.TracepointAttachInfo - 7, // 8: bpfd.v1.AttachInfo.kprobe_attach_info:type_name -> bpfd.v1.KprobeAttachInfo - 8, // 9: bpfd.v1.AttachInfo.uprobe_attach_info:type_name -> bpfd.v1.UprobeAttachInfo - 1, // 10: bpfd.v1.LoadRequest.bytecode:type_name -> bpfd.v1.BytecodeLocation - 9, // 11: bpfd.v1.LoadRequest.attach:type_name -> bpfd.v1.AttachInfo - 22, // 12: bpfd.v1.LoadRequest.metadata:type_name -> bpfd.v1.LoadRequest.MetadataEntry - 23, // 13: bpfd.v1.LoadRequest.global_data:type_name -> bpfd.v1.LoadRequest.GlobalDataEntry - 3, // 14: bpfd.v1.LoadResponse.info:type_name -> bpfd.v1.ProgramInfo - 2, // 15: bpfd.v1.LoadResponse.kernel_info:type_name -> bpfd.v1.KernelProgramInfo - 24, // 16: bpfd.v1.ListRequest.match_metadata:type_name -> bpfd.v1.ListRequest.MatchMetadataEntry - 25, // 17: bpfd.v1.ListResponse.results:type_name -> bpfd.v1.ListResponse.ListResult - 0, // 18: bpfd.v1.PullBytecodeRequest.image:type_name -> bpfd.v1.BytecodeImage - 3, // 19: bpfd.v1.GetResponse.info:type_name -> bpfd.v1.ProgramInfo - 2, // 20: bpfd.v1.GetResponse.kernel_info:type_name -> bpfd.v1.KernelProgramInfo - 3, // 21: bpfd.v1.ListResponse.ListResult.info:type_name -> bpfd.v1.ProgramInfo - 2, // 22: bpfd.v1.ListResponse.ListResult.kernel_info:type_name -> bpfd.v1.KernelProgramInfo - 10, // 23: bpfd.v1.Bpfd.Load:input_type -> bpfd.v1.LoadRequest - 12, // 24: bpfd.v1.Bpfd.Unload:input_type -> bpfd.v1.UnloadRequest - 14, // 25: bpfd.v1.Bpfd.List:input_type -> bpfd.v1.ListRequest - 16, // 26: bpfd.v1.Bpfd.PullBytecode:input_type -> bpfd.v1.PullBytecodeRequest - 18, // 27: bpfd.v1.Bpfd.Get:input_type -> bpfd.v1.GetRequest - 11, // 28: bpfd.v1.Bpfd.Load:output_type -> bpfd.v1.LoadResponse - 13, // 29: bpfd.v1.Bpfd.Unload:output_type -> bpfd.v1.UnloadResponse - 15, // 30: bpfd.v1.Bpfd.List:output_type -> bpfd.v1.ListResponse - 17, // 31: bpfd.v1.Bpfd.PullBytecode:output_type -> bpfd.v1.PullBytecodeResponse - 19, // 32: bpfd.v1.Bpfd.Get:output_type -> bpfd.v1.GetResponse + return file_bpfman_proto_rawDescData +} + +var file_bpfman_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_bpfman_proto_goTypes = []interface{}{ + (*BytecodeImage)(nil), // 0: bpfman.v1.BytecodeImage + (*BytecodeLocation)(nil), // 1: bpfman.v1.BytecodeLocation + (*KernelProgramInfo)(nil), // 2: bpfman.v1.KernelProgramInfo + (*ProgramInfo)(nil), // 3: bpfman.v1.ProgramInfo + (*XDPAttachInfo)(nil), // 4: bpfman.v1.XDPAttachInfo + (*TCAttachInfo)(nil), // 5: bpfman.v1.TCAttachInfo + (*TracepointAttachInfo)(nil), // 6: bpfman.v1.TracepointAttachInfo + (*KprobeAttachInfo)(nil), // 7: bpfman.v1.KprobeAttachInfo + (*UprobeAttachInfo)(nil), // 8: bpfman.v1.UprobeAttachInfo + (*AttachInfo)(nil), // 9: bpfman.v1.AttachInfo + (*LoadRequest)(nil), // 10: bpfman.v1.LoadRequest + (*LoadResponse)(nil), // 11: bpfman.v1.LoadResponse + (*UnloadRequest)(nil), // 12: bpfman.v1.UnloadRequest + (*UnloadResponse)(nil), // 13: bpfman.v1.UnloadResponse + (*ListRequest)(nil), // 14: bpfman.v1.ListRequest + (*ListResponse)(nil), // 15: bpfman.v1.ListResponse + (*PullBytecodeRequest)(nil), // 16: bpfman.v1.PullBytecodeRequest + (*PullBytecodeResponse)(nil), // 17: bpfman.v1.PullBytecodeResponse + (*GetRequest)(nil), // 18: bpfman.v1.GetRequest + (*GetResponse)(nil), // 19: bpfman.v1.GetResponse + nil, // 20: bpfman.v1.ProgramInfo.GlobalDataEntry + nil, // 21: bpfman.v1.ProgramInfo.MetadataEntry + nil, // 22: bpfman.v1.LoadRequest.MetadataEntry + nil, // 23: bpfman.v1.LoadRequest.GlobalDataEntry + nil, // 24: bpfman.v1.ListRequest.MatchMetadataEntry + (*ListResponse_ListResult)(nil), // 25: bpfman.v1.ListResponse.ListResult +} +var file_bpfman_proto_depIdxs = []int32{ + 0, // 0: bpfman.v1.BytecodeLocation.image:type_name -> bpfman.v1.BytecodeImage + 1, // 1: bpfman.v1.ProgramInfo.bytecode:type_name -> bpfman.v1.BytecodeLocation + 9, // 2: bpfman.v1.ProgramInfo.attach:type_name -> bpfman.v1.AttachInfo + 20, // 3: bpfman.v1.ProgramInfo.global_data:type_name -> bpfman.v1.ProgramInfo.GlobalDataEntry + 21, // 4: bpfman.v1.ProgramInfo.metadata:type_name -> bpfman.v1.ProgramInfo.MetadataEntry + 4, // 5: bpfman.v1.AttachInfo.xdp_attach_info:type_name -> bpfman.v1.XDPAttachInfo + 5, // 6: bpfman.v1.AttachInfo.tc_attach_info:type_name -> bpfman.v1.TCAttachInfo + 6, // 7: bpfman.v1.AttachInfo.tracepoint_attach_info:type_name -> bpfman.v1.TracepointAttachInfo + 7, // 8: bpfman.v1.AttachInfo.kprobe_attach_info:type_name -> bpfman.v1.KprobeAttachInfo + 8, // 9: bpfman.v1.AttachInfo.uprobe_attach_info:type_name -> bpfman.v1.UprobeAttachInfo + 1, // 10: bpfman.v1.LoadRequest.bytecode:type_name -> bpfman.v1.BytecodeLocation + 9, // 11: bpfman.v1.LoadRequest.attach:type_name -> bpfman.v1.AttachInfo + 22, // 12: bpfman.v1.LoadRequest.metadata:type_name -> bpfman.v1.LoadRequest.MetadataEntry + 23, // 13: bpfman.v1.LoadRequest.global_data:type_name -> bpfman.v1.LoadRequest.GlobalDataEntry + 3, // 14: bpfman.v1.LoadResponse.info:type_name -> bpfman.v1.ProgramInfo + 2, // 15: bpfman.v1.LoadResponse.kernel_info:type_name -> bpfman.v1.KernelProgramInfo + 24, // 16: bpfman.v1.ListRequest.match_metadata:type_name -> bpfman.v1.ListRequest.MatchMetadataEntry + 25, // 17: bpfman.v1.ListResponse.results:type_name -> bpfman.v1.ListResponse.ListResult + 0, // 18: bpfman.v1.PullBytecodeRequest.image:type_name -> bpfman.v1.BytecodeImage + 3, // 19: bpfman.v1.GetResponse.info:type_name -> bpfman.v1.ProgramInfo + 2, // 20: bpfman.v1.GetResponse.kernel_info:type_name -> bpfman.v1.KernelProgramInfo + 3, // 21: bpfman.v1.ListResponse.ListResult.info:type_name -> bpfman.v1.ProgramInfo + 2, // 22: bpfman.v1.ListResponse.ListResult.kernel_info:type_name -> bpfman.v1.KernelProgramInfo + 10, // 23: bpfman.v1.Bpfman.Load:input_type -> bpfman.v1.LoadRequest + 12, // 24: bpfman.v1.Bpfman.Unload:input_type -> bpfman.v1.UnloadRequest + 14, // 25: bpfman.v1.Bpfman.List:input_type -> bpfman.v1.ListRequest + 16, // 26: bpfman.v1.Bpfman.PullBytecode:input_type -> bpfman.v1.PullBytecodeRequest + 18, // 27: bpfman.v1.Bpfman.Get:input_type -> bpfman.v1.GetRequest + 11, // 28: bpfman.v1.Bpfman.Load:output_type -> bpfman.v1.LoadResponse + 13, // 29: bpfman.v1.Bpfman.Unload:output_type -> bpfman.v1.UnloadResponse + 15, // 30: bpfman.v1.Bpfman.List:output_type -> bpfman.v1.ListResponse + 17, // 31: bpfman.v1.Bpfman.PullBytecode:output_type -> bpfman.v1.PullBytecodeResponse + 19, // 32: bpfman.v1.Bpfman.Get:output_type -> bpfman.v1.GetResponse 28, // [28:33] is the sub-list for method output_type 23, // [23:28] is the sub-list for method input_type 23, // [23:23] is the sub-list for extension type_name @@ -1838,13 +1838,13 @@ var file_bpfd_proto_depIdxs = []int32{ 0, // [0:23] is the sub-list for field type_name } -func init() { file_bpfd_proto_init() } -func file_bpfd_proto_init() { - if File_bpfd_proto != nil { +func init() { file_bpfman_proto_init() } +func file_bpfman_proto_init() { + if File_bpfman_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_bpfd_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BytecodeImage); i { case 0: return &v.state @@ -1856,7 +1856,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BytecodeLocation); i { case 0: return &v.state @@ -1868,7 +1868,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KernelProgramInfo); i { case 0: return &v.state @@ -1880,7 +1880,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProgramInfo); i { case 0: return &v.state @@ -1892,7 +1892,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*XDPAttachInfo); i { case 0: return &v.state @@ -1904,7 +1904,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TCAttachInfo); i { case 0: return &v.state @@ -1916,7 +1916,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TracepointAttachInfo); i { case 0: return &v.state @@ -1928,7 +1928,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*KprobeAttachInfo); i { case 0: return &v.state @@ -1940,7 +1940,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UprobeAttachInfo); i { case 0: return &v.state @@ -1952,7 +1952,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AttachInfo); i { case 0: return &v.state @@ -1964,7 +1964,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoadRequest); i { case 0: return &v.state @@ -1976,7 +1976,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoadResponse); i { case 0: return &v.state @@ -1988,7 +1988,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnloadRequest); i { case 0: return &v.state @@ -2000,7 +2000,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnloadResponse); i { case 0: return &v.state @@ -2012,7 +2012,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListRequest); i { case 0: return &v.state @@ -2024,7 +2024,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListResponse); i { case 0: return &v.state @@ -2036,7 +2036,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PullBytecodeRequest); i { case 0: return &v.state @@ -2048,7 +2048,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PullBytecodeResponse); i { case 0: return &v.state @@ -2060,7 +2060,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRequest); i { case 0: return &v.state @@ -2072,7 +2072,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetResponse); i { case 0: return &v.state @@ -2084,7 +2084,7 @@ func file_bpfd_proto_init() { return nil } } - file_bpfd_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_bpfman_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListResponse_ListResult); i { case 0: return &v.state @@ -2097,41 +2097,41 @@ func file_bpfd_proto_init() { } } } - file_bpfd_proto_msgTypes[0].OneofWrappers = []interface{}{} - file_bpfd_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_bpfman_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[1].OneofWrappers = []interface{}{ (*BytecodeLocation_Image)(nil), (*BytecodeLocation_File)(nil), } - file_bpfd_proto_msgTypes[3].OneofWrappers = []interface{}{} - file_bpfd_proto_msgTypes[7].OneofWrappers = []interface{}{} - file_bpfd_proto_msgTypes[8].OneofWrappers = []interface{}{} - file_bpfd_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_bpfman_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[7].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[8].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[9].OneofWrappers = []interface{}{ (*AttachInfo_XdpAttachInfo)(nil), (*AttachInfo_TcAttachInfo)(nil), (*AttachInfo_TracepointAttachInfo)(nil), (*AttachInfo_KprobeAttachInfo)(nil), (*AttachInfo_UprobeAttachInfo)(nil), } - file_bpfd_proto_msgTypes[10].OneofWrappers = []interface{}{} - file_bpfd_proto_msgTypes[14].OneofWrappers = []interface{}{} - file_bpfd_proto_msgTypes[19].OneofWrappers = []interface{}{} - file_bpfd_proto_msgTypes[25].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[10].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[14].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[19].OneofWrappers = []interface{}{} + file_bpfman_proto_msgTypes[25].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_bpfd_proto_rawDesc, + RawDescriptor: file_bpfman_proto_rawDesc, NumEnums: 0, NumMessages: 26, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_bpfd_proto_goTypes, - DependencyIndexes: file_bpfd_proto_depIdxs, - MessageInfos: file_bpfd_proto_msgTypes, + GoTypes: file_bpfman_proto_goTypes, + DependencyIndexes: file_bpfman_proto_depIdxs, + MessageInfos: file_bpfman_proto_msgTypes, }.Build() - File_bpfd_proto = out.File - file_bpfd_proto_rawDesc = nil - file_bpfd_proto_goTypes = nil - file_bpfd_proto_depIdxs = nil + File_bpfman_proto = out.File + file_bpfman_proto_rawDesc = nil + file_bpfman_proto_goTypes = nil + file_bpfman_proto_depIdxs = nil } diff --git a/clients/gobpfd/v1/bpfd_grpc.pb.go b/clients/gobpfman/v1/bpfman_grpc.pb.go similarity index 51% rename from clients/gobpfd/v1/bpfd_grpc.pb.go rename to clients/gobpfman/v1/bpfman_grpc.pb.go index 81fb23615..ddf00d0e2 100644 --- a/clients/gobpfd/v1/bpfd_grpc.pb.go +++ b/clients/gobpfman/v1/bpfman_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 -// source: bpfd.proto +// source: bpfman.proto package v1 @@ -18,10 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -// BpfdClient is the client API for Bpfd service. +// BpfmanClient is the client API for Bpfman service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type BpfdClient interface { +type BpfmanClient interface { Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error) Unload(ctx context.Context, in *UnloadRequest, opts ...grpc.CallOption) (*UnloadResponse, error) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) @@ -29,221 +29,221 @@ type BpfdClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) } -type bpfdClient struct { +type bpfmanClient struct { cc grpc.ClientConnInterface } -func NewBpfdClient(cc grpc.ClientConnInterface) BpfdClient { - return &bpfdClient{cc} +func NewBpfmanClient(cc grpc.ClientConnInterface) BpfmanClient { + return &bpfmanClient{cc} } -func (c *bpfdClient) Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error) { +func (c *bpfmanClient) Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error) { out := new(LoadResponse) - err := c.cc.Invoke(ctx, "/bpfd.v1.Bpfd/Load", in, out, opts...) + err := c.cc.Invoke(ctx, "/bpfman.v1.Bpfman/Load", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *bpfdClient) Unload(ctx context.Context, in *UnloadRequest, opts ...grpc.CallOption) (*UnloadResponse, error) { +func (c *bpfmanClient) Unload(ctx context.Context, in *UnloadRequest, opts ...grpc.CallOption) (*UnloadResponse, error) { out := new(UnloadResponse) - err := c.cc.Invoke(ctx, "/bpfd.v1.Bpfd/Unload", in, out, opts...) + err := c.cc.Invoke(ctx, "/bpfman.v1.Bpfman/Unload", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *bpfdClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { +func (c *bpfmanClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) { out := new(ListResponse) - err := c.cc.Invoke(ctx, "/bpfd.v1.Bpfd/List", in, out, opts...) + err := c.cc.Invoke(ctx, "/bpfman.v1.Bpfman/List", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *bpfdClient) PullBytecode(ctx context.Context, in *PullBytecodeRequest, opts ...grpc.CallOption) (*PullBytecodeResponse, error) { +func (c *bpfmanClient) PullBytecode(ctx context.Context, in *PullBytecodeRequest, opts ...grpc.CallOption) (*PullBytecodeResponse, error) { out := new(PullBytecodeResponse) - err := c.cc.Invoke(ctx, "/bpfd.v1.Bpfd/PullBytecode", in, out, opts...) + err := c.cc.Invoke(ctx, "/bpfman.v1.Bpfman/PullBytecode", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *bpfdClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { +func (c *bpfmanClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) { out := new(GetResponse) - err := c.cc.Invoke(ctx, "/bpfd.v1.Bpfd/Get", in, out, opts...) + err := c.cc.Invoke(ctx, "/bpfman.v1.Bpfman/Get", in, out, opts...) if err != nil { return nil, err } return out, nil } -// BpfdServer is the server API for Bpfd service. -// All implementations must embed UnimplementedBpfdServer +// BpfmanServer is the server API for Bpfman service. +// All implementations must embed UnimplementedBpfmanServer // for forward compatibility -type BpfdServer interface { +type BpfmanServer interface { Load(context.Context, *LoadRequest) (*LoadResponse, error) Unload(context.Context, *UnloadRequest) (*UnloadResponse, error) List(context.Context, *ListRequest) (*ListResponse, error) PullBytecode(context.Context, *PullBytecodeRequest) (*PullBytecodeResponse, error) Get(context.Context, *GetRequest) (*GetResponse, error) - mustEmbedUnimplementedBpfdServer() + mustEmbedUnimplementedBpfmanServer() } -// UnimplementedBpfdServer must be embedded to have forward compatible implementations. -type UnimplementedBpfdServer struct { +// UnimplementedBpfmanServer must be embedded to have forward compatible implementations. +type UnimplementedBpfmanServer struct { } -func (UnimplementedBpfdServer) Load(context.Context, *LoadRequest) (*LoadResponse, error) { +func (UnimplementedBpfmanServer) Load(context.Context, *LoadRequest) (*LoadResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Load not implemented") } -func (UnimplementedBpfdServer) Unload(context.Context, *UnloadRequest) (*UnloadResponse, error) { +func (UnimplementedBpfmanServer) Unload(context.Context, *UnloadRequest) (*UnloadResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Unload not implemented") } -func (UnimplementedBpfdServer) List(context.Context, *ListRequest) (*ListResponse, error) { +func (UnimplementedBpfmanServer) List(context.Context, *ListRequest) (*ListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } -func (UnimplementedBpfdServer) PullBytecode(context.Context, *PullBytecodeRequest) (*PullBytecodeResponse, error) { +func (UnimplementedBpfmanServer) PullBytecode(context.Context, *PullBytecodeRequest) (*PullBytecodeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PullBytecode not implemented") } -func (UnimplementedBpfdServer) Get(context.Context, *GetRequest) (*GetResponse, error) { +func (UnimplementedBpfmanServer) Get(context.Context, *GetRequest) (*GetResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } -func (UnimplementedBpfdServer) mustEmbedUnimplementedBpfdServer() {} +func (UnimplementedBpfmanServer) mustEmbedUnimplementedBpfmanServer() {} -// UnsafeBpfdServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BpfdServer will +// UnsafeBpfmanServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to BpfmanServer will // result in compilation errors. -type UnsafeBpfdServer interface { - mustEmbedUnimplementedBpfdServer() +type UnsafeBpfmanServer interface { + mustEmbedUnimplementedBpfmanServer() } -func RegisterBpfdServer(s grpc.ServiceRegistrar, srv BpfdServer) { - s.RegisterService(&Bpfd_ServiceDesc, srv) +func RegisterBpfmanServer(s grpc.ServiceRegistrar, srv BpfmanServer) { + s.RegisterService(&Bpfman_ServiceDesc, srv) } -func _Bpfd_Load_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Bpfman_Load_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LoadRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BpfdServer).Load(ctx, in) + return srv.(BpfmanServer).Load(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bpfd.v1.Bpfd/Load", + FullMethod: "/bpfman.v1.Bpfman/Load", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BpfdServer).Load(ctx, req.(*LoadRequest)) + return srv.(BpfmanServer).Load(ctx, req.(*LoadRequest)) } return interceptor(ctx, in, info, handler) } -func _Bpfd_Unload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Bpfman_Unload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UnloadRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BpfdServer).Unload(ctx, in) + return srv.(BpfmanServer).Unload(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bpfd.v1.Bpfd/Unload", + FullMethod: "/bpfman.v1.Bpfman/Unload", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BpfdServer).Unload(ctx, req.(*UnloadRequest)) + return srv.(BpfmanServer).Unload(ctx, req.(*UnloadRequest)) } return interceptor(ctx, in, info, handler) } -func _Bpfd_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Bpfman_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BpfdServer).List(ctx, in) + return srv.(BpfmanServer).List(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bpfd.v1.Bpfd/List", + FullMethod: "/bpfman.v1.Bpfman/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BpfdServer).List(ctx, req.(*ListRequest)) + return srv.(BpfmanServer).List(ctx, req.(*ListRequest)) } return interceptor(ctx, in, info, handler) } -func _Bpfd_PullBytecode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Bpfman_PullBytecode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PullBytecodeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BpfdServer).PullBytecode(ctx, in) + return srv.(BpfmanServer).PullBytecode(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bpfd.v1.Bpfd/PullBytecode", + FullMethod: "/bpfman.v1.Bpfman/PullBytecode", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BpfdServer).PullBytecode(ctx, req.(*PullBytecodeRequest)) + return srv.(BpfmanServer).PullBytecode(ctx, req.(*PullBytecodeRequest)) } return interceptor(ctx, in, info, handler) } -func _Bpfd_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Bpfman_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(BpfdServer).Get(ctx, in) + return srv.(BpfmanServer).Get(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/bpfd.v1.Bpfd/Get", + FullMethod: "/bpfman.v1.Bpfman/Get", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BpfdServer).Get(ctx, req.(*GetRequest)) + return srv.(BpfmanServer).Get(ctx, req.(*GetRequest)) } return interceptor(ctx, in, info, handler) } -// Bpfd_ServiceDesc is the grpc.ServiceDesc for Bpfd service. +// Bpfman_ServiceDesc is the grpc.ServiceDesc for Bpfman service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var Bpfd_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "bpfd.v1.Bpfd", - HandlerType: (*BpfdServer)(nil), +var Bpfman_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "bpfman.v1.Bpfman", + HandlerType: (*BpfmanServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Load", - Handler: _Bpfd_Load_Handler, + Handler: _Bpfman_Load_Handler, }, { MethodName: "Unload", - Handler: _Bpfd_Unload_Handler, + Handler: _Bpfman_Unload_Handler, }, { MethodName: "List", - Handler: _Bpfd_List_Handler, + Handler: _Bpfman_List_Handler, }, { MethodName: "PullBytecode", - Handler: _Bpfd_PullBytecode_Handler, + Handler: _Bpfman_PullBytecode_Handler, }, { MethodName: "Get", - Handler: _Bpfd_Get_Handler, + Handler: _Bpfman_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "bpfd.proto", + Metadata: "bpfman.proto", } diff --git a/csi/Cargo.toml b/csi/Cargo.toml index 17eed580a..e89aeca83 100644 --- a/csi/Cargo.toml +++ b/csi/Cargo.toml @@ -2,8 +2,8 @@ description = "gRPC bindings to the CSI spec" edition = "2021" license = "Apache-2.0" -name = "bpfd-csi" -repository = "https://github.com/bpfd-dev/bpfd" +name = "bpfman-csi" +repository = "https://github.com/bpfman/bpfman" version = "1.8.0" [dependencies] diff --git a/csi/src/lib.rs b/csi/src/lib.rs index 762b03875..e5527d5f5 100644 --- a/csi/src/lib.rs +++ b/csi/src/lib.rs @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright Authors of bpfd +// Copyright Authors of bpfman #[path = "csi.v1.rs"] #[rustfmt::skip] diff --git a/docs/blog/.authors.yml b/docs/blog/.authors.yml index b79684455..8dd4539a3 100644 --- a/docs/blog/.authors.yml +++ b/docs/blog/.authors.yml @@ -1,8 +1,13 @@ -anfredette: - name: Andre Fredette - description: Senior Principal Software Engineer at Red Hat. Maintainer on bpfd project. - avatar: https://github.com/anfredette.png -shaneutt: - name: Shane Utt - description: Staff Software Engineer at Kong. Kubernetes SIG Network Chair and Gateway API Maintainer. - avatar: https://github.com/shaneutt.png +authors: + anfredette: + name: Andre Fredette + description: Senior Principal Software Engineer at Red Hat. Maintainer on bpfman project. + avatar: https://github.com/anfredette.png + shaneutt: + name: Shane Utt + description: Staff Software Engineer at Kong. Kubernetes SIG Network Chair and Gateway API Maintainer. + avatar: https://github.com/shaneutt.png + dave-tucker: + name: Dave Tucker + description: Senior Principal Software Engineer at Red Hat. Creator of the bpfman project. + avatar: https://github.com/dave-tucker.png diff --git a/docs/blog/index.md b/docs/blog/index.md index 7808cbbbd..3d4893e50 100644 --- a/docs/blog/index.md +++ b/docs/blog/index.md @@ -1 +1 @@ -# Bpfd Blog +# Bpfman Blog diff --git a/docs/blog/posts/bpfd-becomes-bpfman.md b/docs/blog/posts/bpfd-becomes-bpfman.md new file mode 100644 index 000000000..7cb65c7f1 --- /dev/null +++ b/docs/blog/posts/bpfd-becomes-bpfman.md @@ -0,0 +1,69 @@ +--- +date: 2023-11-23 +authors: + - dave-tucker +--- + +# bpfd becomes bpfman + +Bpfd is now bpfman! We've renamed the project to better reflect the +direction we're taking. We're still the same project, just with a new +name. + + + +## Why the name change? + +We've been thinking about this for a while. We've been using the name +`bpfd` for a while now, but we were not the first to use it. There are +were projects before us that used the name `bpfd`, but since most were +inactive, we didn't see this as an issue. + +More recently though the folks at [Meta] have started using the name +`systemd-bpfd` for their proposed addition to [systemd]. + +In addition, we've been thinking about the future of the project. +We've been thinking particularly about security and whether it's +wise to keep something with `CAP_BPF` capabilities running as a +daemon - even if we've been very careful. + +This [issue](https://github.com/bpfman/bpfd/issues/693) led us down +the path of redesigning the project to be daemonless. We'll be +implementing these changes in the coming months and plan to perform +our first release as `bpfman` in Q1 of 2024. + +The 'd' in `bpfd` stood for daemon, so with our new design and the +confusion surrounding the name `bpfd` we though it was time for a change. + +Since we're a BPF manager, we're now bpfman! +It's also a nice homage to [podman](https://podman.io/), which we're big fans of. + +## What does this mean for me? + +If you're a developer of `bpfman` you will need to update your Git remotes +to point at our new organization and repository name. Github will redirect +these for a while, but we recommend updating your remotes as soon as possible. + +If you're a user of `bpfd` or the `bpfd-operator` then version 0.3.1 will be +the last release under the `bpfd` name. We will continue to support you as best +we can, but we recommend upgrading to `bpfman` as soon as our first release is +available. + +## What's next? + +We've hinted at some of the changes we're planning, and of course, our +roadmap is always available in [Github]. It's worth mentioning that we're +also planning expand our release packages to include RPMs and DEBs to make it +even easier to install `bpfman` on your favorite Linux distribution. + +## Thanks! + +We'd like to thank everyone who has contributed to `bpfd` over the years. +We're excited about the future of `bpfman` and we hope you are too! +Please bear with us as we make this transition, and if you have any questions +or concerns, please reach out to us on [Slack](https://slack.k8s.io/). +We're in the '#bpfd' channel, but we'll be changing that to '#bpfman' soon. + +[Github]: https://github.com/orgs/bpfman/projects/4/views/2 +[Meta]: https://meta.com/ +[systemd]: https://systemd.io/ diff --git a/docs/blog/posts/img/bpfd_architecture.jpg b/docs/blog/posts/img/bpfman_architecture.jpg similarity index 100% rename from docs/blog/posts/img/bpfd_architecture.jpg rename to docs/blog/posts/img/bpfman_architecture.jpg diff --git a/docs/blog/posts/introduction-to-bpfd.md b/docs/blog/posts/introduction-to-bpfman.md similarity index 73% rename from docs/blog/posts/introduction-to-bpfd.md rename to docs/blog/posts/introduction-to-bpfman.md index a1cb10b87..33abbdcb8 100644 --- a/docs/blog/posts/introduction-to-bpfd.md +++ b/docs/blog/posts/introduction-to-bpfman.md @@ -5,7 +5,7 @@ authors: - shaneutt --- -# bpfd: A Novel Way to Manage eBPF +# bpfman: A Novel Way to Manage eBPF In today's cloud ecosystem, there's a demand for low-level system access to enable high-performance observability, security, and networking functionality @@ -30,16 +30,16 @@ rainbows. The process of developing, testing, deploying, and maintaining eBPF programs is not a road well traveled yet, and the story gets even more complicated when you want to deploy your programs in a multi-node system, such as a [Kubernetes] cluster. It was these kinds of problems that motivated the -creation of [bpfd], a system daemon for loading and managing eBPF programs in +creation of [bpfman], a system daemon for loading and managing eBPF programs in both traditional systems and Kubernetes clusters. In this blog post, we'll -discuss the problems bpfd can help solve, and how to deploy and use it. +discuss the problems bpfman can help solve, and how to deploy and use it. [user space]:https://en.wikipedia.org/wiki/User_space_and_kernel_space [kmod]:https://wiki.archlinux.org/title/Kernel_module [eBPF]:https://en.wikipedia.org/wiki/EBPF [Linux]:https://kernel.org [Kubernetes]:https://kubernetes.io -[bpfd]:https://bpfd.dev +[bpfman]:https://bpfman.io ## Current Challenges with Developing and Deploying eBPF Programs @@ -64,61 +64,61 @@ too coarsely grained to be useful. Since the processes that load eBPF are usual long-lived and often don’t drop privileges it leaves a wide attack surface. While it doesn't solve all the ergonomic and maintenance problems associated -with adopting eBPF, [bpfd] does try to address several of these issues -- +with adopting eBPF, [bpfman] does try to address several of these issues -- particularly as it pertains to security and the lifecycle management of eBPF programs. In the coming sections, we will go into more depth about what eBPF does, and how it can help reduce the costs associated with deploying and managing eBPF-powered workloads. [eBPF verifier]:https://docs.kernel.org/bpf/verifier.html -[bpfd]:https://bpfd.dev +[bpfman]:https://bpfman.io -## bpfd Overview +## bpfman Overview -The bpfd project provides a software stack that makes it easy to manage the full +The bpfman project provides a software stack that makes it easy to manage the full lifecycle of eBPF programs. In particular, it can load, unload, modify, and monitor eBPF programs on a single host, or across a full Kubernetes cluster. The -key components of bpfd include the bpfd daemon itself which can run +key components of bpfman include the bpfman daemon itself which can run independently on any Linux box, an accompanying Kubernetes Operator designed to bring first-class support to clusters via Custom Resource Definitions (CRDs), and eBPF program packaging. These components will be covered in more detail in the following sections. -### bpfd Daemon +### bpfman Daemon -The bpfd daemon works directly with the operating system to manage eBPF +The bpfman daemon works directly with the operating system to manage eBPF programs. It loads, updates, and unloads eBPF programs, pins maps, and provides -visibility into the eBPF programs loaded on a system. Currently, bpfd fully +visibility into the eBPF programs loaded on a system. Currently, bpfman fully supports XDP, TC, Tracepoint, uProbe, and kProbe eBPF programs. In addition, -bpfd can display information about all types of eBPF programs loaded on a system -whether they were loaded by bpfd or some other mechanism. bpfd is developed in +bpfman can display information about all types of eBPF programs loaded on a system +whether they were loaded by bpfman or some other mechanism. bpfman is developed in the Rust programming language and uses [Aya], an eBPF library which is also developed in Rust. -When used on an individual server, bpfd runs as a system daemon, and -applications communicate with it using a gRPC API. bpfd can also be used via a +When used on an individual server, bpfman runs as a system daemon, and +applications communicate with it using a gRPC API. bpfman can also be used via a command line tool called bpfctl which in turn uses the gRPC API. The following is an example of using bpfctl to load and attach an xdp program. - bpfctl load-from-image -g GLOBAL_u8=01 -i quay.io/bpfd-bytecode/xdp_pass:latest xdp -i eth0 -p 100 + bpfctl load-from-image -g GLOBAL_u8=01 -i quay.io/bpfman-bytecode/xdp_pass:latest xdp -i eth0 -p 100 This architecture is depicted in the following diagram. -![bpfd Architecture](./img/bpfd_architecture.jpg) +![bpfman Architecture](./img/bpfman_architecture.jpg) -Using bpfd in this manner significantly improves security because the API is -secured using mTLS, and only bpfd needs the privileges required to load and manage +Using bpfman in this manner significantly improves security because the API is +secured using mTLS, and only bpfman needs the privileges required to load and manage eBPF programs and maps. Writing eBPF code is tough enough as it is. Typically, an eBPF-based application would need to also implement support for the lifecycle management of -the required eBPF programs. bpfd does that for you and allows you to focus on +the required eBPF programs. bpfman does that for you and allows you to focus on developing your application. -Another key functional advantage that bpfd offers over libbpf or the Cilium +Another key functional advantage that bpfman offers over libbpf or the Cilium ebpf-go library is support for multiple XDP programs. Standard XDP only allows a -single XDP program on a given interface, while bpfd supports loading multiple +single XDP program on a given interface, while bpfman supports loading multiple XDP programs on each interface using the [multi-prog] protocol defined in libxdp. This allows the user to add, delete, update, prioritize, and re-prioritize the multiple programs on each interface. There is also support to @@ -126,31 +126,31 @@ configure whether the flow of execution should terminate and return or continue to the next program in the list based on the return value. While TC natively supports multiple programs on each attach point, it lacks the -controls and flexibility enabled by the multi-prog protocol. bpfd therefore also +controls and flexibility enabled by the multi-prog protocol. bpfman therefore also supports the same XDP multi-prog solution for TC programs which has the added benefit of a consistent user experience for both XDP and TC programs. eBPF programs are also difficult to debug on a system. The visibility provided -by bpfd can be a key tool in understanding what is deployed and how they may +by bpfman can be a key tool in understanding what is deployed and how they may interact. [Aya]:https://aya-rs.dev/ [multi-prog]:https://github.com/xdp-project/xdp-tools/blob/master/lib/libxdp/protocol.org -### bpfd Kubernetes Support +### bpfman Kubernetes Support -The benefits of bpfd are brought to Kubernetes by the bpfd operator. The bpfd +The benefits of bpfman are brought to Kubernetes by the bpfman operator. The bpfman operator is developed in Go using the Operator SDK framework, so it should be -familiar to most Kubernetes application developers. The bpfd operator deploys a -daemonset, containing both bpfd and the bpfd agent processes on each node. -Rather than making requests directly to bpfd with the gRPC API or bpfctl as -described above, Kubernetes applications use bpfd custom resource definitions -(CRDs) to make requests to bpfd to load and attach eBPF programs. bpfd uses two +familiar to most Kubernetes application developers. The bpfman operator deploys a +daemonset, containing both bpfman and the bpfman agent processes on each node. +Rather than making requests directly to bpfman with the gRPC API or bpfctl as +described above, Kubernetes applications use bpfman custom resource definitions +(CRDs) to make requests to bpfman to load and attach eBPF programs. bpfman uses two types of CRDs; Program CRDs for each eBPF program type (referred to as \*Program CRDs, where \* = Xdp, Tc, etc.) created by the application to express the desired state of an eBPF program on the cluster, and per node BpfProgram CRDs created by -the bpfd agent to report the current state of the eBPF program on each node. +the bpfman agent to report the current state of the eBPF program on each node. Using XDP as an example, the application can request that an XDP program be loaded on multiple nodes using the XdpProgram CRD, which includes the necessary @@ -159,7 +159,7 @@ priority. An XdpProgram CRD that would do the same thing as the bpfctl command shown above on every node in a cluster is shown below. ```yaml -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -174,40 +174,40 @@ spec: priority: 0 bytecode: image: - url: quay.io/bpfd-bytecode/xdp_pass:latest + url: quay.io/bpfman-bytecode/xdp_pass:latest globaldata: GLOBAL_u8: - 0x01 ``` -The bpfd agent on each node watches for the \*Program CRDs, and makes calls to -the local instance of bpfd as necessary to ensure that the state on the local -node reflects the state requested in the \*Program CRD. The bpfd agent on each +The bpfman agent on each node watches for the \*Program CRDs, and makes calls to +the local instance of bpfman as necessary to ensure that the state on the local +node reflects the state requested in the \*Program CRD. The bpfman agent on each node in turn creates and updates a BpfProgram object for the \*Program CRD that reflects the state of the program on that node and reports the eBPF map information for the program. The following is the BpfProgram CRD on one node for the above XdpProgram CRD. ```bash -kubectl get bpfprograms.bpfd.dev xdp-pass-all-nodes-bpfd-deployment-control-plane-eth0 -o yaml +kubectl get bpfprograms.bpfman.io xdp-pass-all-nodes-bpfman-deployment-control-plane-eth0 -o yaml ``` ```yaml -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: BpfProgram metadata: annotations: - bpfd.dev.xdpprogramcontroller/interface: eth0 + bpfman.io.xdpprogramcontroller/interface: eth0 creationTimestamp: "2023-08-29T22:08:12Z" finalizers: - - bpfd.dev.xdpprogramcontroller/finalizer + - bpfman.io.xdpprogramcontroller/finalizer generation: 1 labels: - bpfd.dev/ownedByProgram: xdp-pass-all-nodes - kubernetes.io/hostname: bpfd-deployment-control-plane - name: xdp-pass-all-nodes-bpfd-deployment-control-plane-eth0 + bpfman.io/ownedByProgram: xdp-pass-all-nodes + kubernetes.io/hostname: bpfman-deployment-control-plane + name: xdp-pass-all-nodes-bpfman-deployment-control-plane-eth0 ownerReferences: - - apiVersion: bpfd.dev/v1alpha1 + - apiVersion: bpfman.io/v1alpha1 blockOwnerDeletion: true controller: true kind: XdpProgram @@ -221,31 +221,31 @@ status: conditions: - lastTransitionTime: "2023-08-29T22:08:14Z" message: Successfully loaded bpfProgram - reason: bpfdLoaded + reason: bpfmanLoaded status: "True" type: Loaded ``` -Finally, the bpfd operator watches for updates to the BpfProgram objects and +Finally, the bpfman operator watches for updates to the BpfProgram objects and reports the global state of each eBPF program. If the program was successfully loaded on every selected node, it will report success, otherwise, it will identify the node(s) that had a problem. The following is the XdpProgram CRD as updated by the operator. ```bash -kubectl get xdpprograms.bpfd.dev xdp-pass-all-nodes -o yaml +kubectl get xdpprograms.bpfman.io xdp-pass-all-nodes -o yaml ``` ```yaml -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"bpfd.dev/v1alpha1","kind":"XdpProgram","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"xdpprogram"},"name":"xdp-pass-all-nodes"},"spec":{"bytecode":{"image":{"url":"quay.io/bpfd-bytecode/xdp_pass:latest"}},"globaldata":{"GLOBAL_u8":[1]},"interfaceselector":{"primarynodeinterface":true},"nodeselector":{},"priority":0,"bpffunctionname":"pass"}} + {"apiVersion":"bpfman.io/v1alpha1","kind":"XdpProgram","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"xdpprogram"},"name":"xdp-pass-all-nodes"},"spec":{"bytecode":{"image":{"url":"quay.io/bpfman-bytecode/xdp_pass:latest"}},"globaldata":{"GLOBAL_u8":[1]},"interfaceselector":{"primarynodeinterface":true},"nodeselector":{},"priority":0,"bpffunctionname":"pass"}} creationTimestamp: "2023-08-29T22:08:12Z" finalizers: - - bpfd.dev.operator/finalizer + - bpfman.io.operator/finalizer generation: 2 labels: app.kubernetes.io/name: xdpprogram @@ -256,7 +256,7 @@ spec: bytecode: image: imagepullpolicy: IfNotPresent - url: quay.io/bpfd-bytecode/xdp_pass:latest + url: quay.io/bpfman-bytecode/xdp_pass:latest globaldata: GLOBAL_u8: 0x01 interfaceselector: @@ -282,14 +282,14 @@ status: type: ReconcileSuccess ``` More details about this process can be seen -[here](https://bpfd.dev/getting-started/example-bpf-k8s/) +[here](https://bpfman.io/getting-started/example-bpf-k8s/) #### eBPF program packaging -The eBPF Bytecode Image specification was created as part of the bpfd project to +The eBPF Bytecode Image specification was created as part of the bpfman project to define a way to package eBPF bytecode as OCI container images. Its use was illustrated in the `bpfctl` and `XdpProgram` CRD examples above in which the XDP -program was loaded from `quay.io/bpfd-bytecode/xdp_pass:latest`. The initial +program was loaded from `quay.io/bpfman-bytecode/xdp_pass:latest`. The initial motivation for this image spec was to facilitate the deployment of eBPF programs in container orchestration systems such as Kubernetes, where it is necessary to provide a portable way to distribute bytecode to all nodes that need it. @@ -299,19 +299,19 @@ is further enhanced in that applications can use the same bytecode images across different kernel versions without the need to recompile them for each version. Another benefit of bytecode containers is image signing. There is currently no way to sign and validate raw eBPF bytecode. However, the bytecode containers -can be signed and validated by bpfd using [sigstore](https://www.sigstore.dev/) to +can be signed and validated by bpfman using [sigstore](https://www.sigstore.dev/) to improve supply chain security. -### Key benefits of bpfd +### Key benefits of bpfman -This section reviews some of the key benefits of bpfd. These benefits mostly +This section reviews some of the key benefits of bpfman. These benefits mostly apply to both standalone and Kubernetes deployments, but we will focus on the benefits for Kubernetes here. #### Security -Probably the most compelling benefit of using bpfd is enhanced security. When -using bpfd, only the bpfd daemon, which can be tightly controlled, needs the +Probably the most compelling benefit of using bpfman is enhanced security. When +using bpfman, only the bpfman daemon, which can be tightly controlled, needs the privileges required to load eBPF programs, while access to the API can be controlled via standard RBAC methods on a per-application and per-CRD basis. Additionally, the signing and validating of bytecode images enables supply chain @@ -324,14 +324,14 @@ multi-program support described above helps control these interactions by providing a common mechanism to prioritize and control the flow between the programs. However, there can still be problems, and there may be eBPF programs running on nodes that were loaded by other mechanisms that you don’t even know -about. bpfd helps here too by reporting all of the eBPF programs running on all +about. bpfman helps here too by reporting all of the eBPF programs running on all of the nodes in a Kubernetes cluster. #### Productivity As described above, managing the lifecycle of eBPF programs is something that each application currently needs to do on its own. It is even more complicated -to manage the lifecycle of eBPF programs across a Kubernetes cluster. bpfd does +to manage the lifecycle of eBPF programs across a Kubernetes cluster. bpfman does this for you so you don't have to. eBPF bytecode images help here as well by simplifying the distribution of eBPF bytecode to multiple nodes in a cluster, and also allowing separate fine-grained versioning control for user space and @@ -341,12 +341,12 @@ kernel space code. This demonstration is adapted from the instructions documented by Andrew Stoycos [here](https://gist.githubusercontent.com/astoycos/c4019178c7cd69b0b5a8d069a26281ee/raw/16ae12f45dc61e01e5c7e90419709096d7944a41/Demo.md). -These instructions use kind and bpfd release v0.2.1. It should also be possible +These instructions use kind and bpfman release v0.2.1. It should also be possible to run this demo on other environments such as minikube or an actual cluster. Another option is to [build the code -yourself](https://bpfd.dev/getting-started/building-bpfd/) and use [`make -run-on-kind`](https://bpfd.dev/getting-started/example-bpf-k8s/) to create the +yourself](https://bpfman.io/getting-started/building-bpfman/) and use [`make +run-on-kind`](https://bpfman.io/getting-started/example-bpf-k8s/) to create the cluster as is described in the given links. Then, start with step 5. #### Run the demo @@ -354,7 +354,7 @@ cluster as is described in the given links. Then, start with step 5. 1\. Create Kind Cluster ```bash -kind create cluster --name=test-bpfd +kind create cluster --name=test-bpfman ``` 2\. Deploy Cert manager @@ -363,16 +363,16 @@ kind create cluster --name=test-bpfd kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.yaml ``` -3\. Deploy bpfd Crds +3\. Deploy bpfman Crds ```bash -kubectl apply -f https://github.com/bpfd-dev/bpfd/releases/download/v0.2.1/bpfd-crds-install-v0.2.1.yaml +kubectl apply -f https://github.com/bpfman/bpfman/releases/download/v0.2.1/bpfman-crds-install-v0.2.1.yaml ``` -4\. Deploy bpfd-operator +4\. Deploy bpfman-operator ```bash -kubectl apply -f https://github.com/bpfd-dev/bpfd/releases/download/v0.2.1/bpfd-operator-install-v0.2.1.yaml +kubectl apply -f https://github.com/bpfman/bpfman/releases/download/v0.2.1/bpfman-operator-install-v0.2.1.yaml ``` 5\. Verify the deployment @@ -383,28 +383,28 @@ kubectl get pods -A ```bash NAMESPACE NAME READY STATUS RESTARTS AGE -bpfd bpfd-daemon-nkzpf 2/2 Running 0 28s -bpfd bpfd-operator-77d697fdd4-clrf7 2/2 Running 0 33s +bpfman bpfman-daemon-nkzpf 2/2 Running 0 28s +bpfman bpfman-operator-77d697fdd4-clrf7 2/2 Running 0 33s cert-manager cert-manager-99bb69456-x8n84 1/1 Running 0 57s cert-manager cert-manager-cainjector-ffb4747bb-pt4hr 1/1 Running 0 57s cert-manager cert-manager-webhook-545bd5d7d8-z5brw 1/1 Running 0 57s kube-system coredns-565d847f94-gjjft 1/1 Running 0 61s kube-system coredns-565d847f94-mf2cq 1/1 Running 0 61s -kube-system etcd-test-bpfd-control-plane 1/1 Running 0 76s +kube-system etcd-test-bpfman-control-plane 1/1 Running 0 76s kube-system kindnet-lv6f9 1/1 Running 0 61s -kube-system kube-apiserver-test-bpfd-control-plane 1/1 Running 0 76s -kube-system kube-controller-manager-test-bpfd-control-plane 1/1 Running 0 77s +kube-system kube-apiserver-test-bpfman-control-plane 1/1 Running 0 76s +kube-system kube-controller-manager-test-bpfman-control-plane 1/1 Running 0 77s kube-system kube-proxy-dtmvb 1/1 Running 0 61s -kube-system kube-scheduler-test-bpfd-control-plane 1/1 Running 0 78s +kube-system kube-scheduler-test-bpfman-control-plane 1/1 Running 0 78s local-path-storage local-path-provisioner-684f458cdd-8gxxv 1/1 Running 0 61s ``` -Note that we have the bpfd-operator, bpf-daemon and cert-manager pods running. +Note that we have the bpfman-operator, bpf-daemon and cert-manager pods running. 6\. Deploy the XDP counter program and user space application ```bash -kubectl apply -f https://github.com/bpfd-dev/bpfd/releases/download/v0.2.1/go-xdp-counter-install-v0.2.1.yaml +kubectl apply -f https://github.com/bpfman/bpfman/releases/download/v0.2.1/go-xdp-counter-install-v0.2.1.yaml ``` 7\. Confirm that the programs are loaded @@ -423,7 +423,7 @@ go-xdp-counter-ds-9lpgp 0/1 ContainerCreating 0 5s XDP program: ```bash -kubectl get xdpprograms.bpfd.dev -o wide +kubectl get xdpprograms.bpfman.io -o wide ``` ```bash @@ -463,7 +463,7 @@ kubectl logs go-xdp-counter-ds-9lpgp -n go-xdp-counter | tail ```yaml kubectl apply -f - </github.com/bpfd-dev/bpfd/target/debug/bpfd", // Local path to latest debug binary. + "program": "/github.com/bpfman/bpfman/target/debug/bpfman", // Local path to latest debug binary. "initCommands": [ "platform select remote-linux", // Execute `platform list` for a list of available remote platform plugins. "platform connect connect://:8081", // replace @@ -20,11 +20,11 @@ "cargo": { "args": [ "build", - "--bin=bpfd", - "--package=bpfd" + "--bin=bpfman", + "--package=bpfman" ], "filter": { - "name": "bpfd", + "name": "bpfman", "kind": "bin" } }, diff --git a/docs/developer-guide/develop-operator.md b/docs/developer-guide/develop-operator.md index 352ef6b01..51c32d078 100644 --- a/docs/developer-guide/develop-operator.md +++ b/docs/developer-guide/develop-operator.md @@ -1,20 +1,20 @@ -# Developing the bpfd-operator +# Developing the bpfman-operator -This section is intended to give developer level details regarding the layout and design of the bpfd-operator. +This section is intended to give developer level details regarding the layout and design of the bpfman-operator. At its core the operator was implemented using the [operator-sdk framework](https://sdk.operatorframework.io/) which make those docs another good resource if anything is missed here. ## High level design overview -This repository houses two main processes, the `bpfd-agent` and the `bpfd-operator` along with CRD api definitions +This repository houses two main processes, the `bpfman-agent` and the `bpfman-operator` along with CRD api definitions for `BpfProgram` and `*Program` Objects. The following diagram depicts how all these components work together to create a functioning operator. -![bpfd on K8s](../img/bpfd-on-k8s.png) +![bpfman on K8s](../img/bpfman-on-k8s.png) ## Building and deploying -For building and deploying the bpfd-operator simply see the attached `Make help` +For building and deploying the bpfman-operator simply see the attached `Make help` output. ```bash @@ -48,10 +48,10 @@ Development build-release-yamls Generate the crd install bundle for a specific release version. Build - build Build bpfd-operator and bpfd-agent binaries. - build-images Build bpfd, bpfd-agent, and bpfd-operator images. - push-images Push bpfd, bpfd-agent, bpfd-operator images. - load-images-kind Load bpfd, bpfd-agent, and bpfd-operator images into the running local kind devel cluster. + build Build bpfman-operator and bpfman-agent binaries. + build-images Build bpfman, bpfman-agent, and bpfman-operator images. + push-images Push bpfman, bpfman-agent, bpfman-operator images. + load-images-kind Load bpfman, bpfman-agent, and bpfman-operator images into the running local kind devel cluster. bundle-build Build the bundle image. bundle-push Push the bundle image. catalog-build Build a catalog image. @@ -63,14 +63,14 @@ CRD Deployment Vanilla K8s Deployment setup-kind Setup Kind cluster - deploy Deploy bpfd-operator to the K8s cluster specified in ~/.kube/config with the csi driver initialized. - undeploy Undeploy bpfd-operator from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. + deploy Deploy bpfman-operator to the K8s cluster specified in ~/.kube/config with the csi driver initialized. + undeploy Undeploy bpfman-operator from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. kind-reload-images Reload locally build images into a kind cluster and restart the ds and deployment so they're picked up. - run-on-kind Kind Deploy runs the bpfd-operator on a local kind cluster using local builds of bpfd, bpfd-agent, and bpfd-operator + run-on-kind Kind Deploy runs the bpfman-operator on a local kind cluster using local builds of bpfman, bpfman-agent, and bpfman-operator Openshift Deployment - deploy-openshift Deploy bpfd-operator to the Openshift cluster specified in ~/.kube/config. - undeploy-openshift Undeploy bpfd-operator from the Openshift cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. + deploy-openshift Deploy bpfman-operator to the Openshift cluster specified in ~/.kube/config. + undeploy-openshift Undeploy bpfman-operator from the Openshift cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. ``` ## Running Locally in KIND @@ -81,11 +81,11 @@ To run locally in a kind cluster with an up to date build simply run: make run-on-kind ``` -The container images used for `bpfd`,`bpfd-agent`, and `bpfd-operator` can also be manually configured, +The container images used for `bpfman`,`bpfman-agent`, and `bpfman-operator` can also be manually configured, by default local image builds will be used for the kind deployment. ```bash -BPFD_IMG= BPFD_AGENT_IMG= BPFD_OPERATOR_IMG= make run-on-kind +BPFMAN_IMG= BPFMAN_AGENT_IMG= BPFMAN_OPERATOR_IMG= make run-on-kind ``` Then rebuild and load a fresh build run: @@ -94,24 +94,24 @@ Then rebuild and load a fresh build run: make kind-reload-images ``` -Which will rebuild the bpfd-operator, bpfd-agent, and bpfd images and load them into the kind cluster. +Which will rebuild the bpfman-operator, bpfman-agent, and bpfman images and load them into the kind cluster. ## Testing Locally -To run all of the **Unit Tests** defined in the bpfd-operator controller code simply run `make test`. +To run all of the **Unit Tests** defined in the bpfman-operator controller code simply run `make test`. To run **Integration Tests** locally: 1. Build the images locally with the `int-test` tag. ```bash - BPFD_AGENT_IMG=quay.io/bpfd/bpfd-agent:int-test BPFD_IMG=quay.io/bpfd/bpfd:int-test BPFD_OPERATOR_IMG=quay.io/bpfd/bpfd-operator:int-test make build-images + BPFMAN_AGENT_IMG=quay.io/bpfman/bpfman-agent:int-test BPFMAN_IMG=quay.io/bpfman/bpfman:int-test BPFMAN_OPERATOR_IMG=quay.io/bpfman/bpfman-operator:int-test make build-images ``` 2. Run the integration test suite. ```bash - BPFD_AGENT_IMG=quay.io/bpfd/bpfd-agent:int-test BPFD_IMG=quay.io/bpfd/bpfd:int-test BPFD_OPERATOR_IMG=quay.io/bpfd/bpfd-operator:int-test make test-integration + BPFMAN_AGENT_IMG=quay.io/bpfman/bpfman-agent:int-test BPFMAN_IMG=quay.io/bpfman/bpfman:int-test BPFMAN_OPERATOR_IMG=quay.io/bpfman/bpfman-operator:int-test make test-integration ``` Additionally the integration test can be configured with the following environment variables: @@ -123,7 +123,7 @@ Additionally the integration test can be configured with the following environme ## Project Layout -The bpfd-operator project layout is guided by the recommendations from both the +The bpfman-operator project layout is guided by the recommendations from both the [operator-sdk framework](https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/#project-layout) and the [standard golang project-layout](https://github.com/golang-standards/project-layout). The following is a brief description of the main directories and their contents. @@ -135,52 +135,52 @@ The following is a brief description of the main directories and their contents. auto-generated register and deepcopy methods(`zz_generated.deepcopy.go` and `zz_generate_register.go`). - `/bundle`: Contains the OLM bundle manifests and metadata for the operator. More details can be found in the operator-sdk documentation. -- `/cmd`: Contains the main entry-points for the bpfd-operator and bpfd-agent processes. -- `/config`: Contains the configuration files for launching the bpfd-operator on a cluster. - - `/bpfd-deployment`: Contains static deployment yamls for the bpfd-daemon, this includes two containers, - one for `bpfd` and the other for the `bpfd-agent`. +- `/cmd`: Contains the main entry-points for the bpfman-operator and bpfman-agent processes. +- `/config`: Contains the configuration files for launching the bpfman-operator on a cluster. + - `/bpfman-deployment`: Contains static deployment yamls for the bpfman-daemon, this includes two containers, + one for `bpfman` and the other for the `bpfman-agent`. This DaemonSet yaml is NOT deployed statically by kustomize, instead it's statically copied into the operator - image which is then responsible for deploying and configuring the bpfd-daemon DaemonSet. - Lastly, this directory also contains the default config used to configure the bpfd-daemon, along with the - cert-manager certificates used to encrypt communication between the bpfd-agent and bpfd. - - `/bpfd-operator-deployment:` Contains the static deployment yaml for the bpfd-operator. This is deployed + image which is then responsible for deploying and configuring the bpfman-daemon DaemonSet. + Lastly, this directory also contains the default config used to configure the bpfman-daemon, along with the + cert-manager certificates used to encrypt communication between the bpfman-agent and bpfman. + - `/bpfman-operator-deployment:` Contains the static deployment yaml for the bpfman-operator. This is deployed statically by kustomize. - - `/crd`: Contains the CRD manifests for all of the bpfd-operator APIs. + - `/crd`: Contains the CRD manifests for all of the bpfman-operator APIs. - **`/bases`**: Is where the actual CRD definitions are stored. These definitions are auto-generated by [controller-gen](https://book.kubebuilder.io/reference/controller-gen.html). - - `/default`: Contains the default deployment configuration for the bpfd-operator. + - `/default`: Contains the default deployment configuration for the bpfman-operator. - `/manifests`: Contains the bases for generating OLM manifests. - - `/openshift`: Contains the Openshift specific deployment configuration for the bpfd-operator. + - `/openshift`: Contains the Openshift specific deployment configuration for the bpfman-operator. - `/prometheus`: Contains the prometheus manifests used to deploy Prometheus to a cluster. - At the time of writing this the bpfd-operator is NOT exposing any metrics to prometheus, but this is a future goal. - - **`/rbac`**: Contains rbac yamls for getting bpfd and the bpfd-operator up and running on Kubernetes. - **`/bpfd-agent`**: Contains the rbac yamls for the bpfd-agent. - They are automatically generated by kubebuilder via build tags in the bpfd-agent controller code. - **`/bpfd-operator`**: Contains the rbac yamls for the bpfd-operator. - They are automatically generated by kubebuilder via build tags in the bpfd-operator controller code. + At the time of writing this the bpfman-operator is NOT exposing any metrics to prometheus, but this is a future goal. + - **`/rbac`**: Contains rbac yamls for getting bpfman and the bpfman-operator up and running on Kubernetes. + **`/bpfman-agent`**: Contains the rbac yamls for the bpfman-agent. + They are automatically generated by kubebuilder via build tags in the bpfman-agent controller code. + **`/bpfman-operator`**: Contains the rbac yamls for the bpfman-operator. + They are automatically generated by kubebuilder via build tags in the bpfman-operator controller code. - `/samples`: Contains sample CR definitions that can be deployed by users for each of our supported APIs. - `/scorecard`: Contains the scorecard manifests used to deploy scorecard to a cluster. At the time of writing - this the bpfd-operator is NOT running any scorecard tests. - - `/test`: Contains the test manifests used to deploy the bpfd-operator to a kind cluster for integration testing. -- `/controllers`: Contains the controller implementations for all of the bpfd-operator APIs. + this the bpfman-operator is NOT running any scorecard tests. + - `/test`: Contains the test manifests used to deploy the bpfman-operator to a kind cluster for integration testing. +- `/controllers`: Contains the controller implementations for all of the bpfman-operator APIs. Each controller is responsible for reconciling the state of the cluster with the desired state defined by the user. This is where the source of truth for the auto-generated RBAC can be found, keep an eye out for - `//+kubebuilder:rbac:groups=bpfd.dev` comment tags. - - `/bpfdagent`: Contains the controller implementations which reconcile user created `*Program` types to multiple + `//+kubebuilder:rbac:groups=bpfman.io` comment tags. + - `/bpfmanagent`: Contains the controller implementations which reconcile user created `*Program` types to multiple `BpfProgram` objects. - - `/bpfdoperator`: Contains the controller implementations which reconcile global `BpfProgram` object state back to + - `/bpfmanoperator`: Contains the controller implementations which reconcile global `BpfProgram` object state back to the user by ensuring the user created `*Program` objects are reporting the correct status. -- `/hack`: Contains any scripts+static files used by the bpfd-operator to facilitate development. -- `/internal`: Contains all private library code and is used by the bpfd-operator and bpfd-agent controllers. +- `/hack`: Contains any scripts+static files used by the bpfman-operator to facilitate development. +- `/internal`: Contains all private library code and is used by the bpfman-operator and bpfman-agent controllers. - **`/pkg`**: Contains all public library code this is consumed externally and internally. - - **`/client`**: Contains the autogenerated clientset, informers and listers for all of the bpfd-operator APIs. + - **`/client`**: Contains the autogenerated clientset, informers and listers for all of the bpfman-operator APIs. These are autogenerated by the [k8s.io/code-generator project](https://github.com/kubernetes/code-generator), - and can be consumed by users wishing to programmatically interact with bpfd specific APIs. + and can be consumed by users wishing to programmatically interact with bpfman specific APIs. - `/helpers`: Contains helper functions which can be consumed by users wishing to programmatically interact with - bpfd specific APIs. -- `/test/integration`: Contains integration tests for the bpfd-operator. - These tests are run against a kind cluster and are responsible for testing the bpfd-operator in a real cluster + bpfman specific APIs. +- `/test/integration`: Contains integration tests for the bpfman-operator. + These tests are run against a kind cluster and are responsible for testing the bpfman-operator in a real cluster environment. It uses the [kubernetes-testing-framework project](https://github.com/Kong/kubernetes-testing-framework) to programmatically spin-up all of the required infrastructure for our unit tests. -- `Makefile`: Contains all of the make targets used to build, test, and generate code used by the bpfd-operator. +- `Makefile`: Contains all of the make targets used to build, test, and generate code used by the bpfman-operator. diff --git a/docs/developer-guide/documentation.md b/docs/developer-guide/documentation.md index 902d38822..13b03614a 100644 --- a/docs/developer-guide/documentation.md +++ b/docs/developer-guide/documentation.md @@ -1,7 +1,7 @@ # Documentation -This section describes how to modify the related documentation around bpfd. -All bpfd's documentation is written in Markdown, and leverages [mkdocs](https://www.mkdocs.org/) +This section describes how to modify the related documentation around bpfman. +All bpfman's documentation is written in Markdown, and leverages [mkdocs](https://www.mkdocs.org/) to generate a static site, which is hosted on [netlify](https://www.netlify.com/). If this is the first time building using `mkdocs`, jump to the @@ -15,7 +15,7 @@ This section describes some notes on the dos and don'ts when writing documentati ### Website Management The headings and layout of the website, as well as other configuration settings, are managed -from the [mkdocs.yml](https://github.com/bpfd-dev/bpfd/blob/main/mkdocs.yml) file in the +from the [mkdocs.yml](https://github.com/bpfman/bpfman/blob/main/mkdocs.yml) file in the project root directory. ### Markdown Style @@ -33,12 +33,12 @@ When writing documentation via a Markdown file, the following format has been fo There are a set of well known governance files that are typically placed in the root directory of most projects, like README.md, MAINTAINERS.md, CONTRIBUTING.md, etc. `mkdocs` expects all files used in the static website to be located under a common directory, -`docs/` for bpfd. +`docs/` for bpfman. To reference the governance files from the static website, a directory (`docs/governance/`) was created with a file for each governance file, the only contains `--8<--` and the file name. This indicates to `mkdocs` to pull the additional file from the project root directory. -For example: [docs/governance/MEETINGS.md](https://github.com/bpfd-dev/bpfd/blob/main/docs/governance/MEETINGS.md) +For example: [docs/governance/MEETINGS.md](https://github.com/bpfman/bpfman/blob/main/docs/governance/MEETINGS.md) > **NOTE:** This works for the website generation, but if a Markdown file is viewed through Github (not the website), the link is broken. @@ -47,23 +47,23 @@ For example: [docs/governance/MEETINGS.md](https://github.com/bpfd-dev/bpfd/blob ### docs/developer-guide/api-spec.md The file -[docs/developer-guide/api-spec.md](https://github.com/bpfd-dev/bpfd/blob/main/docs/developer-guide/api-spec.md) +[docs/developer-guide/api-spec.md](https://github.com/bpfman/bpfman/blob/main/docs/developer-guide/api-spec.md) documents the CRDs used in a Kubernetes deployment. The contents are auto-generated when PRs are pushed to Github. -The script [scripts/make-docs.sh](https://github.com/bpfd-dev/bpfd/blob/main/scripts/make-docs.sh) +The script [scripts/make-docs.sh](https://github.com/bpfman/bpfman/blob/main/scripts/make-docs.sh) manages the generation of this file. ## Generate Documentation -On each PR pushed to https://github.com/bpfd-dev/bpfd the documentation is generated. +On each PR pushed to https://github.com/bpfman/bpfman the documentation is generated. To preview of the generated site, click on the `Details` link of the -`netlify/bpfd/deploy-preview` Check from the Github GUI. +`netlify/bpfman/deploy-preview` Check from the Github GUI. If you would like to test locally, build and preview the generated documentation, -from the bpfd root directory, use `mkdocs` to build: +from the bpfman root directory, use `mkdocs` to build: ```console -cd bpfd/ +cd bpfman/ mkdocs build ``` diff --git a/docs/developer-guide/image-build.md b/docs/developer-guide/image-build.md index e8ff161b7..84ea6250c 100644 --- a/docs/developer-guide/image-build.md +++ b/docs/developer-guide/image-build.md @@ -1,15 +1,15 @@ -# bpfd Container Images +# bpfman Container Images -Container images for the `bpfd` and `bpfctl` binaries are automatically built and -pushed to `quay.io/bpfd` whenever code is merged into the `main` branch of the -`github.com/bpfd-dev/bpfd` repository under the `:latest` tag. +Container images for the `bpfman` and `bpfctl` binaries are automatically built and +pushed to `quay.io/bpfman` whenever code is merged into the `main` branch of the +`github.com/bpfman/bpfman` repository under the `:latest` tag. ## Building the images locally -### bpfd +### bpfman ```sh -docker build -f /packaging/container-deployment/Containerfile.bpfd . -t bpfd:local +docker build -f /packaging/container-deployment/Containerfile.bpfman . -t bpfman:local ``` ### bpfctl @@ -20,14 +20,14 @@ docker build -f /packaging/container-deployment/Containerfile.bpfctl . -t bpfctl ## Running locally in container -### bpfd +### bpfman ```sh -sudo docker run --init --privileged --net=host -v /etc/bpfd/certs/:/etc/bpfd/certs/ -v /sys/fs/bpf:/sys/fs/bpf quay.io/bpfd/bpfd:latest +sudo docker run --init --privileged --net=host -v /etc/bpfman/certs/:/etc/bpfman/certs/ -v /sys/fs/bpf:/sys/fs/bpf quay.io/bpfman/bpfman:latest ``` ### bpfctl ```sh -sudo docker run --init --privileged --net=host -v /etc/bpfd/certs/:/etc/bpfd/certs/ quay.io/bpfd/bpfctl:latest -``` \ No newline at end of file +sudo docker run --init --privileged --net=host -v /etc/bpfman/certs/:/etc/bpfman/certs/ quay.io/bpfman/bpfctl:latest +``` diff --git a/docs/developer-guide/linux-capabilities.md b/docs/developer-guide/linux-capabilities.md index 2c58998b7..b9ba08126 100644 --- a/docs/developer-guide/linux-capabilities.md +++ b/docs/developer-guide/linux-capabilities.md @@ -5,15 +5,15 @@ known as capabilities, which can be independently enabled and disabled. Capabilities are a per-thread attribute. See [capabilities man-page](https://man7.org/linux/man-pages/man7/capabilities.7.html). -When `bpfd` is run as a systemd service, the set of linux capabilities are restricted to only the -required set of capabilities via the `bpfd.service` file using the `AmbientCapabilities` and -`CapabilityBoundingSet` fields (see [bpfd.service](https://github.com/bpfd-dev/bpfd/tree/main/scripts/bpfd.service)). +When `bpfman` is run as a systemd service, the set of linux capabilities are restricted to only the +required set of capabilities via the `bpfman.service` file using the `AmbientCapabilities` and +`CapabilityBoundingSet` fields (see [bpfman.service](https://github.com/bpfman/bpfman/tree/main/scripts/bpfman.service)). All spawned threads are stripped of all capabilities, removing all sudo privileges (see `drop_linux_capabilities()` usage), leaving only the main thread with only the needed set of capabilities. -## Current bpfd Linux Capabilities +## Current bpfman Linux Capabilities -Below are the current set of Linux capabilities required by bpfd to operate: +Below are the current set of Linux capabilities required by bpfman to operate: * **CAP_BPF:** * Required to load BPF programs and create BPF maps. @@ -23,28 +23,28 @@ Below are the current set of Linux capabilities required by bpfd to operate: * **CAP_NET_ADMIN:** * Required for TC programs to attach/detach to/from a qdisc. * **CAP_SETPCAP:** - * Required to allow bpfd to drop Linux Capabilities on spawned threads. + * Required to allow bpfman to drop Linux Capabilities on spawned threads. * **CAP_SYS_ADMIN:** * Kprobe (Kprobe and Uprobe) and Tracepoint programs are considered perfmon programs and require CAP_PERFMON and CAP_SYS_ADMIN to load. * TC and XDP programs are considered admin programs and require CAP_NET_ADMIN and CAP_SYS_ADMIN to load. * **CAP_SYS_RESOURCE:** - * Required by bpfd to call `setrlimit()` on `RLIMIT_MEMLOCK`. + * Required by bpfman to call `setrlimit()` on `RLIMIT_MEMLOCK`. ## Debugging Linux Capabilities -As new features are added, the set of Linux capabilities required by bpfd may change over time. -The following describes the steps to determine the set of capabilities required by bpfd. -If there are any `Permission denied (os error 13)` type errors when starting or running bpfd as a +As new features are added, the set of Linux capabilities required by bpfman may change over time. +The following describes the steps to determine the set of capabilities required by bpfman. +If there are any `Permission denied (os error 13)` type errors when starting or running bpfman as a systemd service, adjusting the linux capabilities is a good place to start. ### Determine Required Capabilities The first step is to turn all capabilities on and see if that fixes the problem. -This can be done without recompiling the code by editing `bpfd.service`. +This can be done without recompiling the code by editing `bpfman.service`. Comment out the finite list of granted capabilities and set to `~`, which indicates all capabilities. ```shell -sudo vi /usr/lib/systemd/system/bpfd.service +sudo vi /usr/lib/systemd/system/bpfman.service : [Service] : @@ -54,15 +54,15 @@ CapabilityBoundingSet=~ #CapabilityBoundingSet=CAP_BPF CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_PERFMON CAP_SETPCAP CAP_SYS_ADMIN CAP_SYS_RESOURCE ``` -Reload the service file and start/restart bpfd and watch the bpfd logs and see if the problem is resolved: +Reload the service file and start/restart bpfman and watch the bpfman logs and see if the problem is resolved: ```shell sudo systemctl daemon-reload -sudo systemctl start bpfd +sudo systemctl start bpfman ``` -If so, then the next step is to watch the set of capabilities being requested by bpfd. -Run the bcc `capable` tool to watch capabilities being requested real-time and restart bpfd: +If so, then the next step is to watch the set of capabilities being requested by bpfman. +Run the bcc `capable` tool to watch capabilities being requested real-time and restart bpfman: ```shell $ sudo /usr/share/bcc/tools/capable @@ -73,10 +73,10 @@ TIME UID PID COMM CAP NAME AUDIT 16:36:00 979 75553 tokio-runtime-w 8 CAP_SETPCAP 1 16:36:00 0 616 systemd-journal 19 CAP_SYS_PTRACE 1 16:36:00 0 616 systemd-journal 19 CAP_SYS_PTRACE 1 -16:36:00 979 75550 bpfd 24 CAP_SYS_RESOURCE 1 -16:36:00 979 75550 bpfd 1 CAP_DAC_OVERRIDE 1 -16:36:00 979 75550 bpfd 21 CAP_SYS_ADMIN 1 -16:36:00 979 75550 bpfd 21 CAP_SYS_ADMIN 1 +16:36:00 979 75550 bpfman 24 CAP_SYS_RESOURCE 1 +16:36:00 979 75550 bpfman 1 CAP_DAC_OVERRIDE 1 +16:36:00 979 75550 bpfman 21 CAP_SYS_ADMIN 1 +16:36:00 979 75550 bpfman 21 CAP_SYS_ADMIN 1 16:36:00 0 75555 modprobe 16 CAP_SYS_MODULE 1 16:36:00 0 628 systemd-udevd 2 CAP_DAC_READ_SEARCH 1 16:36:00 0 75556 bpf_preload 24 CAP_SYS_RESOURCE 1 @@ -89,7 +89,7 @@ TIME UID PID COMM CAP NAME AUDIT : ``` -Compare the output to list in `bpfd.service` and determine the delta. +Compare the output to list in `bpfman.service` and determine the delta. ### Determine Capabilities Per Thread @@ -97,17 +97,17 @@ For additional debugging, it may be helpful to know the granted capabilities on As mentioned above, all spawned threads are stripped of all Linux capabilities, so if a thread is requesting a capability, that functionality should be moved off the spawned thread and onto the main thread. -First, determine the `bpfd` process id, then determine the set of threads: +First, determine the `bpfman` process id, then determine the set of threads: ```shell -$ ps -ef | grep bpfd +$ ps -ef | grep bpfman : -bpfd 75550 1 0 16:36 ? 00:00:00 /usr/sbin/bpfd +bpfman 75550 1 0 16:36 ? 00:00:00 /usr/sbin/bpfman : $ ps -T -p 75550 PID SPID TTY TIME CMD - 75550 75550 ? 00:00:00 bpfd + 75550 75550 ? 00:00:00 bpfman 75550 75551 ? 00:00:00 tokio-runtime-w 75550 75552 ? 00:00:00 tokio-runtime-w 75550 75553 ? 00:00:00 tokio-runtime-w @@ -144,10 +144,10 @@ $ capsh --decode=000000c001201106 0x000000c001201106=cap_dac_override,cap_dac_read_search,cap_setpcap,cap_net_admin,cap_sys_admin,cap_sys_resource,cap_perfmon,cap_bpf ``` -## Removing CAP_BPF from bpfd Clients +## Removing CAP_BPF from bpfman Clients -One of the advantages of using bpfd is that it is doing all the loading and unloading of eBPF programs, -so it requires CAP_BPF, but clients of bpfd are just making gRPC calls to bpfd, so they do not need to +One of the advantages of using bpfman is that it is doing all the loading and unloading of eBPF programs, +so it requires CAP_BPF, but clients of bpfman are just making gRPC calls to bpfman, so they do not need to be privileged or require CAP_BPF. It must be noted that this is only true for kernels 5.19 or higher. Prior to **kernel 5.19**, all eBPF sys calls required CAP_BPF, which are used to access maps shared between diff --git a/docs/developer-guide/logging.md b/docs/developer-guide/logging.md index ffb90f60d..b9ee3e85b 100644 --- a/docs/developer-guide/logging.md +++ b/docs/developer-guide/logging.md @@ -1,10 +1,10 @@ # Logging -This section describes how to enable logging in different `bpfd` deployments. +This section describes how to enable logging in different `bpfman` deployments. -## Local Privileged Bpfd Process +## Local Privileged Bpfman Process -`bpfd` and `bpfctl` use the [env_logger](https://docs.rs/env_logger) crate to log messages to the terminal. +`bpfman` and `bpfctl` use the [env_logger](https://docs.rs/env_logger) crate to log messages to the terminal. By default, only `error` messages are logged, but that can be overwritten by setting the `RUST_LOG` environment variable. Valid values: @@ -18,13 +18,13 @@ Valid values: Example: ```console -$ sudo RUST_LOG=info /usr/local/bin/bpfd -[2022-08-08T20:29:31Z INFO bpfd] Log using env_logger -[2022-08-08T20:29:31Z INFO bpfd::server] Loading static programs from /etc/bpfd/programs.d -[2022-08-08T20:29:31Z INFO bpfd::server::bpf] Map veth12fa8e3 to 13 -[2022-08-08T20:29:31Z INFO bpfd::server] Listening on [::1]:50051 -[2022-08-08T20:29:31Z INFO bpfd::server::bpf] Program added: 1 programs attached to veth12fa8e3 -[2022-08-08T20:29:31Z INFO bpfd::server] Loaded static program pass with UUID d9fd88df-d039-4e64-9f63-19f3e08915ce +$ sudo RUST_LOG=info /usr/local/bin/bpfman +[2022-08-08T20:29:31Z INFO bpfman] Log using env_logger +[2022-08-08T20:29:31Z INFO bpfman::server] Loading static programs from /etc/bpfman/programs.d +[2022-08-08T20:29:31Z INFO bpfman::server::bpf] Map veth12fa8e3 to 13 +[2022-08-08T20:29:31Z INFO bpfman::server] Listening on [::1]:50051 +[2022-08-08T20:29:31Z INFO bpfman::server::bpf] Program added: 1 programs attached to veth12fa8e3 +[2022-08-08T20:29:31Z INFO bpfman::server] Loaded static program pass with UUID d9fd88df-d039-4e64-9f63-19f3e08915ce ``` `bpfctl` has a minimal set of logs, but the infrastructure is in place if needed for future debugging. @@ -38,7 +38,7 @@ sudo RUST_LOG=info bpfctl list ## Systemd Service -If `bpfd` is running as a systemd service, then `bpfd` will log to journald. +If `bpfman` is running as a systemd service, then `bpfman` will log to journald. As with env_logger, by default, `info` and higher messages are logged, but that can be overwritten by setting the `RUST_LOG` environment variable. `bpfctl` won't be run as a service, so it always uses env_logger. @@ -46,15 +46,15 @@ overwritten by setting the `RUST_LOG` environment variable. Example: ```console -sudo vi /usr/lib/systemd/system/bpfd.service +sudo vi /usr/lib/systemd/system/bpfman.service [Unit] -Description=Run bpfd as a service +Description=Run bpfman as a service DefaultDependencies=no After=network.target [Service] Environment="RUST_LOG=Info" <==== Set Log Level Here -ExecStart=/usr/sbin/bpfd +ExecStart=/usr/sbin/bpfman AmbientCapabilities=CAP_BPF CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_PERFMON CAP_SYS_ADMIN CAP_SYS_RESOURCE CapabilityBoundingSet=CAP_BPF CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_PERFMON CAP_SYS_ADMIN CAP_SYS_RESOURCE ``` @@ -62,98 +62,98 @@ CapabilityBoundingSet=CAP_BPF CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_PERFMON CAP_ Start the service: ```console -sudo systemctl start bpfd.service +sudo systemctl start bpfman.service ``` Check the logs: ```console -$ sudo journalctl -f -u bpfd -Aug 08 16:25:04 ebpf03 systemd[1]: Started bpfd.service - Run bpfd as a service. -Aug 08 16:25:04 ebpf03 bpfd[180118]: Log using journald -Aug 08 16:25:04 ebpf03 bpfd[180118]: Loading static programs from /etc/bpfd/programs.d -Aug 08 16:25:04 ebpf03 bpfd[180118]: Map veth12fa8e3 to 13 -Aug 08 16:25:04 ebpf03 bpfd[180118]: Listening on [::1]:50051 -Aug 08 16:25:04 ebpf03 bpfd[180118]: Program added: 1 programs attached to veth12fa8e3 -Aug 08 16:25:04 ebpf03 bpfd[180118]: Loaded static program pass with UUID a3ffa14a-786d-48ad-b0cd-a4802f0f10b6 +$ sudo journalctl -f -u bpfman +Aug 08 16:25:04 ebpf03 systemd[1]: Started bpfman.service - Run bpfman as a service. +Aug 08 16:25:04 ebpf03 bpfman[180118]: Log using journald +Aug 08 16:25:04 ebpf03 bpfman[180118]: Loading static programs from /etc/bpfman/programs.d +Aug 08 16:25:04 ebpf03 bpfman[180118]: Map veth12fa8e3 to 13 +Aug 08 16:25:04 ebpf03 bpfman[180118]: Listening on [::1]:50051 +Aug 08 16:25:04 ebpf03 bpfman[180118]: Program added: 1 programs attached to veth12fa8e3 +Aug 08 16:25:04 ebpf03 bpfman[180118]: Loaded static program pass with UUID a3ffa14a-786d-48ad-b0cd-a4802f0f10b6 ``` Stop the service: ```console -sudo systemctl stop bpfd.service +sudo systemctl stop bpfman.service ``` ## Kubernetes Deployment -When `bpfd` is run in a Kubernetes deployment, there is the bpfd Daemonset that runs on every node +When `bpfman` is run in a Kubernetes deployment, there is the bpfman Daemonset that runs on every node and the bpd Operator that runs on the control plane: ```console kubectl get pods -A NAMESPACE NAME READY STATUS RESTARTS AGE -bpfd bpfd-daemon-dgqzw 2/2 Running 0 3d22h -bpfd bpfd-daemon-gqsgd 2/2 Running 0 3d22h -bpfd bpfd-daemon-zx9xr 2/2 Running 0 3d22h -bpfd bpfd-operator-7fbf4888c4-z8w76 2/2 Running 0 3d22h +bpfman bpfman-daemon-dgqzw 2/2 Running 0 3d22h +bpfman bpfman-daemon-gqsgd 2/2 Running 0 3d22h +bpfman bpfman-daemon-zx9xr 2/2 Running 0 3d22h +bpfman bpfman-operator-7fbf4888c4-z8w76 2/2 Running 0 3d22h : ``` -### bpfd Daemonset +### bpfman Daemonset -`bpfd` and `bpfd-agent` are running in the bpfd daemonset. +`bpfman` and `bpfman-agent` are running in the bpfman daemonset. #### View Logs -To view the `bpfd` logs: +To view the `bpfman` logs: ```console -kubectl logs -n bpfd bpfd-daemon-dgqzw -c bpfd -[2023-05-05T14:41:26Z INFO bpfd] Log using env_logger -[2023-05-05T14:41:26Z INFO bpfd] Has CAP_BPF: false -[2023-05-05T14:41:26Z INFO bpfd] Has CAP_SYS_ADMIN: true +kubectl logs -n bpfman bpfman-daemon-dgqzw -c bpfman +[2023-05-05T14:41:26Z INFO bpfman] Log using env_logger +[2023-05-05T14:41:26Z INFO bpfman] Has CAP_BPF: false +[2023-05-05T14:41:26Z INFO bpfman] Has CAP_SYS_ADMIN: true : ``` -To view the `bpfd-agent` logs: +To view the `bpfman-agent` logs: ```console -kubectl logs -n bpfd bpfd-daemon-dgqzw -c bpfd-agent +kubectl logs -n bpfman bpfman-daemon-dgqzw -c bpfman-agent 2023-05-05T14:41:27Z INFO controller-runtime.metrics Metrics server is starting to listen {"addr": ":8080"} 2023-05-05T14:41:27Z INFO tls-internal Reading... - {"Default config path": "/etc/bpfd/bpfd.toml"} -2023-05-05T14:41:27Z INFO setup Waiting for active connection to bpfd at %s {"addr": "localhost:50051", "creds": {}} + {"Default config path": "/etc/bpfman/bpfman.toml"} +2023-05-05T14:41:27Z INFO setup Waiting for active connection to bpfman at %s {"addr": "localhost:50051", "creds": {}} : ``` #### Change Log Level -To change the log level of the agent or daemon, edit the `bpfd-config` ConfigMap. -The `bpfd-operator` will detect the change and restart the bpfd daemonset with the updated values. +To change the log level of the agent or daemon, edit the `bpfman-config` ConfigMap. +The `bpfman-operator` will detect the change and restart the bpfman daemonset with the updated values. ```console -kubectl edit configmaps -n bpfd bpfd-config +kubectl edit configmaps -n bpfman bpfman-config apiVersion: v1 data: - bpfd.agent.image: quay.io/bpfd/bpfd-agent:latest - bpfd.image: quay.io/bpfd/bpfd:latest - bpfd.log.level: info <==== Set bpfd Log Level Here - bpfd.agent.log.level: info <==== Set bpfd agent Log Level Here - bpfd.toml: | + bpfman.agent.image: quay.io/bpfman/bpfman-agent:latest + bpfman.image: quay.io/bpfman/bpfman:latest + bpfman.log.level: info <==== Set bpfman Log Level Here + bpfman.agent.log.level: info <==== Set bpfman agent Log Level Here + bpfman.toml: | [[grpc.endpoints]] type = "unix" - path = "/bpfd-sock/bpfd.sock" + path = "/bpfman-sock/bpfman.sock" enabled = true kind: ConfigMap metadata: creationTimestamp: "2023-05-05T14:41:19Z" - name: bpfd-config - namespace: bpfd + name: bpfman-config + namespace: bpfman resourceVersion: "700803" uid: 0cc04af4-032c-4712-b824-748b321d319b ``` -Valid values for the **daemon** (`bpfd.log.level`) are: +Valid values for the **daemon** (`bpfman.log.level`) are: * `error` * `warn` @@ -164,29 +164,29 @@ Valid values for the **daemon** (`bpfd.log.level`) are: `trace` can be very verbose. More information can be found regarding Rust's env_logger [here](https://docs.rs/env_logger/latest/env_logger/). -Valid values for the **agent** (`bpfd.agent.log.level`) are: +Valid values for the **agent** (`bpfman.agent.log.level`) are: * `info` * `debug` * `trace` -### bpfd Operator +### bpfman Operator -The bpfd Operator is running as a Deployment with a ReplicaSet of one. -It runs with the containers `bpfd-operator` and `kube-rbac-proxy`. +The bpfman Operator is running as a Deployment with a ReplicaSet of one. +It runs with the containers `bpfman-operator` and `kube-rbac-proxy`. #### View Logs -To view the `bpfd-operator` logs: +To view the `bpfman-operator` logs: ```console -kubectl logs -n bpfd bpfd-operator-7fbf4888c4-z8w76 -c bpfd-operator +kubectl logs -n bpfman bpfman-operator-7fbf4888c4-z8w76 -c bpfman-operator {"level":"info","ts":"2023-05-09T18:37:11Z","logger":"controller-runtime.metrics","msg":"Metrics server is starting to listen","addr":"127.0.0.1:8080"} {"level":"info","ts":"2023-05-09T18:37:11Z","logger":"setup","msg":"starting manager"} {"level":"info","ts":"2023-05-09T18:37:11Z","msg":"Starting server","kind":"health probe","addr":"[::]:8081"} {"level":"info","ts":"2023-05-09T18:37:11Z","msg":"Starting server","path":"/metrics","kind":"metrics","addr":"127.0.0.1:8080"} -I0509 18:37:11.262885 1 leaderelection.go:248] attempting to acquire leader lease bpfd/8730d955.bpfd.dev... -I0509 18:37:11.268918 1 leaderelection.go:258] successfully acquired lease bpfd/8730d955.bpfd.dev +I0509 18:37:11.262885 1 leaderelection.go:248] attempting to acquire leader lease bpfman/8730d955.bpfman.io... +I0509 18:37:11.268918 1 leaderelection.go:258] successfully acquired lease bpfman/8730d955.bpfman.io {"level":"info","ts":"2023-05-09T18:37:11Z","msg":"Starting EventSource","controller":"configmap","controllerGroup":"","controllerKind":"ConfigMap","source":"kind source: *v1.ConfigMap"} : ``` @@ -194,7 +194,7 @@ I0509 18:37:11.268918 1 leaderelection.go:258] successfully acquired lease To view the `kube-rbac-proxy` logs: ```console -kubectl logs -n bpfd bpfd-operator-7fbf4888c4-z8w76 -c kube-rbac-proxy +kubectl logs -n bpfman bpfman-operator-7fbf4888c4-z8w76 -c kube-rbac-proxy I0509 18:37:11.063386 1 main.go:186] Valid token audiences: I0509 18:37:11.063485 1 main.go:316] Generating self signed cert as no cert is provided I0509 18:37:11.955256 1 main.go:366] Starting TCP socket on 0.0.0.0:8443 @@ -203,11 +203,11 @@ I0509 18:37:11.955849 1 main.go:373] Listening securely on 0.0.0.0:8443 #### Change Log Level -To change the log level, edit the `bpfd-operator` Deployment. -The change will get detected and the bpfd operator pod will get restarted with the updated log level. +To change the log level, edit the `bpfman-operator` Deployment. +The change will get detected and the bpfman operator pod will get restarted with the updated log level. ```console -kubectl edit deployment -n bpfd bpfd-operator +kubectl edit deployment -n bpfman bpfman-operator apiVersion: apps/v1 kind: Deployment metadata: @@ -232,11 +232,11 @@ spec: - --metrics-bind-address=127.0.0.1:8080 - --leader-elect command: - - /bpfd-operator + - /bpfman-operator env: - name: GO_LOG value: info <==== Set Log Level Here - image: quay.io/bpfd/bpfd-operator:latest + image: quay.io/bpfman/bpfman-operator:latest imagePullPolicy: IfNotPresent : ``` diff --git a/docs/developer-guide/operator-quick-start.md b/docs/developer-guide/operator-quick-start.md index 4fb6eb3d1..ae8d7373e 100644 --- a/docs/developer-guide/operator-quick-start.md +++ b/docs/developer-guide/operator-quick-start.md @@ -1,21 +1,21 @@ -# Deploying the bpfd-operator +# Deploying the bpfman-operator -The `bpfd-operator` repository exists in order to deploy and manage bpfd within a Kubernetes cluster. +The `bpfman-operator` repository exists in order to deploy and manage bpfman within a Kubernetes cluster. This operator was built utilizing some great tooling provided by the [operator-sdk library](https://sdk.operatorframework.io/). A great first step in understanding some of the functionality can be to just run `make help`. ## Deploy Locally via KIND -After reviewing the possible make targets it's quick and easy to get bpfd deployed locally on your system +After reviewing the possible make targets it's quick and easy to get bpfman deployed locally on your system via a [KIND cluster](https://kind.sigs.k8s.io/) with: ```bash -cd bpfd/bpfd-operator +cd bpfman/bpfman-operator make run-on-kind ``` ->> **NOTE:** By default, bpfd-operator deploys bpfd with CSI enabled. +>> **NOTE:** By default, bpfman-operator deploys bpfman with CSI enabled. CSI requires Kubernetes v1.26 due to a PR ([kubernetes/kubernetes#112597](https://github.com/kubernetes/kubernetes/pull/112597)) that addresses a gRPC Protocol Error that was seen in the CSI client code and it doesn't appear to have @@ -33,7 +33,7 @@ The Openshift cluster needs to be up and running and specified in `~/.kube/confi file. ```bash -cd bpfd/bpfd-operator +cd bpfman/bpfman-operator make deploy-openshift ``` @@ -45,26 +45,26 @@ make undeploy-openshift ### 2. Via the OLM bundle -The other option for installing the bpfd-operator is to install it using +The other option for installing the bpfman-operator is to install it using [OLM bundle](https://www.redhat.com/en/blog/deploying-operators-olm-bundles). First setup the namespace and certificates for the operator with: ```bash -cd bpfd/bpfd-operator +cd bpfman/bpfman-operator oc apply -f ./hack/ocp-scc-hacks.yaml ``` Then use `operator-sdk` to install the bundle like so: ```bash -operator-sdk run bundle quay.io/bpfd/bpfd-operator-bundle:latest --namespace openshift-bpfd +operator-sdk run bundle quay.io/bpfman/bpfman-operator-bundle:latest --namespace openshift-bpfman ``` Which can then be cleaned up at a later time with: ```bash -operator-sdk cleanup bpfd-operator +operator-sdk cleanup bpfman-operator ``` followed by @@ -75,16 +75,16 @@ oc delete -f ./hack/ocp-scc-hacks.yaml ## Verify the Installation -Independent of the method used to deploy, if the bpfd-operator came up successfully -you will see the bpfd-daemon and bpfd-operator pods running without errors: +Independent of the method used to deploy, if the bpfman-operator came up successfully +you will see the bpfman-daemon and bpfman-operator pods running without errors: ```bash -kubectl get pods -n bpfd +kubectl get pods -n bpfman NAME READY STATUS RESTARTS AGE -bpfd-daemon-bt5xm 3/3 Running 0 130m -bpfd-daemon-ts7dr 3/3 Running 0 129m -bpfd-daemon-w24pr 3/3 Running 0 130m -bpfd-operator-78cf9c44c6-rv7f2 2/2 Running 0 132m +bpfman-daemon-bt5xm 3/3 Running 0 130m +bpfman-daemon-ts7dr 3/3 Running 0 129m +bpfman-daemon-w24pr 3/3 Running 0 130m +bpfman-operator-78cf9c44c6-rv7f2 2/2 Running 0 132m ``` ## Deploy an eBPF Program to the cluster @@ -92,8 +92,8 @@ bpfd-operator-78cf9c44c6-rv7f2 2/2 Running 0 132m To test the deployment simply deploy one of the sample `xdpPrograms`: ```bash -cd bpfd/bpfd-operator/ -kubectl apply -f config/samples/bpfd.io_v1alpha1_xdp_pass_xdpprogram.yaml +cd bpfman/bpfman-operator/ +kubectl apply -f config/samples/bpfman.io_v1alpha1_xdp_pass_xdpprogram.yaml ``` If loading of the XDP Program to the selected nodes was successful it will be reported @@ -101,15 +101,15 @@ back to the user via the `xdpProgram`'s status field: ```bash kubectl get xdpprogram xdp-pass-all-nodes -o yaml -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"bpfd.dev/v1alpha1","kind":"XdpProgram","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"xdpprogram"},"name":"xdp-pass-all-nodes"},"spec":{"bpffunctionname":"pass","bytecode":{"image":{"url":"quay.io/bpfd-bytecode/xdp_pass:latest"}},"globaldata":{"GLOBAL_u32":[13,12,11,10],"GLOBAL_u8":[1]},"interfaceselector":{"primarynodeinterface":true},"nodeselector":{},"priority":0}} + {"apiVersion":"bpfman.io/v1alpha1","kind":"XdpProgram","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"xdpprogram"},"name":"xdp-pass-all-nodes"},"spec":{"bpffunctionname":"pass","bytecode":{"image":{"url":"quay.io/bpfman-bytecode/xdp_pass:latest"}},"globaldata":{"GLOBAL_u32":[13,12,11,10],"GLOBAL_u8":[1]},"interfaceselector":{"primarynodeinterface":true},"nodeselector":{},"priority":0}} creationTimestamp: "2023-11-07T19:16:39Z" finalizers: - - bpfd.dev.operator/finalizer + - bpfman.io.operator/finalizer generation: 2 labels: app.kubernetes.io/name: xdpprogram @@ -121,7 +121,7 @@ spec: bytecode: image: imagepullpolicy: IfNotPresent - url: quay.io/bpfd-bytecode/xdp_pass:latest + url: quay.io/bpfman-bytecode/xdp_pass:latest globaldata: GLOBAL_u8: AQ== GLOBAL_u32: DQwLCg== @@ -152,20 +152,20 @@ xdp-pass-all-nodes pass {} 0 {"primarynodein ## API Types Overview -See [api-spec.md](./api-spec.md) for a more detailed description of all the bpfd Kubernetes API types. +See [api-spec.md](./api-spec.md) for a more detailed description of all the bpfman Kubernetes API types. ### Multiple Program CRDs -The multiple `*Program` CRDs are the bpfd Kubernetes API objects most relevant to users and can be used to +The multiple `*Program` CRDs are the bpfman Kubernetes API objects most relevant to users and can be used to understand clusterwide state for an eBPF program. It's designed to express how, and where eBPF programs are to be deployed within a Kubernetes cluster. -Currently bpfd supports the use of `xdpProgram`, `tcProgram` and `tracepointProgram` objects. +Currently bpfman supports the use of `xdpProgram`, `tcProgram` and `tracepointProgram` objects. ## BpfProgram CRD -The `BpfProgram` CRD is used internally by the bpfd-deployment to keep track of per node bpfd state +The `BpfProgram` CRD is used internally by the bpfman-deployment to keep track of per node bpfman state such as map pin points, and to report node specific errors back to the user. Kubernetes users/controllers are only allowed to view these objects, NOT create or edit them. -Applications wishing to use bpfd to deploy/manage their eBPF programs in Kubernetes will make use of this +Applications wishing to use bpfman to deploy/manage their eBPF programs in Kubernetes will make use of this object to find references to the bpfMap pin points (`spec.maps`) in order to configure their eBPF programs. diff --git a/docs/developer-guide/testing.md b/docs/developer-guide/testing.md index 873100045..3e924b94f 100644 --- a/docs/developer-guide/testing.md +++ b/docs/developer-guide/testing.md @@ -1,12 +1,12 @@ # Testing This document describes the automated testing that is done for each pull request -submitted to [bpfd](https://github.com/bpfd-dev/bpfd). +submitted to [bpfman](https://github.com/bpfman/bpfman). ## Unit Testing Unit testing is executed as part of the `build` job by running the `cargo test` -command in the top-level bpfd directory. +command in the top-level bpfman directory. ## Go Example Tests @@ -17,7 +17,7 @@ Detailed description TBD ## Basic Integration Tests The full set of basic integration tests are executed by running the following -command in the top-level bpfd directory. +command in the top-level bpfman directory. ```bash cargo xtask integration-test @@ -30,20 +30,20 @@ a list of one or more names at the end of the command as shown below. cargo xtask integration-test -- test_load_unload_xdp test_proceed_on_xdp ``` -The integration tests start a `bpfd` daemon process, and issue `bpfctl` commands +The integration tests start a `bpfman` daemon process, and issue `bpfctl` commands to verify a range of functionality. For XDP and TC programs that are installed on network interfaces, the integration test code creates a test network namespace connected to the host by a veth pair on which the programs are attached. The test code uses the IP subnet 172.37.37.1/24 for the namespace. If that address conflicts with an existing network on the host, it can be changed -by setting the `BPFD_IP_PREFIX` environment variable to one that is available as +by setting the `BPFMAN_IP_PREFIX` environment variable to one that is available as shown below. ```bash -export BPFD_IP_PREFIX="192.168.50" +export BPFMAN_IP_PREFIX="192.168.50" ``` -If bpfd logs are needed to help debug an integration test, set `RUST_LOG` either +If bpfman logs are needed to help debug an integration test, set `RUST_LOG` either globally or for a given test. ```bash @@ -62,7 +62,7 @@ creating traffic if needed, and examining logs to confirm that things are running as expected. Most eBPF test programs are loaded from container images stored on -[quay.io](https://quay.io/repository/bpfd-bytecode/tc_pass). The source code for +[quay.io](https://quay.io/repository/bpfman-bytecode/tc_pass). The source code for the eBPF test programs can be found in the `tests/integration-test/bpf` directory. These programs are compiled by executing `cargo xtask build-ebpf --libbpf-dir ` diff --git a/docs/getting-started/bpfctl-guide.md b/docs/getting-started/bpfctl-guide.md index 4b7aea6b3..8cc52b663 100644 --- a/docs/getting-started/bpfctl-guide.md +++ b/docs/getting-started/bpfctl-guide.md @@ -1,11 +1,11 @@ # bpfctl Guide -`bpfctl` is the command line tool for interacting with `bpfd`. +`bpfctl` is the command line tool for interacting with `bpfman`. `bpfctl` allows the user to `load`, `unload`, `get` and `list` eBPF programs. ## Notes For This Guide -As described in other sections, `bpfd` can be run as either a privileged process or +As described in other sections, `bpfman` can be run as either a privileged process or a systemd service. If run as a privileged process, `bpfctl` will most likely be run from your local development branch and will require `sudo`. @@ -27,9 +27,9 @@ The examples here use `sudo bpfctl` in place of `sudo ./target/debug/bpfctl` for use as your system is deployed. eBPF object files used in the examples are taken from the -[examples](https://github.com/bpfd-dev/bpfd/tree/main/examples) and -[integration-test](https://github.com/bpfd-dev/bpfd/tree/main/tests/integration-test) directories -from the `bpfd` repository. +[examples](https://github.com/bpfman/bpfman/tree/main/examples) and +[integration-test](https://github.com/bpfman/bpfman/tree/main/tests/integration-test) directories +from the `bpfman` repository. ## Basic Syntax @@ -37,7 +37,7 @@ Below are the commands supported by `bpfctl`. ```console sudo bpfctl --help -A client for working with bpfd +A client for working with bpfman Usage: bpfctl ------ @@ -47,7 +47,7 @@ Commands: load-from-file Load an eBPF program from a local .o file load-from-image Load an eBPF program packaged in a OCI container image from a given registry unload Unload an eBPF program using the program id - list List all eBPF programs loaded via bpfd + list List all eBPF programs loaded via bpfman get Get a program's metadata by program id pull-bytecode Pull a bytecode image for future use by a load command help Print this message or the help of the given subcommand(s) @@ -88,7 +88,7 @@ Options: -------- -p, --path Required: Location of local bytecode file as fully qualified file path. - Example: --path $HOME/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o + Example: --path $HOME/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o -n, --name Required: The name of the function that is the entry point for the BPF program @@ -103,7 +103,7 @@ Options: -m, --metadata Optional: Specify Key/Value metadata to be attached to a program when it - is loaded by bpfd. + is loaded by bpfman. Format: = This can later be used to list a certain subset of programs which contain @@ -137,7 +137,7 @@ Commands: Options: -i, --image-url Required: Container Image URL. - Example: --image-url quay.io/bpfd-bytecode/xdp_pass:latest + Example: --image-url quay.io/bpfman-bytecode/xdp_pass:latest -r, --registry-auth Optional: Registry auth for authenticating with the specified image registry. @@ -168,7 +168,7 @@ Options: -m, --metadata Optional: Specify Key/Value metadata to be attached to a program when it - is loaded by bpfd. + is loaded by bpfman. Format: = This can later be used to list a certain subset of programs which contain @@ -221,13 +221,13 @@ Options: Example loading from local file (`--path` is the fully qualified path): ```console -sudo bpfctl load-from-file --path $HOME/src/bpfd/tests/integration-test/bpf/.output/xdp_pass.bpf.o --name "pass" xdp --iface vethb2795c7 --priority 100 +sudo bpfctl load-from-file --path $HOME/src/bpfman/tests/integration-test/bpf/.output/xdp_pass.bpf.o --name "pass" xdp --iface vethb2795c7 --priority 100 ``` Example from image in remote repository (Note: `--name` is built into the image and is not required): ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp_pass:latest xdp --iface vethb2795c7 --priority 100 +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/xdp_pass:latest xdp --iface vethb2795c7 --priority 100 ``` The `tc` command is similar to `xdp`, but it also requires the `direction` option @@ -270,7 +270,7 @@ Options: The following is an example of the `tc` command using short option names: ```console -sudo bpfctl load-from-file -p $HOME/src/bpfd/tests/integration-test/bpf/.output/tc_pass.bpf.o -n "pass" tc -d ingress -i mynet1 -p 40 +sudo bpfctl load-from-file -p $HOME/src/bpfman/tests/integration-test/bpf/.output/tc_pass.bpf.o -n "pass" tc -d ingress -i mynet1 -p 40 ``` For the `tc_pass.bpf.o` program loaded with the command above, the name @@ -289,37 +289,37 @@ Below are some additional examples of `bpfctl load` commands: XDP ```console -sudo bpfctl load-from-file --path $HOME/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o --name "xdp_stats" xdp --iface vethb2795c7 --priority 35 +sudo bpfctl load-from-file --path $HOME/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o --name "xdp_stats" xdp --iface vethb2795c7 --priority 35 ``` TC ```console -sudo bpfctl load-from-file --path $HOME/src/bpfd/examples/go-tc-counter/bpf_bpfel.o --name "stats"" tc --direction ingress --iface vethb2795c7 --priority 110 +sudo bpfctl load-from-file --path $HOME/src/bpfman/examples/go-tc-counter/bpf_bpfel.o --name "stats"" tc --direction ingress --iface vethb2795c7 --priority 110 ``` Kprobe ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/kprobe:latest kprobe -f try_to_wake_up +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/kprobe:latest kprobe -f try_to_wake_up ``` Kretprobe ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/kretprobe:latest kprobe -f try_to_wake_up -r +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/kretprobe:latest kprobe -f try_to_wake_up -r ``` Uprobe ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/uprobe:latest uprobe -f "malloc" -t "libc" +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/uprobe:latest uprobe -f "malloc" -t "libc" ``` Uretprobe ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/uretprobe:latest uprobe -f "malloc" -t "libc" -r +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/uretprobe:latest uprobe -f "malloc" -t "libc" -r ``` ### Setting Global Variables in eBPF Programs @@ -327,7 +327,7 @@ sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/uretprobe:latest u Global variables can be set for any eBPF program type when loading as follows: ```console -sudo bpfctl load-from-file -p $HOME/src/bpfd/tests/integration-test/bpf/.output/tc_pass.bpf.o -g GLOBAL_u8=01020304 GLOBAL_u32=0A0B0C0D -n "pass" tc -d ingress -i mynet1 -p 40 +sudo bpfctl load-from-file -p $HOME/src/bpfman/tests/integration-test/bpf/.output/tc_pass.bpf.o -g GLOBAL_u8=01020304 GLOBAL_u32=0A0B0C0D -n "pass" tc -d ingress -i mynet1 -p 40 ``` Note, that when setting global variables, the eBPF program being loaded must @@ -350,7 +350,7 @@ program's return value. For example, the default `proceed-on` configuration for an `xdp` program can be modified as follows: ```console -sudo bpfctl load-from-file -p $HOME/src/bpfd/tests/integration-test/bpf/.output/xdp_pass.bpf.o -n "pass" xdp -i mynet1 -p 30 --proceed-on drop pass dispatcher_return +sudo bpfctl load-from-file -p $HOME/src/bpfman/tests/integration-test/bpf/.output/xdp_pass.bpf.o -n "pass" xdp -i mynet1 -p 30 --proceed-on drop pass dispatcher_return ``` ### Sharing Maps Between eBPF Programs @@ -363,7 +363,7 @@ maps. One eBPF program must own the maps. ```console -sudo bpfctl load-from-file --path $HOME/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o -n "xdp_stats" xdp --iface vethb2795c7 --priority 100 +sudo bpfctl load-from-file --path $HOME/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o -n "xdp_stats" xdp --iface vethb2795c7 --priority 100 6371 ``` @@ -372,7 +372,7 @@ the program id of the eBPF program that owns the maps using the `--map-owner-id` parameter: ```console -sudo bpfctl load-from-file --path $HOME/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o -n "xdp_stats" --map-owner-id 6371 xdp --iface vethff657c7 --priority 100 +sudo bpfctl load-from-file --path $HOME/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o -n "xdp_stats" --map-owner-id 6371 xdp --iface vethff657c7 --priority 100 6373 ``` @@ -387,13 +387,13 @@ sudo bpfctl list ```console sudo bpfctl get 6371 - Bpfd State + Bpfman State --------------- Name: xdp_stats - Path: /home/<$USER>/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o + Path: /home/<$USER>/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6371 + Map Pin Path: /run/bpfman/fs/maps/6371 Map Owner ID: None Map Used By: 6371 6373 @@ -406,13 +406,13 @@ sudo bpfctl get 6371 ```console sudo bpfctl get 6373 - Bpfd State + Bpfman State --------------- Name: xdp_stats - Path: /home/<$USER>/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o + Path: /home/<$USER>/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6371 + Map Pin Path: /run/bpfman/fs/maps/6371 Map Owner ID: 6371 Map Used By: 6371 6373 @@ -424,10 +424,10 @@ sudo bpfctl get 6373 ``` As the output shows, the first program (`6371`) owns the map, with `Map Owner ID` -of `None` and the `Map Pin Path` (`/run/bpfd/fs/maps/6371`) that includes its own ID. +of `None` and the `Map Pin Path` (`/run/bpfman/fs/maps/6371`) that includes its own ID. The second program (`6373`) references the first program via the `Map Owner ID` set -to `6371` and the `Map Pin Path` (`/run/bpfd/fs/maps/6371`) set to same directory as +to `6371` and the `Map Pin Path` (`/run/bpfman/fs/maps/6371`) set to same directory as the first program, which includes the first program's ID. The output for both commands shows the map is being used by both programs via the `Map Used By` with values of `6371` and `6373`. @@ -442,7 +442,7 @@ sudo bpfctl unload 6373 ## bpfctl list -The `bpfctl list` command lists all the bpfd loaded eBPF programs: +The `bpfctl list` command lists all the bpfman loaded eBPF programs: ```console sudo bpfctl list @@ -487,22 +487,22 @@ sudo bpfctl list --all --program-type tc To retrieve detailed information for a loaded eBPF program, use the `bpfctl get ` command. -If the eBPF program was loaded via bpfd, then there will be a `Bpfd State` -section with bpfd related attributes and a `Kernel State` section with +If the eBPF program was loaded via bpfman, then there will be a `Bpfman State` +section with bpfman related attributes and a `Kernel State` section with kernel information. -If the eBPF program was loaded outside of bpfd, then the `Bpfd State` +If the eBPF program was loaded outside of bpfman, then the `Bpfman State` section will be empty and `Kernel State` section will be populated. ```console sudo bpfctl get 6204 - Bpfd State + Bpfman State --------------- Name: stats - Image URL: quay.io/bpfd-bytecode/go-tc-counter:latest + Image URL: quay.io/bpfman-bytecode/go-tc-counter:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6204 + Map Pin Path: /run/bpfman/fs/maps/6204 Map Owner ID: None Map Used By: 6204 Priority: 100 @@ -530,7 +530,7 @@ sudo bpfctl get 6204 ```console sudo bpfctl get 6190 - Bpfd State + Bpfman State --------------- NONE @@ -581,7 +581,7 @@ Usage: bpfctl pull-bytecode [OPTIONS] --image-url Options: -i, --image-url Required: Container Image URL. - Example: --image-url quay.io/bpfd-bytecode/xdp_pass:latest + Example: --image-url quay.io/bpfman-bytecode/xdp_pass:latest -r, --registry-auth Optional: Registry auth for authenticating with the specified image registry. @@ -603,22 +603,22 @@ Options: Example usage: ```console -sudo bpfctl pull-bytecode --image-url quay.io/bpfd-bytecode/xdp_pass:latest +sudo bpfctl pull-bytecode --image-url quay.io/bpfman-bytecode/xdp_pass:latest Successfully downloaded bytecode ``` Then when loaded, the local image will be used: ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp_pass:latest --pull-policy IfNotPresent xdp --iface vethff657c7 --priority 100 - Bpfd State +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/xdp_pass:latest --pull-policy IfNotPresent xdp --iface vethff657c7 --priority 100 + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/406681 + Map Pin Path: /run/bpfman/fs/maps/406681 Map Owner ID: None Maps Used By: None Priority: 100 diff --git a/docs/getting-started/building-bpfd.md b/docs/getting-started/building-bpfman.md similarity index 69% rename from docs/getting-started/building-bpfd.md rename to docs/getting-started/building-bpfman.md index 4e0ec971d..56e2783b4 100644 --- a/docs/getting-started/building-bpfd.md +++ b/docs/getting-started/building-bpfman.md @@ -1,12 +1,12 @@ -# Setup and Building bpfd +# Setup and Building bpfman -This section describes how to build bpfd. -If this is the first time building bpfd, jump to the +This section describes how to build bpfman. +If this is the first time building bpfman, jump to the [Development Environment Setup](#development-environment-setup) section for help installing the tooling. There is also an option to run images from a given release as opposed to building locally. -Jump to the [Run bpfd From Release Image](./running-release.md) section for installing +Jump to the [Run bpfman From Release Image](./running-release.md) section for installing from a fixed release. ## Kernel Versions @@ -14,17 +14,17 @@ from a fixed release. eBPF is still a relatively new technology and being actively developed. To take advantage of this constantly evolving technology, it is best to use the newest kernel version possible. -If bpfd needs to be run on an older kernel, this section describes some of the kernel -features bpfd relies on to work and which kernel the feature was first introduced. +If bpfman needs to be run on an older kernel, this section describes some of the kernel +features bpfman relies on to work and which kernel the feature was first introduced. -Major kernel features leveraged by bpfd: +Major kernel features leveraged by bpfman: -* **Program Extensions:** Program Extensions allows bpfd to load multiple XDP or TC eBPF programs +* **Program Extensions:** Program Extensions allows bpfman to load multiple XDP or TC eBPF programs on an interface, which is not natively supported in the kernel. A `dispatcher` program is loaded as the one program on a given interface, and the user's XDP or TC programs are loaded as extensions to the `dispatcher` program. Introduced in Kernel 5.6. -* **Pinning:** Pinning allows the eBPF program to remain loaded when the loading process (bpfd) is +* **Pinning:** Pinning allows the eBPF program to remain loaded when the loading process (bpfman) is stopped or restarted. Introduced in Kernel 4.11. * **BPF Perf Link:** Support BPF perf link for tracing programs (Tracepoint, Uprobe and Kprobe) @@ -34,48 +34,48 @@ Major kernel features leveraged by bpfd: Tested kernel versions: * Fedora 34: Kernel 5.17.6-100.fc34.x86_64 - * XDP, TC, Tracepoint, Uprobe and Kprobe programs all loaded with bpfd running on localhost + * XDP, TC, Tracepoint, Uprobe and Kprobe programs all loaded with bpfman running on localhost and running as systemd service. * Fedora 33: Kernel 5.14.18-100.fc33.x86_64 - * XDP and TC programs loaded with bpfd running on localhost and running as systemd service + * XDP and TC programs loaded with bpfman running on localhost and running as systemd service once SELinux was disabled (see https://github.com/fedora-selinux/selinux-policy/pull/806). * Tracepoint, Uprobe and Kprobe programs failed to load because they require the `BPF Perf Link` support. * Fedora 32: Kernel 5.11.22-100.fc32.x86_64 - * XDP and TC programs loaded with bpfd running on localhost once SELinux was disabled + * XDP and TC programs loaded with bpfman running on localhost once SELinux was disabled (see https://github.com/fedora-selinux/selinux-policy/pull/806). - * bpfd fails to run as a systemd service because of some capabilities issues in the - bpfd.service file. + * bpfman fails to run as a systemd service because of some capabilities issues in the + bpfman.service file. * Tracepoint, Uprobe and Kprobe programs failed to load because they require the `BPF Perf Link` support. * Fedora 31: Kernel 5.8.18-100.fc31.x86_64 - * bpfd was able to start on localhost, but XDP and TC programs wouldn't load because + * bpfman was able to start on localhost, but XDP and TC programs wouldn't load because `BPF_LINK_CREATE` call was updated in newer kernels. - * bpfd fails to run as a systemd service because of some capabilities issues in the - bpfd.service file. + * bpfman fails to run as a systemd service because of some capabilities issues in the + bpfman.service file. -## Clone the bpfd Repo +## Clone the bpfman Repo -You can build and run bpfd from anywhere. However, if you plan to make changes -to the bpfd operator, it will need to be under your `GOPATH` because Kubernetes +You can build and run bpfman from anywhere. However, if you plan to make changes +to the bpfman operator, it will need to be under your `GOPATH` because Kubernetes Code-generator does not work outside of `GOPATH` [issue 86753](https://github.com/kubernetes/kubernetes/issues/86753). Assuming your `GOPATH` is set to the typical `$HOME/go`, your repo should live in -`$HOME/go/src/github.com/bpfd-dev/bpfd` +`$HOME/go/src/github.com/bpfman/bpfman` ``` -mkdir -p $HOME/go/src/github.com/bpfd-dev -cd $HOME/go/src/github.com/bpfd-dev -git clone git@github.com:bpfd-dev/bpfd.git +mkdir -p $HOME/go/src/github.com/bpfman +cd $HOME/go/src/github.com/bpfman +git clone git@github.com:bpfman/bpfman.git ``` -## Building bpfd +## Building bpfman -To just test with the latest bpfd, containerized image are stored in `quay.io/bpfd` -(see [bpfd Container Images](../developer-guide/image-build.md)). +To just test with the latest bpfman, containerized image are stored in `quay.io/bpfman` +(see [bpfman Container Images](../developer-guide/image-build.md)). To build with local changes, use the following commands. -If you are building bpfd for the first time OR the eBPF code has changed: +If you are building bpfman for the first time OR the eBPF code has changed: ```console cargo xtask build-ebpf --libbpf-dir /path/to/libbpf @@ -87,7 +87,7 @@ If protobuf files have changed: cargo xtask build-proto ``` -To build bpfd and bpfctl: +To build bpfman and bpfctl: ```console cargo build @@ -95,7 +95,7 @@ cargo build ## Development Environment Setup -To build bpfd, the following packages must be installed. +To build bpfman, the following packages must be installed. ### Install Rust Toolchain diff --git a/docs/getting-started/example-bpf-k8s.md b/docs/getting-started/example-bpf-k8s.md index d2cf95b33..e60d9719c 100644 --- a/docs/getting-started/example-bpf-k8s.md +++ b/docs/getting-started/example-bpf-k8s.md @@ -5,12 +5,12 @@ program. The approach is slightly different when running on a Kubernetes cluster. The eBPF bytecode should be loaded by an administrator, not the userspace program itself. -This section assumes there is already a Kubernetes cluster running and `bpfd` is running in the cluster. -See [Deploying the bpfd-operator](../developer-guide/operator-quick-start.md) for details on -deploying bpfd on a Kubernetes cluster, but the quickest solution is to run a Kubernetes KIND Cluster: +This section assumes there is already a Kubernetes cluster running and `bpfman` is running in the cluster. +See [Deploying the bpfman-operator](../developer-guide/operator-quick-start.md) for details on +deploying bpfman on a Kubernetes cluster, but the quickest solution is to run a Kubernetes KIND Cluster: ```console -cd bpfd/bpfd-operator/ +cd bpfman/bpfman-operator/ make run-on-kind ``` @@ -20,19 +20,19 @@ make run-on-kind Instead of using the userspace program or `bpfctl` to load the eBPF bytecode as done in previous sections, the bytecode will be loaded by creating a Kubernetes CRD object. -There is a CRD object for each eBPF program type bpfd supports. +There is a CRD object for each eBPF program type bpfman supports. Edit the sample yaml files to customize any configuration values: -* TcProgram CRD: [go-tc-counter/bytecode.yaml](https://github.com/bpfd-dev/bpfd/tree/main/examples/config/base/go-tc-counter/bytecode.yaml) -* TracepointProgram CRD: [go-tracepoint-counter/bytecode.yaml](https://github.com/bpfd-dev/bpfd/tree/main/examples/config/base/go-tracepoint-counter/bytecode.yaml) -* XdpProgram CRD: [go-xdp-counter/bytecode.yaml](https://github.com/bpfd-dev/bpfd/tree/main/examples/config/base/go-xdp-counter/bytecode.yaml) -* KprobeProgram CRD: [bpfd-operator/config/samples/bpfd.io_v1alpha1_kprobe_kprobeprogram.yaml](https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/samples/bpfd.io_v1alpha1_kprobe_kprobeprogram.yaml) -* UprobeProgram CRD: [bpfd-operator/config/samples/bpfd.io_v1alpha1_uprobe_uprobeprogram.yaml](https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/samples/bpfd.io_v1alpha1_uprobe_uprobeprogram.yaml) +* TcProgram CRD: [go-tc-counter/bytecode.yaml](https://github.com/bpfman/bpfman/tree/main/examples/config/base/go-tc-counter/bytecode.yaml) +* TracepointProgram CRD: [go-tracepoint-counter/bytecode.yaml](https://github.com/bpfman/bpfman/tree/main/examples/config/base/go-tracepoint-counter/bytecode.yaml) +* XdpProgram CRD: [go-xdp-counter/bytecode.yaml](https://github.com/bpfman/bpfman/tree/main/examples/config/base/go-xdp-counter/bytecode.yaml) +* KprobeProgram CRD: [bpfman-operator/config/samples/bpfman.io_v1alpha1_kprobe_kprobeprogram.yaml](https://github.com/bpfman/bpfman/blob/main/bpfman-operator/config/samples/bpfman.io_v1alpha1_kprobe_kprobeprogram.yaml) +* UprobeProgram CRD: [bpfman-operator/config/samples/bpfman.io_v1alpha1_uprobe_uprobeprogram.yaml](https://github.com/bpfman/bpfman/blob/main/bpfman-operator/config/samples/bpfman.io_v1alpha1_uprobe_uprobeprogram.yaml) Sample bytecode yaml with XdpProgram CRD: ```console cat examples/config/base/go-xdp-counter/bytecode.yaml -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -47,7 +47,7 @@ spec: priority: 55 bytecode: image: - url: quay.io/bpfd-bytecode/go-xdp-counter:latest + url: quay.io/bpfman-bytecode/go-xdp-counter:latest ``` Note that all the sample yaml files are configured with the bytecode running on all nodes @@ -59,13 +59,13 @@ and `go-tracepoint-counter-bytecode.yaml` and then apply the updated yamls: ```console kubectl apply -f examples/config/base/go-xdp-counter/bytecode.yaml - xdpprogram.bpfd.dev/go-xdp-counter-example created + xdpprogram.bpfman.io/go-xdp-counter-example created kubectl apply -f examples/config/base/go-tc-counter/bytecode.yaml - tcprogram.bpfd.dev/go-tc-counter-example created + tcprogram.bpfman.io/go-tc-counter-example created kubectl apply -f examples/config/base/go-tracepoint-counter/bytecode.yaml - tracepointprogram.bpfd.dev/go-tracepoint-counter-example created + tracepointprogram.bpfman.io/go-tracepoint-counter-example created ``` Following the diagram for XDP example (Blue numbers): @@ -75,16 +75,16 @@ associated with the eBPF bytecode, like interface, priority and BFP bytecode ima The name of the `XdpProgram` object in this example is `go-xdp-counter-example`. The `XdpProgram` is applied using `kubectl`, but in a more practical deployment, the `XdpProgram` would be applied by the application or a controller. -2. `bpfd-agent`, running on each node, is watching for all changes to `XdpProgram` objects. +2. `bpfman-agent`, running on each node, is watching for all changes to `XdpProgram` objects. When it sees a `XdpProgram` object created or modified, it makes sure a `BpfProgram` object for that node exists. The name of the `BpfProgram` object is the `XdpProgram` object name with the node name and interface or attach point appended. -3. `bpfd-agent` then determines if it should be running on the given node, loads or unloads as needed -by making gRPC calls the `bpfd`. -`bpfd` behaves the same as described in the running locally example. -4. `bpfd-agent` finally updates the status of the `BpfProgram` object. -5. `bpfd-operator` watches all `BpfProgram` objects, and updates the status of the `XdpProgram` +3. `bpfman-agent` then determines if it should be running on the given node, loads or unloads as needed +by making gRPC calls the `bpfman`. +`bpfman` behaves the same as described in the running locally example. +4. `bpfman-agent` finally updates the status of the `BpfProgram` object. +5. `bpfman-operator` watches all `BpfProgram` objects, and updates the status of the `XdpProgram` object indicating if the eBPF program has been applied to all the desired nodes or not. To retrieve information on the `XdpProgram` objects: @@ -96,15 +96,15 @@ go-xdp-counter-example 55 kubectl get xdpprograms go-xdp-counter-example -o yaml -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"bpfd.dev/v1alpha1","kind":"XdpProgram","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"xdpprogram"},"name":"go-xdp-counter-example"},"spec":{"bpffunctionname":"xdp_stats","bytecode":{"image":{"url":"quay.io/bpfd-bytecode/go-xdp-counter:latest"}},"interfaceselector":{"primarynodeinterface":true},"nodeselector":{},"priority":55}} + {"apiVersion":"bpfman.io/v1alpha1","kind":"XdpProgram","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"xdpprogram"},"name":"go-xdp-counter-example"},"spec":{"bpffunctionname":"xdp_stats","bytecode":{"image":{"url":"quay.io/bpfman-bytecode/go-xdp-counter:latest"}},"interfaceselector":{"primarynodeinterface":true},"nodeselector":{},"priority":55}} creationTimestamp: "2023-11-06T21:05:15Z" finalizers: - - bpfd.dev.operator/finalizer + - bpfman.io.operator/finalizer generation: 2 labels: app.kubernetes.io/name: xdpprogram @@ -116,7 +116,7 @@ spec: bytecode: image: imagepullpolicy: IfNotPresent - url: quay.io/bpfd-bytecode/go-xdp-counter:latest + url: quay.io/bpfman-bytecode/go-xdp-counter:latest interfaceselector: primarynodeinterface: true mapownerselector: {} @@ -140,33 +140,33 @@ To retrieve information on the `BpfProgram` objects: kubectl get bpfprograms NAME AGE : -4822-bpfd-deployment-control-plane 60m -4825-bpfd-deployment-control-plane 60m -go-tc-counter-example-bpfd-deployment-control-plane-eth0 61m -go-tracepoint-counter-example-bpfd-deployment-control-plane-syscalls-sys-enter-kill 61m -go-xdp-counter-example-bpfd-deployment-control-plane-eth0 61m -go-xdp-counter-sharing-map-example-bpfd-deployment-control-plane-eth0 60m -tc-dispatcher-4805-bpfd-deployment-control-plane 60m -xdp-dispatcher-4816-bpfd-deployment-control-plane 60m - - -kubectl get go-xdp-counter-example-bpfd-deployment-control-plane-eth0 -o yaml -apiVersion: bpfd.dev/v1alpha1 +4822-bpfman-deployment-control-plane 60m +4825-bpfman-deployment-control-plane 60m +go-tc-counter-example-bpfman-deployment-control-plane-eth0 61m +go-tracepoint-counter-example-bpfman-deployment-control-plane-syscalls-sys-enter-kill 61m +go-xdp-counter-example-bpfman-deployment-control-plane-eth0 61m +go-xdp-counter-sharing-map-example-bpfman-deployment-control-plane-eth0 60m +tc-dispatcher-4805-bpfman-deployment-control-plane 60m +xdp-dispatcher-4816-bpfman-deployment-control-plane 60m + + +kubectl get go-xdp-counter-example-bpfman-deployment-control-plane-eth0 -o yaml +apiVersion: bpfman.io/v1alpha1 kind: BpfProgram metadata: annotations: - bpfd.dev.xdpprogramcontroller/interface: eth0 - bpfd.dev/ProgramId: "4801" + bpfman.io.xdpprogramcontroller/interface: eth0 + bpfman.io/ProgramId: "4801" creationTimestamp: "2023-11-06T21:05:15Z" finalizers: - - bpfd.dev.xdpprogramcontroller/finalizer + - bpfman.io.xdpprogramcontroller/finalizer generation: 1 labels: - bpfd.dev/ownedByProgram: go-xdp-counter-example - kubernetes.io/hostname: bpfd-deployment-control-plane - name: go-xdp-counter-example-bpfd-deployment-control-plane-eth0 + bpfman.io/ownedByProgram: go-xdp-counter-example + kubernetes.io/hostname: bpfman-deployment-control-plane + name: go-xdp-counter-example-bpfman-deployment-control-plane-eth0 ownerReferences: - - apiVersion: bpfd.dev/v1alpha1 + - apiVersion: bpfman.io/v1alpha1 blockOwnerDeletion: true controller: true kind: XdpProgram @@ -180,7 +180,7 @@ status: conditions: - lastTransitionTime: "2023-11-06T21:05:21Z" message: Successfully loaded bpfProgram - reason: bpfdLoaded + reason: bpfmanLoaded status: "True" type: Loaded ``` @@ -189,17 +189,17 @@ status: Here, a userspace container is deployed to consume the map data generated by the eBPF counter program. -bpfd provides a [Container Storage Interface (CSI)](https://kubernetes-csi.github.io/docs/) +bpfman provides a [Container Storage Interface (CSI)](https://kubernetes-csi.github.io/docs/) driver for exposing eBPF maps into a userspace container. To avoid having to mount a host directory that contains the map pinned file into the container and forcing the container to have permissions to access that host directory, the CSI driver mounts the map at a specified location in the container. All the examples use CSI, here is -[go-xdp-counter/deployment.yaml](https://github.com/bpfd-dev/bpfd/tree/main/examples/config/base/go-xdp-counter/deployment.yaml) +[go-xdp-counter/deployment.yaml](https://github.com/bpfman/bpfman/tree/main/examples/config/base/go-xdp-counter/deployment.yaml) for reference: ```console -cd bpfd/examples/ +cd bpfman/examples/ cat config/base/go-xdp-counter/deployment.yaml : --- @@ -226,43 +226,43 @@ spec: volumes: - name: go-xdp-counter-maps <==== 1) Volume describing the map csi: - driver: csi.bpfd.dev <==== 1a) bpfd CSI Driver + driver: csi.bpfman.io <==== 1a) bpfman CSI Driver volumeAttributes: - csi.bpfd.dev/program: go-xdp-counter-example <==== 1b) eBPF Program owning the map - csi.bpfd.dev/maps: xdp_stats_map <==== 1c) Map to be exposed to the container + csi.bpfman.io/program: go-xdp-counter-example <==== 1b) eBPF Program owning the map + csi.bpfman.io/maps: xdp_stats_map <==== 1c) Map to be exposed to the container ``` #### Loading A Userspace Container Image The userspace programs have been pre-built and can be found here: -* `quay.io/bpfd-userspace/go-tc-counter:latest` -* `quay.io/bpfd-userspace/go-tracepoint-counter:latest` -* `quay.io/bpfd-userspace/go-xdp-counter:latest` +* `quay.io/bpfman-userspace/go-tc-counter:latest` +* `quay.io/bpfman-userspace/go-tracepoint-counter:latest` +* `quay.io/bpfman-userspace/go-xdp-counter:latest` The example yaml files below are loading from these image. -* [go-tc-counter/deployment.yaml](https://github.com/bpfd-dev/bpfd/tree/main/examples/config/base/go-tc-counter/deployment.yaml) -* [go-tracepoint-counter/deployment.yaml](https://github.com/bpfd-dev/bpfd/tree/main/examples/config/base/go-tracepoint-counter/deployment.yaml) -* [go-xdp-counter/deployment.yaml](https://github.com/bpfd-dev/bpfd/tree/main/examples/config/base/go-xdp-counter/deployment.yaml) +* [go-tc-counter/deployment.yaml](https://github.com/bpfman/bpfman/tree/main/examples/config/base/go-tc-counter/deployment.yaml) +* [go-tracepoint-counter/deployment.yaml](https://github.com/bpfman/bpfman/tree/main/examples/config/base/go-tracepoint-counter/deployment.yaml) +* [go-xdp-counter/deployment.yaml](https://github.com/bpfman/bpfman/tree/main/examples/config/base/go-xdp-counter/deployment.yaml) -The userspace program in a Kubernetes Deployment doesn't interacts directly with `bpfd` like it +The userspace program in a Kubernetes Deployment doesn't interacts directly with `bpfman` like it did in the local host deployment. Instead, the userspace program running on each node, if needed, reads the `BpfProgram` object from the KubeApiServer to gather additional information about the loaded eBPF program. To interact with the KubeApiServer, RBAC must be setup properly to access the `BpfProgram` object. -The `bpfd-operator` defined the yaml for several ClusterRoles that can be used to access the -different `bpfd` related CRD objects with different access rights. +The `bpfman-operator` defined the yaml for several ClusterRoles that can be used to access the +different `bpfman` related CRD objects with different access rights. The example userspace containers will use the `bpfprogram-viewer-role`, which allows Read-Only access to the `BpfProgram` object. -This ClusterRole is created automatically by the `bpfd-operator`. +This ClusterRole is created automatically by the `bpfman-operator`. The remaining objects (NameSpace, ServiceAccount, ClusterRoleBinding and examples DaemonSet) can be created for each program type as follows: ```console -cd bpfd/ +cd bpfman/ kubectl create -f examples/config/base/go-xdp-counter/deployment.yaml kubectl create -f examples/config/base/go-tc-counter/deployment.yaml kubectl create -f examples/config/base/go-tracepoint-counter/deployment.yaml @@ -278,8 +278,8 @@ To see if the userspace programs are working, view the logs: ```console NAMESPACE NAME READY STATUS RESTARTS AGE -bpfd bpfd-daemon-jsgdh 3/3 Running 0 11m -bpfd bpfd-operator-6c5c8887f7-qk28x 2/2 Running 0 12m +bpfman bpfman-daemon-jsgdh 3/3 Running 0 11m +bpfman bpfman-operator-6c5c8887f7-qk28x 2/2 Running 0 12m go-tc-counter go-tc-counter-ds-9jv4g 1/1 Running 0 5m37s go-tracepoint-counter go-tracepoint-counter-ds-2gzbt 1/1 Running 0 5m35s go-xdp-counter go-xdp-counter-ds-2hs6g 1/1 Running 0 6m12s @@ -317,74 +317,74 @@ Run `make deploy` to load each of the example bytecode and userspace yaml files, `make undeploy` to unload them. ```console -cd bpfd/examples/ +cd bpfman/examples/ make deploy - sed 's@URL_BC@quay.io/bpfd-bytecode/go-tc-counter:latest@' config/default/go-tc-counter/patch.yaml.env > config/default/go-tc-counter/patch.yaml - cd config/default/go-tc-counter && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-tc-counter=quay.io/bpfd-userspace/go-tc-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-tc-counter | kubectl apply -f - + sed 's@URL_BC@quay.io/bpfman-bytecode/go-tc-counter:latest@' config/default/go-tc-counter/patch.yaml.env > config/default/go-tc-counter/patch.yaml + cd config/default/go-tc-counter && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-tc-counter=quay.io/bpfman-userspace/go-tc-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-tc-counter | kubectl apply -f - namespace/go-tc-counter created - serviceaccount/bpfd-app-go-tc-counter created - clusterrolebinding.rbac.authorization.k8s.io/bpfd-app-rolebinding-go-tc-counter created + serviceaccount/bpfman-app-go-tc-counter created + clusterrolebinding.rbac.authorization.k8s.io/bpfman-app-rolebinding-go-tc-counter created clusterrolebinding.rbac.authorization.k8s.io/privileged-scc-tc created daemonset.apps/go-tc-counter-ds created - tcprogram.bpfd.dev/go-tc-counter-example created - sed 's@URL_BC@quay.io/bpfd-bytecode/go-tracepoint-counter:latest@' config/default/go-tracepoint-counter/patch.yaml.env > config/default/go-tracepoint-counter/patch.yaml - cd config/default/go-tracepoint-counter && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-tracepoint-counter=quay.io/bpfd-userspace/go-tracepoint-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-tracepoint-counter | kubectl apply -f - + tcprogram.bpfman.io/go-tc-counter-example created + sed 's@URL_BC@quay.io/bpfman-bytecode/go-tracepoint-counter:latest@' config/default/go-tracepoint-counter/patch.yaml.env > config/default/go-tracepoint-counter/patch.yaml + cd config/default/go-tracepoint-counter && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-tracepoint-counter=quay.io/bpfman-userspace/go-tracepoint-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-tracepoint-counter | kubectl apply -f - namespace/go-tracepoint-counter created - serviceaccount/bpfd-app-go-tracepoint-counter created - clusterrolebinding.rbac.authorization.k8s.io/bpfd-app-rolebinding-go-tracepoint-counter created + serviceaccount/bpfman-app-go-tracepoint-counter created + clusterrolebinding.rbac.authorization.k8s.io/bpfman-app-rolebinding-go-tracepoint-counter created clusterrolebinding.rbac.authorization.k8s.io/privileged-scc-tracepoint created daemonset.apps/go-tracepoint-counter-ds created - tracepointprogram.bpfd.dev/go-tracepoint-counter-example created - sed 's@URL_BC@quay.io/bpfd-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter/patch.yaml.env > config/default/go-xdp-counter/patch.yaml - cd config/default/go-xdp-counter && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-xdp-counter=quay.io/bpfd-userspace/go-xdp-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-xdp-counter | kubectl apply -f - + tracepointprogram.bpfman.io/go-tracepoint-counter-example created + sed 's@URL_BC@quay.io/bpfman-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter/patch.yaml.env > config/default/go-xdp-counter/patch.yaml + cd config/default/go-xdp-counter && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-xdp-counter=quay.io/bpfman-userspace/go-xdp-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-xdp-counter | kubectl apply -f - namespace/go-xdp-counter unchanged - serviceaccount/bpfd-app-go-xdp-counter unchanged - clusterrolebinding.rbac.authorization.k8s.io/bpfd-app-rolebinding-go-xdp-counter unchanged + serviceaccount/bpfman-app-go-xdp-counter unchanged + clusterrolebinding.rbac.authorization.k8s.io/bpfman-app-rolebinding-go-xdp-counter unchanged clusterrolebinding.rbac.authorization.k8s.io/privileged-scc-xdp unchanged daemonset.apps/go-xdp-counter-ds configured - xdpprogram.bpfd.dev/go-xdp-counter-example unchanged - sed 's@URL_BC@quay.io/bpfd-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter-sharing-map/patch.yaml.env > config/default/go-xdp-counter-sharing-map/patch.yaml - cd config/default/go-xdp-counter-sharing-map && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-xdp-counter=quay.io/bpfd-userspace/go-xdp-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-xdp-counter-sharing-map | kubectl apply -f - - xdpprogram.bpfd.dev/go-xdp-counter-sharing-map-example created + xdpprogram.bpfman.io/go-xdp-counter-example unchanged + sed 's@URL_BC@quay.io/bpfman-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter-sharing-map/patch.yaml.env > config/default/go-xdp-counter-sharing-map/patch.yaml + cd config/default/go-xdp-counter-sharing-map && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-xdp-counter=quay.io/bpfman-userspace/go-xdp-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-xdp-counter-sharing-map | kubectl apply -f - + xdpprogram.bpfman.io/go-xdp-counter-sharing-map-example created # Test Away ... make undeploy - sed 's@URL_BC@quay.io/bpfd-bytecode/go-tc-counter:latest@' config/default/go-tc-counter/patch.yaml.env > config/default/go-tc-counter/patch.yaml - cd config/default/go-tc-counter && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-tc-counter=quay.io/bpfd-userspace/go-tc-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-tc-counter | kubectl delete --ignore-not-found=false -f - + sed 's@URL_BC@quay.io/bpfman-bytecode/go-tc-counter:latest@' config/default/go-tc-counter/patch.yaml.env > config/default/go-tc-counter/patch.yaml + cd config/default/go-tc-counter && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-tc-counter=quay.io/bpfman-userspace/go-tc-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-tc-counter | kubectl delete --ignore-not-found=false -f - namespace "go-tc-counter" deleted - serviceaccount "bpfd-app-go-tc-counter" deleted - clusterrolebinding.rbac.authorization.k8s.io "bpfd-app-rolebinding-go-tc-counter" deleted + serviceaccount "bpfman-app-go-tc-counter" deleted + clusterrolebinding.rbac.authorization.k8s.io "bpfman-app-rolebinding-go-tc-counter" deleted clusterrolebinding.rbac.authorization.k8s.io "privileged-scc-tc" deleted daemonset.apps "go-tc-counter-ds" deleted - tcprogram.bpfd.dev "go-tc-counter-example" deleted - sed 's@URL_BC@quay.io/bpfd-bytecode/go-tracepoint-counter:latest@' config/default/go-tracepoint-counter/patch.yaml.env > config/default/go-tracepoint-counter/patch.yaml - cd config/default/go-tracepoint-counter && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-tracepoint-counter=quay.io/bpfd-userspace/go-tracepoint-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-tracepoint-counter | kubectl delete --ignore-not-found=false -f - + tcprogram.bpfman.io "go-tc-counter-example" deleted + sed 's@URL_BC@quay.io/bpfman-bytecode/go-tracepoint-counter:latest@' config/default/go-tracepoint-counter/patch.yaml.env > config/default/go-tracepoint-counter/patch.yaml + cd config/default/go-tracepoint-counter && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-tracepoint-counter=quay.io/bpfman-userspace/go-tracepoint-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-tracepoint-counter | kubectl delete --ignore-not-found=false -f - namespace "go-tracepoint-counter" deleted - serviceaccount "bpfd-app-go-tracepoint-counter" deleted - clusterrolebinding.rbac.authorization.k8s.io "bpfd-app-rolebinding-go-tracepoint-counter" deleted + serviceaccount "bpfman-app-go-tracepoint-counter" deleted + clusterrolebinding.rbac.authorization.k8s.io "bpfman-app-rolebinding-go-tracepoint-counter" deleted clusterrolebinding.rbac.authorization.k8s.io "privileged-scc-tracepoint" deleted daemonset.apps "go-tracepoint-counter-ds" deleted - tracepointprogram.bpfd.dev "go-tracepoint-counter-example" deleted - sed 's@URL_BC@quay.io/bpfd-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter/patch.yaml.env > config/default/go-xdp-counter/patch.yaml - cd config/default/go-xdp-counter && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-xdp-counter=quay.io/bpfd-userspace/go-xdp-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-xdp-counter | kubectl delete --ignore-not-found=false -f - + tracepointprogram.bpfman.io "go-tracepoint-counter-example" deleted + sed 's@URL_BC@quay.io/bpfman-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter/patch.yaml.env > config/default/go-xdp-counter/patch.yaml + cd config/default/go-xdp-counter && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-xdp-counter=quay.io/bpfman-userspace/go-xdp-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-xdp-counter | kubectl delete --ignore-not-found=false -f - namespace "go-xdp-counter" deleted - serviceaccount "bpfd-app-go-xdp-counter" deleted - clusterrolebinding.rbac.authorization.k8s.io "bpfd-app-rolebinding-go-xdp-counter" deleted + serviceaccount "bpfman-app-go-xdp-counter" deleted + clusterrolebinding.rbac.authorization.k8s.io "bpfman-app-rolebinding-go-xdp-counter" deleted clusterrolebinding.rbac.authorization.k8s.io "privileged-scc-xdp" deleted daemonset.apps "go-xdp-counter-ds" deleted - xdpprogram.bpfd.dev "go-xdp-counter-example" deleted - sed 's@URL_BC@quay.io/bpfd-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter-sharing-map/patch.yaml.env > config/default/go-xdp-counter-sharing-map/patch.yaml - cd config/default/go-xdp-counter-sharing-map && /home/bmcfall/src/bpfd/examples/bin/kustomize edit set image quay.io/bpfd-userspace/go-xdp-counter=quay.io/bpfd-userspace/go-xdp-counter:latest - /home/bmcfall/src/bpfd/examples/bin/kustomize build config/default/go-xdp-counter-sharing-map | kubectl delete --ignore-not-found=false -f - - xdpprogram.bpfd.dev "go-xdp-counter-sharing-map-example" deleted + xdpprogram.bpfman.io "go-xdp-counter-example" deleted + sed 's@URL_BC@quay.io/bpfman-bytecode/go-xdp-counter:latest@' config/default/go-xdp-counter-sharing-map/patch.yaml.env > config/default/go-xdp-counter-sharing-map/patch.yaml + cd config/default/go-xdp-counter-sharing-map && /home/bmcfall/src/bpfman/examples/bin/kustomize edit set image quay.io/bpfman-userspace/go-xdp-counter=quay.io/bpfman-userspace/go-xdp-counter:latest + /home/bmcfall/src/bpfman/examples/bin/kustomize build config/default/go-xdp-counter-sharing-map | kubectl delete --ignore-not-found=false -f - + xdpprogram.bpfman.io "go-xdp-counter-sharing-map-example" deleted ``` Individual examples can be loaded and unloaded as well, for example `make deploy-xdp` and @@ -426,7 +426,7 @@ Deployment Variables (not commands) IMAGE_TP_US Tracepoint Userspace image. Example: make deploy-tracepoint IMAGE_TP_US=quay.io/user1/go-tracepoint-counter-userspace:test IMAGE_XDP_BC XDP Bytecode image. Example: make deploy-xdp IMAGE_XDP_BC=quay.io/user1/go-xdp-counter-bytecode:test IMAGE_XDP_US XDP Userspace image. Example: make deploy-xdp IMAGE_XDP_US=quay.io/user1/go-xdp-counter-userspace:test - KIND_CLUSTER_NAME Name of the deployed cluster to load example images to, defaults to `bpfd-deployment` + KIND_CLUSTER_NAME Name of the deployed cluster to load example images to, defaults to `bpfman-deployment` ignore-not-found For any undeploy command, set to true to ignore resource not found errors during deletion. Example: make undeploy ignore-not-found=true Deployment @@ -445,10 +445,10 @@ Deployment #### Building A Userspace Container Image To build the userspace examples in a container instead of using the pre-built ones, -from the bpfd code source directory (`quay.io/bpfd-userspace/`), run the following build commands: +from the bpfman code source directory (`quay.io/bpfman-userspace/`), run the following build commands: ```console - cd bpfd/examples + cd bpfman/examples make IMAGE_TC_US=quay.io/$USER/go-tc-counter:latest \ IMAGE_TP_US=quay.io/$USER/go-tracepoint-counter:latest \ IMAGE_XDP_US=quay.io/$USER/go-xdp-counter:latest \ @@ -459,7 +459,7 @@ Then **EITHER** push images to a remote repository: ```console docker login quay.io -cd bpfd/examples +cd bpfman/examples make IMAGE_TC_US=quay.io/$USER/go-tc-counter:latest \ IMAGE_TP_US=quay.io/$USER/go-tracepoint-counter:latest \ IMAGE_XDP_US=quay.io/$USER/go-xdp-counter:latest \ @@ -469,18 +469,18 @@ make IMAGE_TC_US=quay.io/$USER/go-tc-counter:latest \ **OR** load the images directly to a specified kind cluster: ```console -cd bpfd/examples +cd bpfman/examples make IMAGE_TC_US=quay.io/$USER/go-tc-counter:latest \ IMAGE_TP_US=quay.io/$USER/go-tracepoint-counter:latest \ IMAGE_XDP_US=quay.io/$USER/go-xdp-counter:latest \ - KIND_CLUSTER_NAME=bpfd-deployment \ + KIND_CLUSTER_NAME=bpfman-deployment \ load-us-images-kind ``` Lastly, update the yaml to use the private images or override the yaml files using the Makefile: ```console -cd bpfd/examples/ +cd bpfman/examples/ make deploy-xdp IMAGE_XDP_US=quay.io/$USER/go-xdp-counter:latest make undeploy-xdp diff --git a/docs/getting-started/example-bpf-local.md b/docs/getting-started/example-bpf-local.md index 0a9192395..4e16e1b09 100644 --- a/docs/getting-started/example-bpf-local.md +++ b/docs/getting-started/example-bpf-local.md @@ -1,8 +1,8 @@ # Deploying Example eBPF Programs On Local Host -This section describes running bpfd and the example eBPF programs on a local host. -When running bpfd, it can be run as a process or run as a systemd service. -Examples run the same, independent of how bpfd is deployed. +This section describes running bpfman and the example eBPF programs on a local host. +When running bpfman, it can be run as a process or run as a systemd service. +Examples run the same, independent of how bpfman is deployed. ### Building @@ -10,8 +10,8 @@ To build directly on a system, make sure all the prerequisites are met, then bui #### Prerequisites -*This assumes bpfd is already installed and running on the system. -If not, see [Setup and Building bpfd](./building-bpfd.md).* +*This assumes bpfman is already installed and running on the system. +If not, see [Setup and Building bpfman](./building-bpfman.md).* 1. All [requirements defined by the `cilium/ebpf` package](https://github.com/cilium/ebpf#requirements) 2. libbpf development package to get the required eBPF c headers @@ -33,32 +33,32 @@ If not, see [Setup and Building bpfd](./building-bpfd.md).* To build all the C based eBPF counter bytecode, run: ```console -cd bpfd/examples/ +cd bpfman/examples/ make generate ``` To build all the Userspace GO Client examples, run: ```console -cd bpfd/examples/ +cd bpfman/examples/ make build ``` To build only a single example: ```console -cd bpfd/examples/go-tc-counter/ +cd bpfman/examples/go-tc-counter/ go generate go build ``` ```console -cd bpfd/examples/go-tracepoint-counter/ +cd bpfman/examples/go-tracepoint-counter/ go generate go build ``` ```console -cd bpfd/examples/go-xdp-counter/ +cd bpfman/examples/go-xdp-counter/ go generate go build ``` @@ -66,10 +66,10 @@ go build ### Running On Host The most basic way to deploy this example is running directly on a host system. -First, start or ensure `bpfd` is up and running. -[Tutorial](./tutorial.md) will guide you through deploying `bpfd`. -In all the examples of running on a host system, a bpfd-client certificate is used -that is generated by `bpfd` to encrypt the application's connection to `bpfd`. +First, start or ensure `bpfman` is up and running. +[Tutorial](./tutorial.md) will guide you through deploying `bpfman`. +In all the examples of running on a host system, a bpfman-client certificate is used +that is generated by `bpfman` to encrypt the application's connection to `bpfman`. The diagram below shows `go-xdp-counter` example, but the `go-tc-counter` and `go-tracepoint-counter` examples operate exactly the same way. @@ -78,11 +78,11 @@ The diagram below shows `go-xdp-counter` example, but the `go-tc-counter` and Following the diagram (Purple numbers): 1. When `go-xdp-counter` userspace is started, it will send a gRPC request -over unix socket to `bpfd` requesting `bpfd` to load the `go-xdp-counter` eBPF bytecode located on disk -at `bpfd/examples/go-xdp-counter/bpf_bpfel.o` at a priority of 50 and on interface `ens3`. +over unix socket to `bpfman` requesting `bpfman` to load the `go-xdp-counter` eBPF bytecode located on disk +at `bpfman/examples/go-xdp-counter/bpf_bpfel.o` at a priority of 50 and on interface `ens3`. These values are configurable as we will see later, but for now we will use the defaults (except interface, which is required to be entered). -2. `bpfd` will load it's `dispatcher` eBPF program, which links to the `go-xdp-counter` eBPF program +2. `bpfman` will load it's `dispatcher` eBPF program, which links to the `go-xdp-counter` eBPF program and return a UUID referencing the running program. 3. `bpfctl list` can be used to show that the eBPF program was loaded. 4. Once the `go-xdp-counter` eBPF bytecode is loaded, the eBPF program will write packet counts @@ -96,21 +96,21 @@ To run the `go-xdp-counter` program, determine the host interface to attach the program to and then start the go program with: ```console -cd bpfd/examples/go-xdp-counter/ +cd bpfman/examples/go-xdp-counter/ sudo ./go-xdp-counter -iface ``` or (**NOTE:** TC programs also require a direction, ingress or egress) ```console -cd bpfd/examples/go-tc-counter/ +cd bpfman/examples/go-tc-counter/ sudo ./go-tc-counter -direction ingress -iface ``` or ```console -cd bpfd/examples/go-tracepoint-counter/ +cd bpfman/examples/go-tracepoint-counter/ sudo ./go-tracepoint-counter ``` @@ -119,8 +119,8 @@ interface as shown below: ```console sudo ./go-xdp-counter --iface vethff657c7 -2023/07/17 17:43:58 Using Input: Interface=vethff657c7 Priority=50 Source=/home/<$USER>/src/bpfd/examples/go-xdp-counter/bpf_bpfel.o -2023/07/17 17:43:58 Unable to read /etc/bpfd/bpfd.toml, using default configuration values. +2023/07/17 17:43:58 Using Input: Interface=vethff657c7 Priority=50 Source=/home/<$USER>/src/bpfman/examples/go-xdp-counter/bpf_bpfel.o +2023/07/17 17:43:58 Unable to read /etc/bpfman/bpfman.toml, using default configuration values. 2023/07/17 17:43:58 Program registered with id 6211 2023/07/17 17:44:01 4 packets received 2023/07/17 17:44:01 580 bytes received @@ -156,20 +156,20 @@ Finally, press `+c` when finished with `go-xdp-counter`. ### Passing eBPF Bytecode In A Container Image -bpfd can load eBPF bytecode from a container image built following the spec described in +bpfman can load eBPF bytecode from a container image built following the spec described in [eBPF Bytecode Image Specifications](../developer-guide/shipping-bytecode.md). Pre-built eBPF container images for the examples can be loaded from: -* `quay.io/bpfd-bytecode/go-xdp-counter:latest` -* `quay.io/bpfd-bytecode/go-tc-counter:latest` -* `quay.io/bpfd-bytecode/go-tracepoint-counter:latest` +* `quay.io/bpfman-bytecode/go-xdp-counter:latest` +* `quay.io/bpfman-bytecode/go-tc-counter:latest` +* `quay.io/bpfman-bytecode/go-tracepoint-counter:latest` To use the container image, pass the URL to the userspace program: ```console -sudo ./go-xdp-counter -iface ens3 -image quay.io/bpfd-bytecode/go-xdp-counter:latest -2022/12/02 16:28:32 Unable to read /etc/bpfd/bpfd.toml, using default configuration values. -2022/12/02 16:28:32 Using Input: Interface=ens3 Priority=50 Source=quay.io/bpfd-bytecode/go-xdp-counter:latest +sudo ./go-xdp-counter -iface ens3 -image quay.io/bpfman-bytecode/go-xdp-counter:latest +2022/12/02 16:28:32 Unable to read /etc/bpfman/bpfman.toml, using default configuration values. +2022/12/02 16:28:32 Using Input: Interface=ens3 Priority=50 Source=quay.io/bpfman-bytecode/go-xdp-counter:latest 2022/12/02 16:28:34 Program registered with id 6223 2022/12/02 16:28:37 4 packets received 2022/12/02 16:28:37 580 bytes received @@ -190,7 +190,7 @@ bytecode has been built (i.e. `bpf_bpfel.o` has been built - see [Building](#bui run the build commands below: ```console -cd bpfd/examples/go-xdp-counter/ +cd bpfman/examples/go-xdp-counter/ go generate docker build \ @@ -205,7 +205,7 @@ docker build \ and ```console -cd bpfd/examples/go-tc-counter/ +cd bpfman/examples/go-tc-counter/ go generate docker build \ @@ -220,7 +220,7 @@ docker build \ and ```console -cd bpfd/examples/go-tracepoint-counter/ +cd bpfman/examples/go-tracepoint-counter/ go generate docker build \ @@ -232,8 +232,8 @@ docker build \ -f ../../packaging/container-deployment/Containerfile.bytecode . -t quay.io/$USER/go-tracepoint-counter-bytecode:latest ``` -`bpfd` currently does not provide a method for pre-loading bytecode images -(see [issue #603](https://github.com/bpfd-dev/bpfd/issues/603)), so push the bytecode image to a remote +`bpfman` currently does not provide a method for pre-loading bytecode images +(see [issue #603](https://github.com/bpfman/bpfman/issues/603)), so push the bytecode image to a remote repository. For example: @@ -247,7 +247,7 @@ Then run with the privately built bytecode container image: ```console sudo ./go-tc-counter -iface ens3 -direction ingress -location image://quay.io/$USER/go-tc-counter-bytecode:latest -2022/12/02 16:38:44 Unable to read /etc/bpfd/bpfd.toml, using default configuration values. +2022/12/02 16:38:44 Unable to read /etc/bpfman/bpfman.toml, using default configuration values. 2022/12/02 16:38:44 Using Input: Interface=ens3 Priority=50 Source=quay.io/$USER/go-tc-counter-bytecode:latest 2022/12/02 16:38:45 Program registered with id 6225 2022/12/02 16:38:48 4 packets received @@ -263,7 +263,7 @@ sudo ./go-tc-counter -iface ens3 -direction ingress -location image://quay.io/$U #### Preloading eBPF Bytecode Another way to load the eBPF bytecode is to pre-load the eBPF bytecode and -pass the associated `bpfd` program id to the userspace program. +pass the associated `bpfman` program id to the userspace program. This is similar to how eBPF programs will be loaded in Kubernetes, except `kubectl` commands will be used to create Kubernetes CRD objects instead of using `bpfctl`, but that is covered in the next section. The userspace programs will skip the loading portion and use the program id to find the shared @@ -275,15 +275,15 @@ Referring back to the diagram above, the `load` and `unload` are being done by ` First, use `bpfctl` to load the `go-xdp-counter` eBPF bytecode: ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/go-xdp-counter:latest xdp --iface ens3 --priority 50 - Bpfd State +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/go-xdp-counter:latest xdp --iface ens3 --priority 50 + Bpfman State --------------- Name: xdp_stats - Image URL: quay.io/bpfd-bytecode/go-xdp-counter:latest + Image URL: quay.io/bpfman-bytecode/go-xdp-counter:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6229 + Map Pin Path: /run/bpfman/fs/maps/6229 Map Owner ID: None Map Used By: 6229 Priority: 50 diff --git a/docs/getting-started/example-bpf.md b/docs/getting-started/example-bpf.md index 134cffed2..e1fcf57fe 100644 --- a/docs/getting-started/example-bpf.md +++ b/docs/getting-started/example-bpf.md @@ -1,26 +1,26 @@ # Example eBPF Programs -Example applications that use the `bpfd-go` bindings can be found in the -[examples/](https://github.com/bpfd-dev/bpfd/tree/main/examples/) directory. +Example applications that use the `bpfman-go` bindings can be found in the +[examples/](https://github.com/bpfman/bpfman/tree/main/examples/) directory. Current examples include: -* [examples/go-tc-counter/](https://github.com/bpfd-dev/bpfd/tree/main/examples/go-tc-counter) -* [examples/go-tracepoint-counter/](https://github.com/bpfd-dev/bpfd/tree/main/examples/go-tracepoint-counter) -* [examples/go-xdp-counter/](https://github.com/bpfd-dev/bpfd/tree/main/examples/go-xdp-counter) +* [examples/go-tc-counter/](https://github.com/bpfman/bpfman/tree/main/examples/go-tc-counter) +* [examples/go-tracepoint-counter/](https://github.com/bpfman/bpfman/tree/main/examples/go-tracepoint-counter) +* [examples/go-xdp-counter/](https://github.com/bpfman/bpfman/tree/main/examples/go-xdp-counter) These examples and the associated documentation is intended to provide the basics on how to deploy -and manage an eBPF program using bpfd. Each of the examples contain an eBPF Program written in C -([tc_counter.c](https://github.com/bpfd-dev/bpfd/tree/main/examples/go-tc-counter/bpf/tc_counter.c), -[tracepoint_counter.c](https://github.com/bpfd-dev/bpfd/tree/main/examples/go-tracepoint-counter/bpf/tracepoint_counter.c) and -[xdp_counter.c](https://github.com/bpfd-dev/bpfd/tree/main/examples/go-xdp-counter/bpf/xdp_counter.c)) +and manage an eBPF program using bpfman. Each of the examples contain an eBPF Program written in C +([tc_counter.c](https://github.com/bpfman/bpfman/tree/main/examples/go-tc-counter/bpf/tc_counter.c), +[tracepoint_counter.c](https://github.com/bpfman/bpfman/tree/main/examples/go-tracepoint-counter/bpf/tracepoint_counter.c) and +[xdp_counter.c](https://github.com/bpfman/bpfman/tree/main/examples/go-xdp-counter/bpf/xdp_counter.c)) that is compiled into eBPF bytecode. Each time the eBPF program is called, it increments the packet and byte counts in a map that is accessible by the userspace portion. Each of the examples also have a userspace portion written in GO. -When run locally, the userspace program makes gRPC calls to `bpfd` requesting `bpfd` to load the eBPF program +When run locally, the userspace program makes gRPC calls to `bpfman` requesting `bpfman` to load the eBPF program at the requested hook point (XDP hook point, TC hook point or Tracepoint). -When run in a Kubernetes deployment, the `bpfd-agent` makes gRPC calls to `bpfd` requesting `bpfd` to load +When run in a Kubernetes deployment, the `bpfman-agent` makes gRPC calls to `bpfman` requesting `bpfman` to load the eBPF program based on a Custom Resource Definition (CRD), which is described in more detail in that section. Independent of the deployment, the userspace program then polls the eBPF map every 3 seconds and logs the current counts. @@ -40,5 +40,5 @@ There are two ways to deploy these example applications: Notes regarding this document: - Source of images used in the example documentation can be found in - [bpfd Upstream Images](https://docs.google.com/presentation/d/1wU4xu6xeyk9cB3G-Nn-dzkf90j1-EI4PB167G7v-Xl4/edit?usp=sharing). + [bpfman Upstream Images](https://docs.google.com/presentation/d/1wU4xu6xeyk9cB3G-Nn-dzkf90j1-EI4PB167G7v-Xl4/edit?usp=sharing). Request access if required. diff --git a/docs/getting-started/running-release.md b/docs/getting-started/running-release.md index ae9916ff8..40bf86141 100644 --- a/docs/getting-started/running-release.md +++ b/docs/getting-started/running-release.md @@ -1,58 +1,58 @@ -# Run bpfd From Release Image +# Run bpfman From Release Image -This section describes how to deploy `bpfd` from a given release. -See [Releases](https://github.com/bpfd-dev/bpfd/releases) for the set of bpfd +This section describes how to deploy `bpfman` from a given release. +See [Releases](https://github.com/bpfman/bpfman/releases) for the set of bpfman releases. -Jump to the [Setup and Building bpfd](./building-bpfd.md) section +Jump to the [Setup and Building bpfman](./building-bpfman.md) section for help building from the latest code or building from a release branch. [Tutorial](./tutorial.md) contains more details on the different -modes to run `bpfd` in on the host and how to test. +modes to run `bpfman` in on the host and how to test. Use [Local Host](#local-host) or [Systemd Service](#systemd-service) -below for deploying released version of `bpfd` and then use [Tutorial](./tutorial.md) -for further information on how to test and interact with `bpfd`. +below for deploying released version of `bpfman` and then use [Tutorial](./tutorial.md) +for further information on how to test and interact with `bpfman`. -[Deploying the bpfd-operator](../developer-guide/operator-quick-start.md) contains -more details on deploying `bpfd` in a Kubernetes deployment and +[Deploying the bpfman-operator](../developer-guide/operator-quick-start.md) contains +more details on deploying `bpfman` in a Kubernetes deployment and [Deploying Example eBPF Programs On Kubernetes](./example-bpf-k8s.md) contains -more details on interacting with `bpfd` running in a Kubernetes deployment. -Use [Deploying Release Version of the bpfd-operator](#deploying-release-version-of-the-bpfd-operator) -below for deploying released version of `bpfd` in Kubernetes and then use the -links above for further information on how to test and interact with `bpfd`. +more details on interacting with `bpfman` running in a Kubernetes deployment. +Use [Deploying Release Version of the bpfman-operator](#deploying-release-version-of-the-bpfman-operator) +below for deploying released version of `bpfman` in Kubernetes and then use the +links above for further information on how to test and interact with `bpfman`. ## Local Host -To run `bpfd` in the foreground using `sudo`, download the release binary tar +To run `bpfman` in the foreground using `sudo`, download the release binary tar files and unpack them. ```console -export BPFD_REL=0.3.1 -mkdir -p $HOME/src/bpfd-${BPFD_REL}/; cd $HOME/src/bpfd-${BPFD_REL}/ -wget https://github.com/bpfd-dev/bpfd/releases/download/v${BPFD_REL}/bpfctl-linux-x86_64.tar.gz -wget https://github.com/bpfd-dev/bpfd/releases/download/v${BPFD_REL}/bpfd-linux-x86_64.tar.gz +export BPFMAN_REL=0.3.1 +mkdir -p $HOME/src/bpfman-${BPFMAN_REL}/; cd $HOME/src/bpfman-${BPFMAN_REL}/ +wget https://github.com/bpfman/bpfman/releases/download/v${BPFMAN_REL}/bpfctl-linux-x86_64.tar.gz +wget https://github.com/bpfman/bpfman/releases/download/v${BPFMAN_REL}/bpfman-linux-x86_64.tar.gz tar -xzvf bpfctl-linux-x86_64.tar.gz; rm bpfctl-linux-x86_64.tar.gz -tar -xzvf bpfd-linux-x86_64.tar.gz; rm bpfd-linux-x86_64.tar.gz +tar -xzvf bpfman-linux-x86_64.tar.gz; rm bpfman-linux-x86_64.tar.gz $ tree . ├── bpfctl-linux-x86_64.tar.gz -├── bpfd-linux-x86_64.tar.gz +├── bpfman-linux-x86_64.tar.gz └── target └── x86_64-unknown-linux-musl └── release ├── bpfctl - └── bpfd + └── bpfman ``` -To deploy `bpfd`: +To deploy `bpfman`: ```console -sudo RUST_LOG=info ./target/x86_64-unknown-linux-musl/release/bpfd -[2023-10-13T15:53:25Z INFO bpfd] Log using env_logger -[2023-10-13T15:53:25Z INFO bpfd] Has CAP_BPF: true -[2023-10-13T15:53:25Z INFO bpfd] Has CAP_SYS_ADMIN: true +sudo RUST_LOG=info ./target/x86_64-unknown-linux-musl/release/bpfman +[2023-10-13T15:53:25Z INFO bpfman] Log using env_logger +[2023-10-13T15:53:25Z INFO bpfman] Has CAP_BPF: true +[2023-10-13T15:53:25Z INFO bpfman] Has CAP_SYS_ADMIN: true : ``` @@ -67,30 +67,30 @@ Continue in [Tutorial](./tutorial.md) if desired. ## Systemd Service -To run `bpfd` as a systemd service, the binaries will be placed in a well known location +To run `bpfman` as a systemd service, the binaries will be placed in a well known location (`/usr/sbin/.`) and a service configuration file will be added -(`/usr/lib/systemd/system/bpfd.service`). +(`/usr/lib/systemd/system/bpfman.service`). There is a script that is used to install the service properly, so the source code needs to be downloaded to retrieve the script. Download and unpack the source code, then download and unpack the binaries. ```console -export BPFD_REL=0.3.1 +export BPFMAN_REL=0.3.1 mkdir -p $HOME/src/; cd $HOME/src/ -wget https://github.com/bpfd-dev/bpfd/archive/refs/tags/v${BPFD_REL}.tar.gz -tar -xzvf v${BPFD_REL}.tar.gz; rm v${BPFD_REL}.tar.gz -cd bpfd-${BPFD_REL} +wget https://github.com/bpfman/bpfman/archive/refs/tags/v${BPFMAN_REL}.tar.gz +tar -xzvf v${BPFMAN_REL}.tar.gz; rm v${BPFMAN_REL}.tar.gz +cd bpfman-${BPFMAN_REL} -wget https://github.com/bpfd-dev/bpfd/releases/download/v${BPFD_REL}/bpfctl-linux-x86_64.tar.gz -wget https://github.com/bpfd-dev/bpfd/releases/download/v${BPFD_REL}/bpfd-linux-x86_64.tar.gz +wget https://github.com/bpfman/bpfman/releases/download/v${BPFMAN_REL}/bpfctl-linux-x86_64.tar.gz +wget https://github.com/bpfman/bpfman/releases/download/v${BPFMAN_REL}/bpfman-linux-x86_64.tar.gz tar -xzvf bpfctl-linux-x86_64.tar.gz; rm bpfctl-linux-x86_64.tar.gz -tar -xzvf bpfd-linux-x86_64.tar.gz; rm bpfd-linux-x86_64.tar.gz +tar -xzvf bpfman-linux-x86_64.tar.gz; rm bpfman-linux-x86_64.tar.gz ``` -Run the following command to copy the `bpfd` and `bpfctl` binaries to `/usr/sbin/` and copy a -default `bpfd.service` file to `/usr/lib/systemd/system/`. -This option will also start the systemd service `bpfd.service` by default. +Run the following command to copy the `bpfman` and `bpfctl` binaries to `/usr/sbin/` and copy a +default `bpfman.service` file to `/usr/lib/systemd/system/`. +This option will also start the systemd service `bpfman.service` by default. ```console sudo ./scripts/setup.sh install @@ -101,36 +101,36 @@ binaries from the release directory, so the binaries will need to be manually co Continue in [Tutorial](./tutorial.md) if desired. -## Deploying Release Version of the bpfd-operator +## Deploying Release Version of the bpfman-operator -The quickest solution for running `bpfd` in a Kubernetes deployment is to run a +The quickest solution for running `bpfman` in a Kubernetes deployment is to run a Kubernetes KIND Cluster: ```console -kind create cluster --name=test-bpfd +kind create cluster --name=test-bpfman ``` -Next, deploy the bpfd CRDs: +Next, deploy the bpfman CRDs: ```console -export BPFD_REL=0.3.1 -kubectl apply -f https://github.com/bpfd-dev/bpfd/releases/download/v${BPFD_REL}/bpfd-crds-install-v${BPFD_REL}.yaml +export BPFMAN_REL=0.3.1 +kubectl apply -f https://github.com/bpfman/bpfman/releases/download/v${BPFMAN_REL}/bpfman-crds-install-v${BPFMAN_REL}.yaml ``` -Next, deploy the `bpfd-operator`, which will also deploy the `bpfd-daemon`, which contains `bpfd` and `bpfd-agent`: +Next, deploy the `bpfman-operator`, which will also deploy the `bpfman-daemon`, which contains `bpfman` and `bpfman-agent`: ```console -kubectl apply -f https://github.com/bpfd-dev/bpfd/releases/download/v${BPFD_REL}/bpfd-operator-install-v${BPFD_REL}.yaml +kubectl apply -f https://github.com/bpfman/bpfman/releases/download/v${BPFMAN_REL}/bpfman-operator-install-v${BPFMAN_REL}.yaml ``` Finally, deploy an example eBPF program. ```console -kubectl apply -f https://github.com/bpfd-dev/bpfd/releases/download/v${BPFD_REL}/go-xdp-counter-install-v${BPFD_REL}.yaml +kubectl apply -f https://github.com/bpfman/bpfman/releases/download/v${BPFMAN_REL}/go-xdp-counter-install-v${BPFMAN_REL}.yaml ``` -There are other example programs in the [Releases](https://github.com/bpfd-dev/bpfd/releases) +There are other example programs in the [Releases](https://github.com/bpfman/bpfman/releases) page. -Continue in [Deploying the bpfd-operator](../developer-guide/operator-quick-start.md) or +Continue in [Deploying the bpfman-operator](../developer-guide/operator-quick-start.md) or [Deploying Example eBPF Programs On Kubernetes](./example-bpf-k8s.md) if desired. diff --git a/docs/getting-started/tutorial.md b/docs/getting-started/tutorial.md index 072beb4cd..94293c234 100644 --- a/docs/getting-started/tutorial.md +++ b/docs/getting-started/tutorial.md @@ -1,40 +1,40 @@ # Tutorial -This tutorial will show you how to use `bpfd`. -There are several ways to launch and interact with `bpfd` and `bpfctl`: +This tutorial will show you how to use `bpfman`. +There are several ways to launch and interact with `bpfman` and `bpfctl`: -* **Local Host** - Run `bpfd` as a privileged process straight from build directory. +* **Local Host** - Run `bpfman` as a privileged process straight from build directory. See [Local Host](#local-host). -* **Systemd Service** - Run `bpfd` as a systemd service. +* **Systemd Service** - Run `bpfman` as a systemd service. See [Systemd Service](#systemd-service). ## Local Host -### Step 1: Build `bpfd` +### Step 1: Build `bpfman` -Perform the following steps to build `bpfd`. -If this is your first time using bpfd, follow the instructions in -[Setup and Building bpfd](./building-bpfd.md) to setup the prerequisites for building. +Perform the following steps to build `bpfman`. +If this is your first time using bpfman, follow the instructions in +[Setup and Building bpfman](./building-bpfman.md) to setup the prerequisites for building. ```console -cd $HOME/src/bpfd/ +cd $HOME/src/bpfman/ cargo xtask build-ebpf --libbpf-dir $HOME/src/libbpf cargo build ``` -### Step 2: Setup `bpfd` environment +### Step 2: Setup `bpfman` environment -`bpfd` supports both communication over a Unix socket. +`bpfman` supports both communication over a Unix socket. All examples, both using `bpfctl` and the gRPC API use this socket. -### Step 3: Start `bpfd` +### Step 3: Start `bpfman` -While learning and experimenting with `bpfd`, it may be useful to run `bpfd` in the foreground +While learning and experimenting with `bpfman`, it may be useful to run `bpfman` in the foreground (which requires a second terminal to run the `bpfctl` commands below). -For more details on how logging is handled in bpfd, see [Logging](../developer-guide/logging.md). +For more details on how logging is handled in bpfman, see [Logging](../developer-guide/logging.md). ```console -sudo RUST_LOG=info ./target/debug/bpfd +sudo RUST_LOG=info ./target/debug/bpfman ``` ### Step 4: Load your first program @@ -46,15 +46,15 @@ Finally, we will use the priority of 100. Find a deeper dive into `bpfctl` syntax in [bpfctl Guide](./bpfctl-guide.md). ```console -sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 100 - Bpfd State +sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfman-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 100 + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6213 + Map Pin Path: /run/bpfman/fs/maps/6213 Map Owner ID: None Map Used By: 6213 Priority: 100 @@ -94,14 +94,14 @@ We can recheck the details about the loaded program with the `bpfctl get` comman ```console sudo ./target/debug/bpfctl get 6213 - Bpfd State + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6213 + Map Pin Path: /run/bpfman/fs/maps/6213 Map Owner ID: None Map Used By: 6213 Priority: 100 @@ -131,18 +131,18 @@ interface and thus will be executed first. ### Step 5: Loading more programs -We will now load 2 more programs with different priorities to demonstrate how bpfd will ensure they are ordered correctly: +We will now load 2 more programs with different priorities to demonstrate how bpfman will ensure they are ordered correctly: ```console -sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 50 - Bpfd State +sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfman-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 50 + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6215 + Map Pin Path: /run/bpfman/fs/maps/6215 Map Owner ID: None Map Used By: 6215 Priority: 50 @@ -159,15 +159,15 @@ sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp ``` ```console -sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 200 - Bpfd State +sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfman-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 200 + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6217 + Map Pin Path: /run/bpfman/fs/maps/6217 Map Owner ID: None Map Used By: 6217 Priority: 200 @@ -202,7 +202,7 @@ As can be seen from the detailed output for each command below: ```console sudo ./target/debug/bpfctl get 6213 - Bpfd State + Bpfman State --------------- Name: pass : @@ -221,7 +221,7 @@ sudo ./target/debug/bpfctl get 6213 ```console sudo ./target/debug/bpfctl get 6215 - Bpfd State + Bpfman State --------------- Name: pass : @@ -240,7 +240,7 @@ sudo ./target/debug/bpfctl get 6215 ```console sudo ./target/debug/bpfctl get 6217 - Bpfd State + Bpfman State --------------- Name: pass : @@ -264,15 +264,15 @@ then the program can be loaded with those additional return values using the `pr parameter (see `bpfctl load-from-image xdp --help` for list of valid values): ```console -sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 150 --proceed-on "pass" --proceed-on "dispatcher_return" - Bpfd State +sudo ./target/debug/bpfctl load-from-image --image-url quay.io/bpfman-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 150 --proceed-on "pass" --proceed-on "dispatcher_return" + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6219 + Map Pin Path: /run/bpfman/fs/maps/6219 Map Owner ID: None Map Used By: 6219 Priority: 150 @@ -320,14 +320,14 @@ sudo ./target/debug/bpfctl list ```console ./target/debug/bpfctl get 6215 - Bpfd State + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6215 + Map Pin Path: /run/bpfman/fs/maps/6215 Map Owner ID: None Map Used By: 6215 Priority: 50 @@ -345,14 +345,14 @@ sudo ./target/debug/bpfctl list ``` ./target/debug/bpfctl get 6217 - Bpfd State + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6217 + Map Pin Path: /run/bpfman/fs/maps/6217 Map Owner ID: None Map Used By: 6217 Priority: 200 @@ -370,14 +370,14 @@ sudo ./target/debug/bpfctl list ``` ./target/debug/bpfctl get 6219 - Bpfd State + Bpfman State --------------- Name: pass - Image URL: quay.io/bpfd-bytecode/xdp_pass:latest + Image URL: quay.io/bpfman-bytecode/xdp_pass:latest Pull Policy: IfNotPresent Global: None Metadata: None - Map Pin Path: /run/bpfd/fs/maps/6219 + Map Pin Path: /run/bpfman/fs/maps/6219 Map Owner ID: None Map Used By: 6219 Priority: 150 @@ -393,43 +393,43 @@ sudo ./target/debug/bpfctl list : ``` -When `bpfd` is stopped, all remaining programs will be unloaded automatically. +When `bpfman` is stopped, all remaining programs will be unloaded automatically. ### Step 7: Clean-up -To unwind all the changes, stop `bpfd` and then run the following script: +To unwind all the changes, stop `bpfman` and then run the following script: ```console sudo ./scripts/setup.sh uninstall ``` -**WARNING:** `setup.sh uninstall` cleans everything up, so `/etc/bpfd/programs.d/` -and `/run/bpfd/bytecode/` are deleted. Save any changes or files that were created if needed. +**WARNING:** `setup.sh uninstall` cleans everything up, so `/etc/bpfman/programs.d/` +and `/run/bpfman/bytecode/` are deleted. Save any changes or files that were created if needed. ## Systemd Service -To run `bpfd` as a systemd service, the binaries will be placed in a well known location +To run `bpfman` as a systemd service, the binaries will be placed in a well known location (`/usr/sbin/.`) and a service configuration file will be added -(`/usr/lib/systemd/system/bpfd.service`). +(`/usr/lib/systemd/system/bpfman.service`). When run as a systemd service, the set of linux capabilities are limited to only the needed set. If permission errors are encountered, see [Linux Capabilities](../developer-guide/linux-capabilities.md) for help debugging. ### Step 1 -Same as Step 1 above, build `bpfd` if needed: +Same as Step 1 above, build `bpfman` if needed: ```console -cd $HOME/src/bpfd/ +cd $HOME/src/bpfman/ cargo xtask build-ebpf --libbpf-dir $HOME/src/libbpf cargo build ``` -### Step 2: Setup `bpfd` environment +### Step 2: Setup `bpfman` environment -Run the following command to copy the `bpfd` and `bpfctl` binaries to `/usr/sbin/` and copy a -default `bpfd.service` file to `/usr/lib/systemd/system/`. -This option will also start the systemd service `bpfd.service` by default: +Run the following command to copy the `bpfman` and `bpfctl` binaries to `/usr/sbin/` and copy a +default `bpfman.service` file to `/usr/lib/systemd/system/`. +This option will also start the systemd service `bpfman.service` by default: ```console sudo ./scripts/setup.sh install @@ -440,31 +440,31 @@ between the BFP program and the userspace program. So userspace programs that are accessing maps and running on kernels older than 5.19 will require either `sudo` or the CAP_BPF capability (`sudo /sbin/setcap cap_bpf=ep ./`). -To update the configuration settings associated with running `bpfd` as a service, edit the +To update the configuration settings associated with running `bpfman` as a service, edit the service configuration file: ```console -sudo vi /usr/lib/systemd/system/bpfd.service +sudo vi /usr/lib/systemd/system/bpfman.service sudo systemctl daemon-reload ``` -If `bpfd` or `bpfctl` is rebuilt, the following command can be run to install the update binaries +If `bpfman` or `bpfctl` is rebuilt, the following command can be run to install the update binaries without regenerating the certifications. -The `bpfd` service will is automatically restarted. +The `bpfman` service will is automatically restarted. ```console sudo ./scripts/setup.sh reinstall ``` -### Step 3: Start `bpfd` +### Step 3: Start `bpfman` -To manage `bpfd` as a systemd service, use `systemctl`. `sudo ./scripts/setup.sh install` will start the service, +To manage `bpfman` as a systemd service, use `systemctl`. `sudo ./scripts/setup.sh install` will start the service, but the service can be manually stopped and started: ```console -sudo systemctl stop bpfd.service +sudo systemctl stop bpfman.service ... -sudo systemctl start bpfd.service +sudo systemctl start bpfman.service ``` ### Step 4-6 @@ -472,7 +472,7 @@ sudo systemctl start bpfd.service Same as above except `bpfctl` is now in $PATH: ```console -sudo bpfctl load-from-image --image-url quay.io/bpfd-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 100 +sudo bpfctl load-from-image --image-url quay.io/bpfman-bytecode/xdp_pass:latest xdp --iface vethff657c7 --priority 100 : @@ -486,16 +486,16 @@ sudo bpfctl unload 6213 ### Step 7: Clean-up -To unwind all the changes performed while running `bpfd` as a systemd service, run the following -script. This command cleans up everything, including stopping the `bpfd` service if it is still +To unwind all the changes performed while running `bpfman` as a systemd service, run the following +script. This command cleans up everything, including stopping the `bpfman` service if it is still running. ```console sudo ./scripts/setup.sh uninstall ``` -**WARNING:** `setup.sh uninstall` cleans everything up, so `/etc/bpfd/programs.d/` -and `/run/bpfd/bytecode/` are deleted. Save any changes or files that were created if needed. +**WARNING:** `setup.sh uninstall` cleans everything up, so `/etc/bpfman/programs.d/` +and `/run/bpfman/bytecode/` are deleted. Save any changes or files that were created if needed. ## Build and Run Local eBPF Programs @@ -503,7 +503,7 @@ and `/run/bpfd/bytecode/` are deleted. Save any changes or files that were creat In the examples above, all the eBPF programs were pulled from pre-built images. This tutorial uses examples from the [xdp-tutorial](https://github.com/xdp-project/xdp-tutorial). The pre-built container images can be found here: -[https://quay.io/organization/bpfd-bytecode](https://quay.io/organization/bpfd-bytecode) +[https://quay.io/organization/bpfman-bytecode](https://quay.io/organization/bpfman-bytecode) To build these examples locally, check out the [xdp-tutorial](https://github.com/xdp-project/xdp-tutorial) git repository and diff --git a/docs/img/bpfd-on-k8s.png b/docs/img/bpfman-on-k8s.png similarity index 100% rename from docs/img/bpfd-on-k8s.png rename to docs/img/bpfman-on-k8s.png diff --git a/docs/img/bpfd.png b/docs/img/bpfman.png similarity index 100% rename from docs/img/bpfd.png rename to docs/img/bpfman.png diff --git a/docs/img/bpfd.svg b/docs/img/bpfman.svg similarity index 99% rename from docs/img/bpfd.svg rename to docs/img/bpfman.svg index 22c3ef9ef..75d454c62 100644 --- a/docs/img/bpfd.svg +++ b/docs/img/bpfman.svg @@ -7,7 +7,7 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - sodipodi:docname="bpfd.svg" + sodipodi:docname="bpfman.svg" inkscape:version="1.0 (4035a4f, 2020-05-01)" id="svg5" version="1.1" @@ -244,7 +244,7 @@ + aria-label="bpfman"> config/default/go-tc-counter/patch.yaml - cd config/default/go-tc-counter && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-tc-counter=${IMAGE_TC_US} + cd config/default/go-tc-counter && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-tc-counter=${IMAGE_TC_US} else $(eval KUST_DIR=$(TAG)) endif @@ -164,7 +164,7 @@ endif undeploy-tc: ## Undeploy go-tc-counter from the cluster specified in ~/.kube/config. ifndef TAG sed 's@URL_BC@$(IMAGE_TC_BC)@' config/default/go-tc-counter/patch.yaml.env > config/default/go-tc-counter/patch.yaml - cd config/default/go-tc-counter && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-tc-counter=${IMAGE_TC_US} + cd config/default/go-tc-counter && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-tc-counter=${IMAGE_TC_US} else $(eval KUST_DIR=$(TAG)) endif @@ -175,7 +175,7 @@ endif deploy-tracepoint: kustomize ## Deploy go-tracepoint-counter to the cluster specified in ~/.kube/config. ifndef TAG sed 's@URL_BC@$(IMAGE_TP_BC)@' config/default/go-tracepoint-counter/patch.yaml.env > config/default/go-tracepoint-counter/patch.yaml - cd config/default/go-tracepoint-counter && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-tracepoint-counter=${IMAGE_TP_US} + cd config/default/go-tracepoint-counter && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-tracepoint-counter=${IMAGE_TP_US} else $(eval KUST_DIR=$(TAG)) endif @@ -185,7 +185,7 @@ endif undeploy-tracepoint: ## Undeploy go-tracepoint-counter from the cluster specified in ~/.kube/config. ifndef TAG sed 's@URL_BC@$(IMAGE_TP_BC)@' config/default/go-tracepoint-counter/patch.yaml.env > config/default/go-tracepoint-counter/patch.yaml - cd config/default/go-tracepoint-counter && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-tracepoint-counter=${IMAGE_TP_US} + cd config/default/go-tracepoint-counter && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-tracepoint-counter=${IMAGE_TP_US} else $(eval KUST_DIR=$(TAG)) endif @@ -196,7 +196,7 @@ endif deploy-xdp: kustomize ## Deploy go-xdp-counter to the cluster specified in ~/.kube/config. ifndef TAG sed 's@URL_BC@$(IMAGE_XDP_BC)@' config/default/go-xdp-counter/patch.yaml.env > config/default/go-xdp-counter/patch.yaml - cd config/default/go-xdp-counter && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-xdp-counter=${IMAGE_XDP_US} + cd config/default/go-xdp-counter && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-xdp-counter=${IMAGE_XDP_US} else $(eval KUST_DIR=$(TAG)) endif @@ -206,7 +206,7 @@ endif undeploy-xdp: ## Undeploy go-xdp-counter from the cluster specified in ~/.kube/config. ifndef TAG sed 's@URL_BC@$(IMAGE_XDP_BC)@' config/default/go-xdp-counter/patch.yaml.env > config/default/go-xdp-counter/patch.yaml - cd config/default/go-xdp-counter && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-xdp-counter=${IMAGE_XDP_US} + cd config/default/go-xdp-counter && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-xdp-counter=${IMAGE_XDP_US} else $(eval KUST_DIR=$(TAG)) endif @@ -217,7 +217,7 @@ endif deploy-xdp-ms: kustomize ## Deploy go-xdp-counter-sharing-map (shares map with go-xdp-counter) to the cluster specified in ~/.kube/config. ifndef TAG sed 's@URL_BC@$(IMAGE_XDP_BC)@' config/default/go-xdp-counter-sharing-map/patch.yaml.env > config/default/go-xdp-counter-sharing-map/patch.yaml - cd config/default/go-xdp-counter-sharing-map && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-xdp-counter=${IMAGE_XDP_US} + cd config/default/go-xdp-counter-sharing-map && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-xdp-counter=${IMAGE_XDP_US} else $(eval KUST_DIR=$(TAG)) endif @@ -227,7 +227,7 @@ endif undeploy-xdp-ms: ## Undeploy go-xdp-counter-sharing-map from the cluster specified in ~/.kube/config. ifndef TAG sed 's@URL_BC@$(IMAGE_XDP_BC)@' config/default/go-xdp-counter-sharing-map/patch.yaml.env > config/default/go-xdp-counter-sharing-map/patch.yaml - cd config/default/go-xdp-counter-sharing-map && $(KUSTOMIZE) edit set image quay.io/bpfd-userspace/go-xdp-counter=${IMAGE_XDP_US} + cd config/default/go-xdp-counter-sharing-map && $(KUSTOMIZE) edit set image quay.io/bpfman-userspace/go-xdp-counter=${IMAGE_XDP_US} else $(eval KUST_DIR=$(TAG)) endif diff --git a/examples/config/base/go-tc-counter/bytecode.yaml b/examples/config/base/go-tc-counter/bytecode.yaml index 239ee593e..99ca50c2a 100644 --- a/examples/config/base/go-tc-counter/bytecode.yaml +++ b/examples/config/base/go-tc-counter/bytecode.yaml @@ -1,5 +1,5 @@ --- -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: TcProgram metadata: labels: @@ -15,4 +15,4 @@ spec: direction: ingress bytecode: image: - url: quay.io/bpfd-bytecode/go-tc-counter:latest + url: quay.io/bpfman-bytecode/go-tc-counter:latest diff --git a/examples/config/base/go-tc-counter/deployment.yaml b/examples/config/base/go-tc-counter/deployment.yaml index 5f6ee59cb..3a83d890c 100644 --- a/examples/config/base/go-tc-counter/deployment.yaml +++ b/examples/config/base/go-tc-counter/deployment.yaml @@ -7,7 +7,7 @@ metadata: apiVersion: v1 kind: ServiceAccount metadata: - name: bpfd-app-go-tc-counter + name: bpfman-app-go-tc-counter namespace: go-tc-counter --- apiVersion: apps/v1 @@ -29,7 +29,7 @@ spec: nodeSelector: {} hostNetwork: true dnsPolicy: ClusterFirstWithHostNet - serviceAccountName: bpfd-app-go-tc-counter + serviceAccountName: bpfman-app-go-tc-counter tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods @@ -41,7 +41,7 @@ spec: effect: NoSchedule containers: - name: go-tc-counter - image: quay.io/bpfd-userspace/go-tc-counter:latest + image: quay.io/bpfman-userspace/go-tc-counter:latest imagePullPolicy: IfNotPresent securityContext: privileged: false @@ -57,7 +57,7 @@ spec: volumes: - name: go-tc-counter-maps csi: - driver: csi.bpfd.dev + driver: csi.bpfman.io volumeAttributes: - csi.bpfd.dev/program: go-tc-counter-example - csi.bpfd.dev/maps: tc_stats_map + csi.bpfman.io/program: go-tc-counter-example + csi.bpfman.io/maps: tc_stats_map diff --git a/examples/config/base/go-tracepoint-counter/bytecode.yaml b/examples/config/base/go-tracepoint-counter/bytecode.yaml index 80e72e660..4efc1eb76 100644 --- a/examples/config/base/go-tracepoint-counter/bytecode.yaml +++ b/examples/config/base/go-tracepoint-counter/bytecode.yaml @@ -1,5 +1,5 @@ --- -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: TracepointProgram metadata: labels: @@ -12,5 +12,5 @@ spec: names: [syscalls/sys_enter_kill] bytecode: image: - url: quay.io/bpfd-bytecode/go-tracepoint-counter:latest + url: quay.io/bpfman-bytecode/go-tracepoint-counter:latest imagepullpolicy: Always diff --git a/examples/config/base/go-tracepoint-counter/deployment.yaml b/examples/config/base/go-tracepoint-counter/deployment.yaml index 56a230ba1..9edcf4ebe 100644 --- a/examples/config/base/go-tracepoint-counter/deployment.yaml +++ b/examples/config/base/go-tracepoint-counter/deployment.yaml @@ -7,7 +7,7 @@ metadata: apiVersion: v1 kind: ServiceAccount metadata: - name: bpfd-app-go-tracepoint-counter + name: bpfman-app-go-tracepoint-counter namespace: go-tracepoint-counter --- apiVersion: apps/v1 @@ -29,7 +29,7 @@ spec: nodeSelector: {} hostNetwork: true dnsPolicy: ClusterFirstWithHostNet - serviceAccountName: bpfd-app-go-tracepoint-counter + serviceAccountName: bpfman-app-go-tracepoint-counter tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods @@ -41,7 +41,7 @@ spec: effect: NoSchedule containers: - name: go-tracepoint-counter - image: quay.io/bpfd-userspace/go-tracepoint-counter:latest + image: quay.io/bpfman-userspace/go-tracepoint-counter:latest imagePullPolicy: IfNotPresent securityContext: privileged: false @@ -57,7 +57,7 @@ spec: volumes: - name: go-tracepoint-counter-maps csi: - driver: csi.bpfd.dev + driver: csi.bpfman.io volumeAttributes: - csi.bpfd.dev/program: go-tracepoint-counter-example - csi.bpfd.dev/maps: tracepoint_stats_map + csi.bpfman.io/program: go-tracepoint-counter-example + csi.bpfman.io/maps: tracepoint_stats_map diff --git a/examples/config/base/go-xdp-counter-sharing-map/bytecode.yaml b/examples/config/base/go-xdp-counter-sharing-map/bytecode.yaml index 13c433a04..ffd08015e 100644 --- a/examples/config/base/go-xdp-counter-sharing-map/bytecode.yaml +++ b/examples/config/base/go-xdp-counter-sharing-map/bytecode.yaml @@ -1,5 +1,5 @@ --- -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -14,7 +14,7 @@ spec: priority: 55 bytecode: image: - url: quay.io/bpfd-bytecode/go-xdp-counter:latest + url: quay.io/bpfman-bytecode/go-xdp-counter:latest mapownerselector: matchLabels: - bpfd.dev/ownedByProgram: go-xdp-counter-example + bpfman.io/ownedByProgram: go-xdp-counter-example diff --git a/examples/config/base/go-xdp-counter/bytecode.yaml b/examples/config/base/go-xdp-counter/bytecode.yaml index 04011ce34..4495bcafb 100644 --- a/examples/config/base/go-xdp-counter/bytecode.yaml +++ b/examples/config/base/go-xdp-counter/bytecode.yaml @@ -1,5 +1,5 @@ --- -apiVersion: bpfd.dev/v1alpha1 +apiVersion: bpfman.io/v1alpha1 kind: XdpProgram metadata: labels: @@ -14,4 +14,4 @@ spec: priority: 55 bytecode: image: - url: quay.io/bpfd-bytecode/go-xdp-counter:latest + url: quay.io/bpfman-bytecode/go-xdp-counter:latest diff --git a/examples/config/base/go-xdp-counter/deployment.yaml b/examples/config/base/go-xdp-counter/deployment.yaml index 7777507f8..763806e0f 100644 --- a/examples/config/base/go-xdp-counter/deployment.yaml +++ b/examples/config/base/go-xdp-counter/deployment.yaml @@ -7,7 +7,7 @@ metadata: apiVersion: v1 kind: ServiceAccount metadata: - name: bpfd-app-go-xdp-counter + name: bpfman-app-go-xdp-counter namespace: go-xdp-counter --- apiVersion: apps/v1 @@ -29,7 +29,7 @@ spec: nodeSelector: {} hostNetwork: true dnsPolicy: ClusterFirstWithHostNet - serviceAccountName: bpfd-app-go-xdp-counter + serviceAccountName: bpfman-app-go-xdp-counter tolerations: # these tolerations are to have the daemonset runnable on control plane nodes # remove them if your control plane nodes should not run pods @@ -41,7 +41,7 @@ spec: effect: NoSchedule containers: - name: go-xdp-counter - image: quay.io/bpfd-userspace/go-xdp-counter:latest + image: quay.io/bpfman-userspace/go-xdp-counter:latest imagePullPolicy: IfNotPresent securityContext: privileged: false @@ -57,7 +57,7 @@ spec: volumes: - name: go-xdp-counter-maps csi: - driver: csi.bpfd.dev + driver: csi.bpfman.io volumeAttributes: - csi.bpfd.dev/program: go-xdp-counter-example - csi.bpfd.dev/maps: xdp_stats_map + csi.bpfman.io/program: go-xdp-counter-example + csi.bpfman.io/maps: xdp_stats_map diff --git a/examples/config/default/go-tc-counter/kustomization.yaml b/examples/config/default/go-tc-counter/kustomization.yaml index 4edea24c1..815cfbcaf 100644 --- a/examples/config/default/go-tc-counter/kustomization.yaml +++ b/examples/config/default/go-tc-counter/kustomization.yaml @@ -4,8 +4,8 @@ kind: Kustomization # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tc-counter - newName: quay.io/bpfd-userspace/go-tc-counter + - name: quay.io/bpfman-userspace/go-tc-counter + newName: quay.io/bpfman-userspace/go-tc-counter newTag: latest # Patch the bytecode.yaml to change tag on the "url" field (which is an # image) to new value. Since this is being done with an environment diff --git a/examples/config/default/go-tc-counter/patch.yaml b/examples/config/default/go-tc-counter/patch.yaml index baacb40d8..e7b3848c9 100644 --- a/examples/config/default/go-tc-counter/patch.yaml +++ b/examples/config/default/go-tc-counter/patch.yaml @@ -3,4 +3,4 @@ # (which is an image) to new value. - op: replace path: /spec/bytecode/image/url - value: quay.io/bpfd-bytecode/go-tc-counter:latest + value: quay.io/bpfman-bytecode/go-tc-counter:latest diff --git a/examples/config/default/go-tracepoint-counter/kustomization.yaml b/examples/config/default/go-tracepoint-counter/kustomization.yaml index e0e6b517b..33c5ce117 100644 --- a/examples/config/default/go-tracepoint-counter/kustomization.yaml +++ b/examples/config/default/go-tracepoint-counter/kustomization.yaml @@ -4,8 +4,8 @@ kind: Kustomization # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tracepoint-counter - newName: quay.io/bpfd-userspace/go-tracepoint-counter + - name: quay.io/bpfman-userspace/go-tracepoint-counter + newName: quay.io/bpfman-userspace/go-tracepoint-counter newTag: latest # Patch the bytecode.yaml to change tag on the "url" field (which is an # image) to new value. Since this is being done with an environment diff --git a/examples/config/default/go-tracepoint-counter/patch.yaml b/examples/config/default/go-tracepoint-counter/patch.yaml index b096b10ae..1e249aa76 100644 --- a/examples/config/default/go-tracepoint-counter/patch.yaml +++ b/examples/config/default/go-tracepoint-counter/patch.yaml @@ -3,4 +3,4 @@ # (which is an image) to new value. - op: replace path: /spec/bytecode/image/url - value: quay.io/bpfd-bytecode/go-tracepoint-counter:latest + value: quay.io/bpfman-bytecode/go-tracepoint-counter:latest diff --git a/examples/config/default/go-xdp-counter-sharing-map/kustomization.yaml b/examples/config/default/go-xdp-counter-sharing-map/kustomization.yaml index 2f5920cc4..229b0d52a 100644 --- a/examples/config/default/go-xdp-counter-sharing-map/kustomization.yaml +++ b/examples/config/default/go-xdp-counter-sharing-map/kustomization.yaml @@ -12,6 +12,6 @@ patches: name: go-xdp-counter-example resources: [../../base/go-xdp-counter-sharing-map] images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: latest diff --git a/examples/config/default/go-xdp-counter-sharing-map/patch.yaml b/examples/config/default/go-xdp-counter-sharing-map/patch.yaml index 8b649e94f..4224aaac2 100644 --- a/examples/config/default/go-xdp-counter-sharing-map/patch.yaml +++ b/examples/config/default/go-xdp-counter-sharing-map/patch.yaml @@ -3,4 +3,4 @@ # (which is an image) to new value. - op: replace path: /spec/bytecode/image/url - value: quay.io/bpfd-bytecode/go-xdp-counter:latest + value: quay.io/bpfman-bytecode/go-xdp-counter:latest diff --git a/examples/config/default/go-xdp-counter/kustomization.yaml b/examples/config/default/go-xdp-counter/kustomization.yaml index ee1e44a05..a278dfaef 100644 --- a/examples/config/default/go-xdp-counter/kustomization.yaml +++ b/examples/config/default/go-xdp-counter/kustomization.yaml @@ -4,8 +4,8 @@ kind: Kustomization # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: latest # Patch the bytecode.yaml to change tag on the "url" field (which is an # image) to new value. Since this is being done with an environment diff --git a/examples/config/default/go-xdp-counter/patch.yaml b/examples/config/default/go-xdp-counter/patch.yaml index 8b649e94f..4224aaac2 100644 --- a/examples/config/default/go-xdp-counter/patch.yaml +++ b/examples/config/default/go-xdp-counter/patch.yaml @@ -3,4 +3,4 @@ # (which is an image) to new value. - op: replace path: /spec/bytecode/image/url - value: quay.io/bpfd-bytecode/go-xdp-counter:latest + value: quay.io/bpfman-bytecode/go-xdp-counter:latest diff --git a/examples/config/v0.2.0/go-tc-counter/kustomization.yaml b/examples/config/v0.2.0/go-tc-counter/kustomization.yaml index 643c3c7e5..d1ccc8b27 100644 --- a/examples/config/v0.2.0/go-tc-counter/kustomization.yaml +++ b/examples/config/v0.2.0/go-tc-counter/kustomization.yaml @@ -10,13 +10,13 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tc-counter:v0.2.0 + value: quay.io/bpfman-bytecode/go-tc-counter:v0.2.0 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tc-counter - newName: quay.io/bpfd-userspace/go-tc-counter + - name: quay.io/bpfman-userspace/go-tc-counter + newName: quay.io/bpfman-userspace/go-tc-counter newTag: v0.2.0 resources: diff --git a/examples/config/v0.2.0/go-tracepoint-counter/kustomization.yaml b/examples/config/v0.2.0/go-tracepoint-counter/kustomization.yaml index 0b03e86ed..c72a3857d 100644 --- a/examples/config/v0.2.0/go-tracepoint-counter/kustomization.yaml +++ b/examples/config/v0.2.0/go-tracepoint-counter/kustomization.yaml @@ -10,13 +10,13 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tracepoint-counter:v0.2.0 + value: quay.io/bpfman-bytecode/go-tracepoint-counter:v0.2.0 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tracepoint-counter - newName: quay.io/bpfd-userspace/go-tracepoint-counter + - name: quay.io/bpfman-userspace/go-tracepoint-counter + newName: quay.io/bpfman-userspace/go-tracepoint-counter newTag: v0.2.0 resources: diff --git a/examples/config/v0.2.0/go-xdp-counter/kustomization.yaml b/examples/config/v0.2.0/go-xdp-counter/kustomization.yaml index 28e36bc5c..cfb1ee815 100644 --- a/examples/config/v0.2.0/go-xdp-counter/kustomization.yaml +++ b/examples/config/v0.2.0/go-xdp-counter/kustomization.yaml @@ -10,13 +10,13 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-xdp-counter:v0.2.0 + value: quay.io/bpfman-bytecode/go-xdp-counter:v0.2.0 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: v0.2.0 resources: diff --git a/examples/config/v0.3.0/go-tc-counter/kustomization.yaml b/examples/config/v0.3.0/go-tc-counter/kustomization.yaml index eea3b2903..fe509b54f 100644 --- a/examples/config/v0.3.0/go-tc-counter/kustomization.yaml +++ b/examples/config/v0.3.0/go-tc-counter/kustomization.yaml @@ -10,13 +10,13 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tc-counter:v0.3.0 + value: quay.io/bpfman-bytecode/go-tc-counter:v0.3.0 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tc-counter - newName: quay.io/bpfd-userspace/go-tc-counter + - name: quay.io/bpfman-userspace/go-tc-counter + newName: quay.io/bpfman-userspace/go-tc-counter newTag: v0.3.0 resources: diff --git a/examples/config/v0.3.0/go-tracepoint-counter/kustomization.yaml b/examples/config/v0.3.0/go-tracepoint-counter/kustomization.yaml index 4781034c0..36bfd8da3 100644 --- a/examples/config/v0.3.0/go-tracepoint-counter/kustomization.yaml +++ b/examples/config/v0.3.0/go-tracepoint-counter/kustomization.yaml @@ -10,13 +10,13 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tracepoint-counter:v0.3.0 + value: quay.io/bpfman-bytecode/go-tracepoint-counter:v0.3.0 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tracepoint-counter - newName: quay.io/bpfd-userspace/go-tracepoint-counter + - name: quay.io/bpfman-userspace/go-tracepoint-counter + newName: quay.io/bpfman-userspace/go-tracepoint-counter newTag: v0.3.0 resources: diff --git a/examples/config/v0.3.0/go-xdp-counter-sharing-map/kustomization.yaml b/examples/config/v0.3.0/go-xdp-counter-sharing-map/kustomization.yaml index cc87fb6e3..635865103 100644 --- a/examples/config/v0.3.0/go-xdp-counter-sharing-map/kustomization.yaml +++ b/examples/config/v0.3.0/go-xdp-counter-sharing-map/kustomization.yaml @@ -10,13 +10,13 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-xdp-counter:v0.3.0 + value: quay.io/bpfman-bytecode/go-xdp-counter:v0.3.0 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: v0.3.0 resources: diff --git a/examples/config/v0.3.0/go-xdp-counter/kustomization.yaml b/examples/config/v0.3.0/go-xdp-counter/kustomization.yaml index 23015574e..be6beb0f3 100644 --- a/examples/config/v0.3.0/go-xdp-counter/kustomization.yaml +++ b/examples/config/v0.3.0/go-xdp-counter/kustomization.yaml @@ -10,13 +10,13 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-xdp-counter:v0.3.0 + value: quay.io/bpfman-bytecode/go-xdp-counter:v0.3.0 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: v0.3.0 resources: diff --git a/examples/config/v0.3.1-ocp/go-tc-counter/kustomization.yaml b/examples/config/v0.3.1-ocp/go-tc-counter/kustomization.yaml index dbf481ed8..349cfb83b 100644 --- a/examples/config/v0.3.1-ocp/go-tc-counter/kustomization.yaml +++ b/examples/config/v0.3.1-ocp/go-tc-counter/kustomization.yaml @@ -7,7 +7,7 @@ patches: - patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tc-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-tc-counter:v0.3.1 target: kind: TcProgram name: go-tc-counter-example @@ -29,7 +29,7 @@ patches: # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tc-counter - newName: quay.io/bpfd-userspace/go-tc-counter + - name: quay.io/bpfman-userspace/go-tc-counter + newName: quay.io/bpfman-userspace/go-tc-counter newTag: v0.3.1 resources: [../../base/go-tc-counter, ocp-scc.yaml] diff --git a/examples/config/v0.3.1-ocp/go-tc-counter/ocp-scc.yaml b/examples/config/v0.3.1-ocp/go-tc-counter/ocp-scc.yaml index 44fe60e22..88165e9a5 100644 --- a/examples/config/v0.3.1-ocp/go-tc-counter/ocp-scc.yaml +++ b/examples/config/v0.3.1-ocp/go-tc-counter/ocp-scc.yaml @@ -9,5 +9,5 @@ roleRef: name: system:openshift:scc:privileged subjects: - kind: ServiceAccount - name: bpfd-app-go-tc-counter + name: bpfman-app-go-tc-counter namespace: go-tc-counter diff --git a/examples/config/v0.3.1-ocp/go-tc-counter/patch.yaml b/examples/config/v0.3.1-ocp/go-tc-counter/patch.yaml index 17d5b3ab5..4345fa113 100644 --- a/examples/config/v0.3.1-ocp/go-tc-counter/patch.yaml +++ b/examples/config/v0.3.1-ocp/go-tc-counter/patch.yaml @@ -2,4 +2,4 @@ # (which is an image) to new value. - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tc-counter:latest + value: quay.io/bpfman-bytecode/go-tc-counter:latest diff --git a/examples/config/v0.3.1-ocp/go-tracepoint-counter/kustomization.yaml b/examples/config/v0.3.1-ocp/go-tracepoint-counter/kustomization.yaml index 60d8cbb8d..f94354eba 100644 --- a/examples/config/v0.3.1-ocp/go-tracepoint-counter/kustomization.yaml +++ b/examples/config/v0.3.1-ocp/go-tracepoint-counter/kustomization.yaml @@ -7,7 +7,7 @@ patches: - patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tracepoint-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-tracepoint-counter:v0.3.1 target: kind: TcProgram name: go-tracepoint-counter-example @@ -29,7 +29,7 @@ patches: # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tracepoint-counter - newName: quay.io/bpfd-userspace/go-tracepoint-counter + - name: quay.io/bpfman-userspace/go-tracepoint-counter + newName: quay.io/bpfman-userspace/go-tracepoint-counter newTag: v0.3.1 resources: [../../base/go-tracepoint-counter, ocp-scc.yaml] diff --git a/examples/config/v0.3.1-ocp/go-tracepoint-counter/ocp-scc.yaml b/examples/config/v0.3.1-ocp/go-tracepoint-counter/ocp-scc.yaml index 44218b9c8..886655c9e 100644 --- a/examples/config/v0.3.1-ocp/go-tracepoint-counter/ocp-scc.yaml +++ b/examples/config/v0.3.1-ocp/go-tracepoint-counter/ocp-scc.yaml @@ -9,5 +9,5 @@ roleRef: name: system:openshift:scc:privileged subjects: - kind: ServiceAccount - name: bpfd-app-go-tracepoint-counter + name: bpfman-app-go-tracepoint-counter namespace: go-tracepoint-counter diff --git a/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/kustomization.yaml b/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/kustomization.yaml index 9eaefa9c5..cf53da7da 100644 --- a/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/kustomization.yaml +++ b/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/kustomization.yaml @@ -7,7 +7,7 @@ patches: - patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-xdp-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-xdp-counter:v0.3.1 target: kind: TcProgram name: go-xdp-counter-example @@ -29,7 +29,7 @@ patches: # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: v0.3.1 resources: [../../base/go-xdp-counter-sharing-map, ocp-scc.yaml] diff --git a/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/ocp-scc.yaml b/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/ocp-scc.yaml index 6edbcee25..b6a48f544 100644 --- a/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/ocp-scc.yaml +++ b/examples/config/v0.3.1-ocp/go-xdp-counter-sharing-map/ocp-scc.yaml @@ -9,5 +9,5 @@ roleRef: name: system:openshift:scc:privileged subjects: - kind: ServiceAccount - name: bpfd-app-go-xdp-counter + name: bpfman-app-go-xdp-counter namespace: go-xdp-counter diff --git a/examples/config/v0.3.1-ocp/go-xdp-counter/kustomization.yaml b/examples/config/v0.3.1-ocp/go-xdp-counter/kustomization.yaml index e6dee362f..65e2aa371 100644 --- a/examples/config/v0.3.1-ocp/go-xdp-counter/kustomization.yaml +++ b/examples/config/v0.3.1-ocp/go-xdp-counter/kustomization.yaml @@ -7,7 +7,7 @@ patches: - patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-xdp-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-xdp-counter:v0.3.1 target: kind: TcProgram name: go-xdp-counter-example @@ -29,7 +29,7 @@ patches: # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: v0.3.1 resources: [../../base/go-xdp-counter, ocp-scc.yaml] diff --git a/examples/config/v0.3.1-ocp/go-xdp-counter/ocp-scc.yaml b/examples/config/v0.3.1-ocp/go-xdp-counter/ocp-scc.yaml index 6edbcee25..b6a48f544 100644 --- a/examples/config/v0.3.1-ocp/go-xdp-counter/ocp-scc.yaml +++ b/examples/config/v0.3.1-ocp/go-xdp-counter/ocp-scc.yaml @@ -9,5 +9,5 @@ roleRef: name: system:openshift:scc:privileged subjects: - kind: ServiceAccount - name: bpfd-app-go-xdp-counter + name: bpfman-app-go-xdp-counter namespace: go-xdp-counter diff --git a/examples/config/v0.3.1/go-tc-counter/kustomization.yaml b/examples/config/v0.3.1/go-tc-counter/kustomization.yaml index f43825bd7..ec78b0c34 100644 --- a/examples/config/v0.3.1/go-tc-counter/kustomization.yaml +++ b/examples/config/v0.3.1/go-tc-counter/kustomization.yaml @@ -10,11 +10,11 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tc-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-tc-counter:v0.3.1 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tc-counter - newName: quay.io/bpfd-userspace/go-tc-counter + - name: quay.io/bpfman-userspace/go-tc-counter + newName: quay.io/bpfman-userspace/go-tc-counter newTag: v0.3.1 resources: [../../base/go-tc-counter] diff --git a/examples/config/v0.3.1/go-tracepoint-counter/kustomization.yaml b/examples/config/v0.3.1/go-tracepoint-counter/kustomization.yaml index e697c4322..a8a214121 100644 --- a/examples/config/v0.3.1/go-tracepoint-counter/kustomization.yaml +++ b/examples/config/v0.3.1/go-tracepoint-counter/kustomization.yaml @@ -10,11 +10,11 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-tracepoint-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-tracepoint-counter:v0.3.1 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-tracepoint-counter - newName: quay.io/bpfd-userspace/go-tracepoint-counter + - name: quay.io/bpfman-userspace/go-tracepoint-counter + newName: quay.io/bpfman-userspace/go-tracepoint-counter newTag: v0.3.1 resources: [../../base/go-tracepoint-counter] diff --git a/examples/config/v0.3.1/go-xdp-counter-sharing-map/kustomization.yaml b/examples/config/v0.3.1/go-xdp-counter-sharing-map/kustomization.yaml index d1d5d373f..9032f83d5 100644 --- a/examples/config/v0.3.1/go-xdp-counter-sharing-map/kustomization.yaml +++ b/examples/config/v0.3.1/go-xdp-counter-sharing-map/kustomization.yaml @@ -10,11 +10,11 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-xdp-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-xdp-counter:v0.3.1 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: v0.3.1 resources: [../../base/go-xdp-counter-sharing-map] diff --git a/examples/config/v0.3.1/go-xdp-counter/kustomization.yaml b/examples/config/v0.3.1/go-xdp-counter/kustomization.yaml index e6dadec03..dd4e779e1 100644 --- a/examples/config/v0.3.1/go-xdp-counter/kustomization.yaml +++ b/examples/config/v0.3.1/go-xdp-counter/kustomization.yaml @@ -10,11 +10,11 @@ patches: patch: |- - op: replace path: "/spec/bytecode/image/url" - value: quay.io/bpfd-bytecode/go-xdp-counter:v0.3.1 + value: quay.io/bpfman-bytecode/go-xdp-counter:v0.3.1 # Patch the deployment.yaml to change container image in Daemonset # to new tag on the image. images: - - name: quay.io/bpfd-userspace/go-xdp-counter - newName: quay.io/bpfd-userspace/go-xdp-counter + - name: quay.io/bpfman-userspace/go-xdp-counter + newName: quay.io/bpfman-userspace/go-xdp-counter newTag: v0.3.1 resources: [../../base/go-xdp-counter] diff --git a/examples/go-tc-counter/bpf/tc_counter.c b/examples/go-tc-counter/bpf/tc_counter.c index c62d6307b..e5ea1bffd 100644 --- a/examples/go-tc-counter/bpf/tc_counter.c +++ b/examples/go-tc-counter/bpf/tc_counter.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman #include #include diff --git a/examples/go-tc-counter/container-deployment/Containerfile.go-tc-counter b/examples/go-tc-counter/container-deployment/Containerfile.go-tc-counter index 7ad2e2763..6e536a798 100644 --- a/examples/go-tc-counter/container-deployment/Containerfile.go-tc-counter +++ b/examples/go-tc-counter/container-deployment/Containerfile.go-tc-counter @@ -7,16 +7,16 @@ RUN apt-get update && apt-get install -y \ RUN go install github.com/cilium/ebpf/cmd/bpf2go@master -WORKDIR /usr/src/bpfd/ -COPY ./ /usr/src/bpfd/ +WORKDIR /usr/src/bpfman/ +COPY ./ /usr/src/bpfman/ -WORKDIR /usr/src/bpfd/examples/go-tc-counter +WORKDIR /usr/src/bpfman/examples/go-tc-counter # Compile go-tc-counter RUN go build FROM registry.fedoraproject.org/fedora-minimal:latest -COPY --from=go-tc-counter-build /usr/src/bpfd/examples/go-tc-counter/go-tc-counter . +COPY --from=go-tc-counter-build /usr/src/bpfman/examples/go-tc-counter/go-tc-counter . ENTRYPOINT ["./go-tc-counter", "--crd"] diff --git a/examples/go-tc-counter/main.go b/examples/go-tc-counter/main.go index c2b734ce5..77e6f1a81 100644 --- a/examples/go-tc-counter/main.go +++ b/examples/go-tc-counter/main.go @@ -12,9 +12,9 @@ import ( "syscall" "time" - bpfdHelpers "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/helpers" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" - configMgmt "github.com/bpfd-dev/bpfd/examples/pkg/config-mgmt" + bpfmanHelpers "github.com/bpfman/bpfman/bpfman-operator/pkg/helpers" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" + configMgmt "github.com/bpfman/bpfman/examples/pkg/config-mgmt" "github.com/cilium/ebpf" ) @@ -24,7 +24,7 @@ type Stats struct { } const ( - DefaultConfigPath = "/etc/bpfd/bpfd.toml" + DefaultConfigPath = "/etc/bpfman/bpfman.toml" DefaultByteCodeFile = "bpf_bpfel.o" TcProgramName = "go-tc-counter-example" BpfProgramMapIndex = "tc_stats_map" @@ -50,13 +50,13 @@ func main() { } var action string - var direction bpfdHelpers.TcProgramDirection + var direction bpfmanHelpers.TcProgramDirection if paramData.Direction == configMgmt.TcDirectionIngress { action = "received" - direction = bpfdHelpers.Ingress + direction = bpfmanHelpers.Ingress } else { action = "sent" - direction = bpfdHelpers.Egress + direction = bpfmanHelpers.Egress } var mapPath string @@ -77,20 +77,20 @@ func main() { log.Printf("failed to create client connection: %v", err) return } - c := gobpfd.NewBpfdClient(conn) + c := gobpfman.NewBpfmanClient(conn) // If the bytecode src is a Program ID, skip the loading and unloading of the bytecode. if paramData.BytecodeSrc != configMgmt.SrcProgId { - var loadRequest *gobpfd.LoadRequest + var loadRequest *gobpfman.LoadRequest if paramData.MapOwnerId != 0 { mapOwnerId := uint32(paramData.MapOwnerId) - loadRequest = &gobpfd.LoadRequest{ + loadRequest = &gobpfman.LoadRequest{ Bytecode: paramData.BytecodeSource, Name: "stats", - ProgramType: *bpfdHelpers.Tc.Uint32(), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TcAttachInfo{ - TcAttachInfo: &gobpfd.TCAttachInfo{ + ProgramType: *bpfmanHelpers.Tc.Uint32(), + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TcAttachInfo{ + TcAttachInfo: &gobpfman.TCAttachInfo{ Priority: int32(paramData.Priority), Iface: paramData.Iface, Direction: direction.String(), @@ -100,13 +100,13 @@ func main() { MapOwnerId: &mapOwnerId, } } else { - loadRequest = &gobpfd.LoadRequest{ + loadRequest = &gobpfman.LoadRequest{ Bytecode: paramData.BytecodeSource, Name: "stats", - ProgramType: *bpfdHelpers.Xdp.Uint32(), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TcAttachInfo{ - TcAttachInfo: &gobpfd.TCAttachInfo{ + ProgramType: *bpfmanHelpers.Xdp.Uint32(), + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TcAttachInfo{ + TcAttachInfo: &gobpfman.TCAttachInfo{ Priority: int32(paramData.Priority), Iface: paramData.Iface, Direction: direction.String(), @@ -116,8 +116,8 @@ func main() { } } - // 1. Load Program using bpfd - var res *gobpfd.LoadResponse + // 1. Load Program using bpfman + var res *gobpfman.LoadResponse res, err = c.Load(ctx, loadRequest) if err != nil { conn.Close() @@ -138,7 +138,7 @@ func main() { // 2. Set up defer to unload program when this is closed defer func(id uint) { log.Printf("Unloading Program: %d\n", id) - _, err = c.Unload(ctx, &gobpfd.UnloadRequest{Id: uint32(id)}) + _, err = c.Unload(ctx, &gobpfman.UnloadRequest{Id: uint32(id)}) if err != nil { conn.Close() log.Print(err) diff --git a/examples/go-tracepoint-counter/bpf/tracepoint_counter.c b/examples/go-tracepoint-counter/bpf/tracepoint_counter.c index 7c206c313..1e89e54d6 100644 --- a/examples/go-tracepoint-counter/bpf/tracepoint_counter.c +++ b/examples/go-tracepoint-counter/bpf/tracepoint_counter.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman #include #include diff --git a/examples/go-tracepoint-counter/container-deployment/Containerfile.go-tracepoint-counter b/examples/go-tracepoint-counter/container-deployment/Containerfile.go-tracepoint-counter index 2f37ba69e..916007b0c 100644 --- a/examples/go-tracepoint-counter/container-deployment/Containerfile.go-tracepoint-counter +++ b/examples/go-tracepoint-counter/container-deployment/Containerfile.go-tracepoint-counter @@ -7,16 +7,16 @@ RUN apt-get update && apt-get install -y \ RUN go install github.com/cilium/ebpf/cmd/bpf2go@master -WORKDIR /usr/src/bpfd/ -COPY ./ /usr/src/bpfd/ +WORKDIR /usr/src/bpfman/ +COPY ./ /usr/src/bpfman/ -WORKDIR /usr/src/bpfd/examples/go-tracepoint-counter +WORKDIR /usr/src/bpfman/examples/go-tracepoint-counter # Compile go-tracepoint-counter RUN go build FROM registry.fedoraproject.org/fedora-minimal:latest -COPY --from=go-tracepoint-counter-build /usr/src/bpfd/examples/go-tracepoint-counter/go-tracepoint-counter . +COPY --from=go-tracepoint-counter-build /usr/src/bpfman/examples/go-tracepoint-counter/go-tracepoint-counter . ENTRYPOINT ["./go-tracepoint-counter", "--crd"] diff --git a/examples/go-tracepoint-counter/main.go b/examples/go-tracepoint-counter/main.go index 3e5b491af..d3b8ff9c1 100644 --- a/examples/go-tracepoint-counter/main.go +++ b/examples/go-tracepoint-counter/main.go @@ -12,9 +12,9 @@ import ( "syscall" "time" - bpfdHelpers "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/helpers" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" - configMgmt "github.com/bpfd-dev/bpfd/examples/pkg/config-mgmt" + bpfmanHelpers "github.com/bpfman/bpfman/bpfman-operator/pkg/helpers" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" + configMgmt "github.com/bpfman/bpfman/examples/pkg/config-mgmt" "github.com/cilium/ebpf" ) @@ -22,7 +22,7 @@ const ( TracepointProgramName = "go-tracepoint-counter-example" BpfProgramMapIndex = "tracepoint_stats_map" DefaultByteCodeFile = "bpf_bpfel.o" - DefaultConfigPath = "/etc/bpfd/bpfd.toml" + DefaultConfigPath = "/etc/bpfman/bpfman.toml" // MapsMountPoint is the "go-tracepoint-counter-maps" volumeMount "mountPath" from "deployment.yaml" MapsMountPoint = "/run/tracepoint/maps" @@ -37,8 +37,8 @@ func main() { stop := make(chan os.Signal, 1) signal.Notify(stop, os.Interrupt, syscall.SIGINT, syscall.SIGTERM) - // pull the BPFD config management data to determine if we're running on a - // system with BPFD available. + // pull the BPFMAN config management data to determine if we're running on a + // system with BPFMAN available. paramData, err := configMgmt.ParseParamData(configMgmt.ProgTypeTracepoint, DefaultConfigPath, DefaultByteCodeFile) if err != nil { log.Printf("error processing parameters: %v\n", err) @@ -46,7 +46,7 @@ func main() { } // determine the path to the tracepoint_stats_map, whether provided via CRD - // or BPFD or otherwise. + // or BPFMAN or otherwise. var mapPath string // If running in a Kubernetes deployment, the eBPF program is already loaded. // Only need the map path, which is at a known location in the pod using VolumeMounts @@ -57,30 +57,30 @@ func main() { } else { // if not on k8s, find the map path from the system ctx := context.Background() - // get the BPFD config + // get the BPFMAN config configFileData := configMgmt.LoadConfig(DefaultConfigPath) - // connect to the BPFD server + // connect to the BPFMAN server conn, err := configMgmt.CreateConnection(configFileData.Grpc.Endpoints, ctx) if err != nil { log.Printf("failed to create client connection: %v", err) return } - c := gobpfd.NewBpfdClient(conn) + c := gobpfman.NewBpfmanClient(conn) // If the bytecode src is a Program ID, skip the loading and unloading of the bytecode. if paramData.BytecodeSrc != configMgmt.SrcProgId { - var loadRequest *gobpfd.LoadRequest + var loadRequest *gobpfman.LoadRequest if paramData.MapOwnerId != 0 { mapOwnerId := uint32(paramData.MapOwnerId) - loadRequest = &gobpfd.LoadRequest{ + loadRequest = &gobpfman.LoadRequest{ Bytecode: paramData.BytecodeSource, Name: "tracepoint_kill_recorder", - ProgramType: *bpfdHelpers.Tracepoint.Uint32(), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TracepointAttachInfo{ - TracepointAttachInfo: &gobpfd.TracepointAttachInfo{ + ProgramType: *bpfmanHelpers.Tracepoint.Uint32(), + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TracepointAttachInfo{ + TracepointAttachInfo: &gobpfman.TracepointAttachInfo{ Tracepoint: "syscalls/sys_enter_kill", }, }, @@ -88,13 +88,13 @@ func main() { MapOwnerId: &mapOwnerId, } } else { - loadRequest = &gobpfd.LoadRequest{ + loadRequest = &gobpfman.LoadRequest{ Bytecode: paramData.BytecodeSource, Name: "tracepoint_kill_recorder", - ProgramType: *bpfdHelpers.Tracepoint.Uint32(), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_TracepointAttachInfo{ - TracepointAttachInfo: &gobpfd.TracepointAttachInfo{ + ProgramType: *bpfmanHelpers.Tracepoint.Uint32(), + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_TracepointAttachInfo{ + TracepointAttachInfo: &gobpfman.TracepointAttachInfo{ Tracepoint: "syscalls/sys_enter_kill", }, }, @@ -102,8 +102,8 @@ func main() { } } - // 1. Load Program using bpfd - var res *gobpfd.LoadResponse + // 1. Load Program using bpfman + var res *gobpfman.LoadResponse res, err = c.Load(ctx, loadRequest) if err != nil { conn.Close() @@ -124,7 +124,7 @@ func main() { // 2. Set up defer to unload program when this is closed defer func(id uint) { log.Printf("unloading program: %d\n", id) - _, err = c.Unload(ctx, &gobpfd.UnloadRequest{Id: uint32(id)}) + _, err = c.Unload(ctx, &gobpfman.UnloadRequest{Id: uint32(id)}) if err != nil { conn.Close() log.Print(err) diff --git a/examples/go-xdp-counter/bpf/xdp_counter.c b/examples/go-xdp-counter/bpf/xdp_counter.c index e75ce3600..9a6057453 100644 --- a/examples/go-xdp-counter/bpf/xdp_counter.c +++ b/examples/go-xdp-counter/bpf/xdp_counter.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -// Modifications Copyright Authors of bpfd +// Modifications Copyright Authors of bpfman // Derived from: // https://github.com/xdp-project/xdp-tutorial/tree/master/basic03-map-counter diff --git a/examples/go-xdp-counter/container-deployment/Containerfile.go-xdp-counter b/examples/go-xdp-counter/container-deployment/Containerfile.go-xdp-counter index 737d2595e..38953a214 100644 --- a/examples/go-xdp-counter/container-deployment/Containerfile.go-xdp-counter +++ b/examples/go-xdp-counter/container-deployment/Containerfile.go-xdp-counter @@ -7,16 +7,16 @@ RUN apt-get update && apt-get install -y \ RUN go install github.com/cilium/ebpf/cmd/bpf2go@master -WORKDIR /usr/src/bpfd/ -COPY ./ /usr/src/bpfd/ +WORKDIR /usr/src/bpfman/ +COPY ./ /usr/src/bpfman/ -WORKDIR /usr/src/bpfd/examples/go-xdp-counter +WORKDIR /usr/src/bpfman/examples/go-xdp-counter # Compile gocounter RUN go build FROM registry.fedoraproject.org/fedora-minimal:latest -COPY --from=gocounter-build /usr/src/bpfd/examples/go-xdp-counter/go-xdp-counter . +COPY --from=gocounter-build /usr/src/bpfman/examples/go-xdp-counter/go-xdp-counter . ENTRYPOINT ["./go-xdp-counter", "--crd"] diff --git a/examples/go-xdp-counter/main.go b/examples/go-xdp-counter/main.go index e37d4e2ad..10933cbc7 100644 --- a/examples/go-xdp-counter/main.go +++ b/examples/go-xdp-counter/main.go @@ -12,9 +12,9 @@ import ( "syscall" "time" - bpfdHelpers "github.com/bpfd-dev/bpfd/bpfd-operator/pkg/helpers" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" - configMgmt "github.com/bpfd-dev/bpfd/examples/pkg/config-mgmt" + bpfmanHelpers "github.com/bpfman/bpfman/bpfman-operator/pkg/helpers" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" + configMgmt "github.com/bpfman/bpfman/examples/pkg/config-mgmt" "github.com/cilium/ebpf" ) @@ -24,7 +24,7 @@ type Stats struct { } const ( - DefaultConfigPath = "/etc/bpfd/bpfd.toml" + DefaultConfigPath = "/etc/bpfman/bpfman.toml" DefaultByteCodeFile = "bpf_bpfel.o" XdpProgramName = "go-xdp-counter-example" BpfProgramMapIndex = "xdp_stats_map" @@ -68,20 +68,20 @@ func main() { return } - c := gobpfd.NewBpfdClient(conn) + c := gobpfman.NewBpfmanClient(conn) // If the bytecode src is a Program ID, skip the loading and unloading of the bytecode. if paramData.BytecodeSrc != configMgmt.SrcProgId { - var loadRequest *gobpfd.LoadRequest + var loadRequest *gobpfman.LoadRequest if paramData.MapOwnerId != 0 { mapOwnerId := uint32(paramData.MapOwnerId) - loadRequest = &gobpfd.LoadRequest{ + loadRequest = &gobpfman.LoadRequest{ Bytecode: paramData.BytecodeSource, Name: "xdp_stats", - ProgramType: *bpfdHelpers.Xdp.Uint32(), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_XdpAttachInfo{ - XdpAttachInfo: &gobpfd.XDPAttachInfo{ + ProgramType: *bpfmanHelpers.Xdp.Uint32(), + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_XdpAttachInfo{ + XdpAttachInfo: &gobpfman.XDPAttachInfo{ Priority: int32(paramData.Priority), Iface: paramData.Iface, }, @@ -90,13 +90,13 @@ func main() { MapOwnerId: &mapOwnerId, } } else { - loadRequest = &gobpfd.LoadRequest{ + loadRequest = &gobpfman.LoadRequest{ Bytecode: paramData.BytecodeSource, Name: "xdp_stats", - ProgramType: *bpfdHelpers.Xdp.Uint32(), - Attach: &gobpfd.AttachInfo{ - Info: &gobpfd.AttachInfo_XdpAttachInfo{ - XdpAttachInfo: &gobpfd.XDPAttachInfo{ + ProgramType: *bpfmanHelpers.Xdp.Uint32(), + Attach: &gobpfman.AttachInfo{ + Info: &gobpfman.AttachInfo_XdpAttachInfo{ + XdpAttachInfo: &gobpfman.XDPAttachInfo{ Priority: int32(paramData.Priority), Iface: paramData.Iface, }, @@ -105,8 +105,8 @@ func main() { } } - // 1. Load Program using bpfd - var res *gobpfd.LoadResponse + // 1. Load Program using bpfman + var res *gobpfman.LoadResponse res, err = c.Load(ctx, loadRequest) if err != nil { conn.Close() @@ -127,7 +127,7 @@ func main() { // 2. Set up defer to unload program when this is closed defer func(id uint) { log.Printf("Unloading Program: %d\n", id) - _, err = c.Unload(ctx, &gobpfd.UnloadRequest{Id: uint32(id)}) + _, err = c.Unload(ctx, &gobpfman.UnloadRequest{Id: uint32(id)}) if err != nil { conn.Close() log.Print(err) diff --git a/examples/go.sum b/examples/go.sum deleted file mode 100644 index 91ff389c4..000000000 --- a/examples/go.sum +++ /dev/null @@ -1,24 +0,0 @@ -github.com/bpfd-dev/bpfd/clients/gobpfd v0.0.0-20230427182555-5f8f671ebfc2 h1:QHQ5h91rgRSZYfb1wJAtQIJ/oaQo0IvnpsgyNZCnCJY= -github.com/cilium/ebpf v0.10.0 h1:nk5HPMeoBXtOzbkZBWym+ZWq1GIiHUsBFXxwewXAHLQ= -github.com/cilium/ebpf v0.10.0/go.mod h1:DPiVdY/kT534dgc9ERmvP8mWA+9gvwgKfRvk4nNWnoE= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= -github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= -google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/examples/pkg/config-mgmt/configfile.go b/examples/pkg/config-mgmt/configfile.go index 0fa0eb1bf..7e716e72f 100644 --- a/examples/pkg/config-mgmt/configfile.go +++ b/examples/pkg/config-mgmt/configfile.go @@ -45,7 +45,7 @@ type ConfigFileData struct { const ( DefaultType = "unix" - DefaultPath = "/run/bpfd/bpfd.sock" + DefaultPath = "/run/bpfman/bpfman.sock" DefaultEnabled = true ) diff --git a/examples/pkg/config-mgmt/param.go b/examples/pkg/config-mgmt/param.go index 829f51413..eebc7af31 100644 --- a/examples/pkg/config-mgmt/param.go +++ b/examples/pkg/config-mgmt/param.go @@ -24,7 +24,7 @@ import ( "os" "path/filepath" - gobpfd "github.com/bpfd-dev/bpfd/clients/gobpfd/v1" + gobpfman "github.com/bpfman/bpfman/clients/gobpfman/v1" ) const ( @@ -64,7 +64,7 @@ type ParameterData struct { MapOwnerId int // The bytecodesource type has to be encapsulated in a complete BytecodeLocation // because isBytecodeLocation_Location is not Public - BytecodeSource *gobpfd.BytecodeLocation + BytecodeSource *gobpfman.BytecodeLocation BytecodeSrc int } @@ -80,7 +80,7 @@ func ParseParamData(progType ProgType, configFilePath string, bytecodeFile strin flag.StringVar(¶mData.Iface, "iface", "", "Interface to load bytecode. Required.") flag.IntVar(¶mData.Priority, "priority", 50, - "Priority to load program in bpfd. Optional.") + "Priority to load program in bpfman. Optional.") } flag.UintVar(¶mData.ProgId, "id", UnusedProgramId, "Optional Program ID of bytecode that has already been loaded. \"id\" and\n"+ @@ -89,10 +89,10 @@ func ParseParamData(progType ProgType, configFilePath string, bytecodeFile strin flag.StringVar(&cmdlineImage, "image", "", "Image repository URL of bytecode source. \"image\" and \"file\"/\"id\" are\n"+ "mutually exclusive.\n"+ - "Example: -image quay.io/bpfd-bytecode/go-"+progType.String()+"-counter:latest") + "Example: -image quay.io/bpfman-bytecode/go-"+progType.String()+"-counter:latest") flag.StringVar(&cmdlineFile, "file", "", "File path of bytecode source. \"file\" and \"image\"/\"id\" are mutually exclusive.\n"+ - "Example: -file /home/$USER/src/bpfd/examples/go-"+progType.String()+"-counter/bpf_bpfel.o") + "Example: -file /home/$USER/src/bpfman/examples/go-"+progType.String()+"-counter/bpf_bpfel.o") flag.BoolVar(¶mData.CrdFlag, "crd", false, "Flag to indicate all attributes should be pulled from the BpfProgram CRD.\n"+ "Used in Kubernetes deployments and is mutually exclusive with all other\n"+ @@ -144,27 +144,27 @@ func ParseParamData(progType ProgType, configFilePath string, bytecodeFile strin // "-id" and "-location" are mutually exclusive and "-id" takes precedence. // Parse Commandline first. - // "-id" is a ProgramID for the bytecode that has already loaded into bpfd. If not + // "-id" is a ProgramID for the bytecode that has already loaded into bpfman. If not // provided, check "-file" and "-image". // ./go-xdp-counter -iface eth0 -id 23415 if paramData.ProgId == UnusedProgramId { // "-path" is a file path for the bytecode source. If not provided, check toml file. - // ./go-xdp-counter -iface eth0 -path /var/bpfd/bytecode/bpf_bpfel.o + // ./go-xdp-counter -iface eth0 -path /var/bpfman/bytecode/bpf_bpfel.o if len(cmdlineFile) != 0 { // "-location" was entered so it is a URL - paramData.BytecodeSource = &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: cmdlineFile}, + paramData.BytecodeSource = &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: cmdlineFile}, } paramData.BytecodeSrc = SrcFile source = cmdlineFile } // "-image" is a container registry url for the bytecode source. If not provided, check toml file. - // ./go-xdp-counter -p eth0 -image quay.io/bpfd-bytecode/go-xdp-counter:latest + // ./go-xdp-counter -p eth0 -image quay.io/bpfman-bytecode/go-xdp-counter:latest if len(cmdlineImage) != 0 { // "-location" was entered so it is a URL - paramData.BytecodeSource = &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_Image{Image: &gobpfd.BytecodeImage{ + paramData.BytecodeSource = &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_Image{Image: &gobpfman.BytecodeImage{ Url: cmdlineImage, }}, } @@ -189,8 +189,8 @@ func ParseParamData(progType ProgType, configFilePath string, bytecodeFile strin return paramData, fmt.Errorf("couldn't find bpf elf file: %v", err) } - paramData.BytecodeSource = &gobpfd.BytecodeLocation{ - Location: &gobpfd.BytecodeLocation_File{File: path}, + paramData.BytecodeSource = &gobpfman.BytecodeLocation{ + Location: &gobpfman.BytecodeLocation_File{File: path}, } paramData.BytecodeSrc = SrcFile source = path @@ -207,13 +207,13 @@ func ParseParamData(progType ProgType, configFilePath string, bytecodeFile strin return paramData, nil } -func RetrieveMapPinPath(ctx context.Context, c gobpfd.BpfdClient, progId uint, map_name string) (string, error) { +func RetrieveMapPinPath(ctx context.Context, c gobpfman.BpfmanClient, progId uint, map_name string) (string, error) { var mapPath string - getRequest := &gobpfd.GetRequest{ + getRequest := &gobpfman.GetRequest{ Id: uint32(progId), } - //var getResponse *gobpfd.GetResponse + //var getResponse *gobpfman.GetResponse getResponse, err := c.Get(ctx, getRequest) if err != nil { return mapPath, err @@ -221,7 +221,7 @@ func RetrieveMapPinPath(ctx context.Context, c gobpfd.BpfdClient, progId uint, m return CalcMapPinPath(getResponse.GetInfo(), map_name) } -func CalcMapPinPath(programInfo *gobpfd.ProgramInfo, map_name string) (string, error) { +func CalcMapPinPath(programInfo *gobpfman.ProgramInfo, map_name string) (string, error) { if programInfo != nil { return fmt.Sprintf("%s/%s", programInfo.GetMapPinPath(), map_name), nil } else { diff --git a/go.mod b/go.mod index 20ecf9a3d..6b4fa080b 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/bpfd-dev/bpfd +module github.com/bpfman/bpfman go 1.19 diff --git a/mkdocs.yml b/mkdocs.yml index 3fabca1a0..1f256e988 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ -site_name: bpfd -repo_url: https://github.com/bpfd-dev/bpfd +site_name: bpfman +repo_url: https://github.com/bpfman/bpfman edit_uri: edit/main/docs extra_css: - stylesheets/extra.css @@ -8,7 +8,7 @@ site_dir: site theme: name: material language: en - logo: img/bpfd_icon.svg + logo: img/bpfman_icon.svg favicon: img/favicon.ico palette: - media: "(prefers-color-scheme: light)" @@ -50,9 +50,9 @@ markdown_extensions: nav: - Introduction: index.md - Getting Started: - - Setup and Building: getting-started/building-bpfd.md - - Run bpfd From Release Image: getting-started/running-release.md - - Bpfd on Linux Tutorial: getting-started/tutorial.md + - Setup and Building: getting-started/building-bpfman.md + - Run bpfman From Release Image: getting-started/running-release.md + - Bpfman on Linux Tutorial: getting-started/tutorial.md - bpfctl Guide: getting-started/bpfctl-guide.md - Example eBPF Programs: getting-started/example-bpf.md - Deploying Example eBPF Programs On Local Host: getting-started/example-bpf-local.md @@ -60,11 +60,11 @@ nav: - Developer Guide: - Contributing: governance/CONTRIBUTING.md - Reviewing Guide: governance/REVIEWING.md - - Deploying the bpfd-operator: developer-guide/operator-quick-start.md - - Developing the bpfd-operator: developer-guide/develop-operator.md + - Deploying the bpfman-operator: developer-guide/operator-quick-start.md + - Developing the bpfman-operator: developer-guide/develop-operator.md - Kubernetes CRD API-Reference: developer-guide/api-spec.md - eBPF Bytecode Image Specifications: developer-guide/shipping-bytecode.md - - bpfd Container Images: developer-guide/image-build.md + - bpfman Container Images: developer-guide/image-build.md - Documentation: developer-guide/documentation.md - Linux Capabilities: developer-guide/linux-capabilities.md - Logging: developer-guide/logging.md @@ -91,4 +91,4 @@ plugins: post_excerpt_max_authors: 2 - search -copyright: Copyright © 2021-2023 The bpfd contributors +copyright: Copyright © 2021-2023 The bpfman contributors diff --git a/packaging/container-deployment/Containerfile.bpfctl b/packaging/container-deployment/Containerfile.bpfctl index ef949bdfc..e02365681 100644 --- a/packaging/container-deployment/Containerfile.bpfctl +++ b/packaging/container-deployment/Containerfile.bpfctl @@ -2,8 +2,8 @@ FROM rust:1 as bpfctl-build RUN apt-get update && apt-get install -y protobuf-compiler musl-tools -WORKDIR /usr/src/bpfd -COPY ./ /usr/src/bpfd +WORKDIR /usr/src/bpfman +COPY ./ /usr/src/bpfman RUN rustup target add x86_64-unknown-linux-musl @@ -12,6 +12,6 @@ RUN cargo build -p bpfctl --release --target x86_64-unknown-linux-musl FROM scratch -COPY --from=bpfctl-build /usr/src/bpfd/target/x86_64-unknown-linux-musl/release/bpfctl . +COPY --from=bpfctl-build /usr/src/bpfman/target/x86_64-unknown-linux-musl/release/bpfctl . ENTRYPOINT ["./bpfctl"] diff --git a/packaging/container-deployment/Containerfile.bpfctl.local b/packaging/container-deployment/Containerfile.bpfctl.local index 33889e97e..e620d8d62 100644 --- a/packaging/container-deployment/Containerfile.bpfctl.local +++ b/packaging/container-deployment/Containerfile.bpfctl.local @@ -4,21 +4,21 @@ FROM rust:1 as bpfctl-build RUN apt-get update && apt-get install -y protobuf-compiler musl-tools -WORKDIR /usr/src/bpfd -COPY ./ /usr/src/bpfd +WORKDIR /usr/src/bpfman +COPY ./ /usr/src/bpfman RUN rustup target add x86_64-unknown-linux-musl # Compile only bpfctl -RUN --mount=type=cache,target=/usr/src/bpfd/target/ \ +RUN --mount=type=cache,target=/usr/src/bpfman/target/ \ --mount=type=cache,target=/usr/local/cargo/registry \ cargo build -p bpfctl --release --target x86_64-unknown-linux-musl -RUN --mount=type=cache,target=/usr/src/bpfd/target/ \ - cp /usr/src/bpfd/target/x86_64-unknown-linux-musl/release/bpfctl ./bpfd/ +RUN --mount=type=cache,target=/usr/src/bpfman/target/ \ + cp /usr/src/bpfman/target/x86_64-unknown-linux-musl/release/bpfctl ./bpfman/ FROM scratch -COPY --from=bpfctl-build /usr/src/bpfd/bpfctl . +COPY --from=bpfctl-build /usr/src/bpfman/bpfctl . ENTRYPOINT ["./bpfctl"] diff --git a/packaging/container-deployment/Containerfile.bpfd b/packaging/container-deployment/Containerfile.bpfd deleted file mode 100644 index 8aad090e5..000000000 --- a/packaging/container-deployment/Containerfile.bpfd +++ /dev/null @@ -1,27 +0,0 @@ -FROM rust:1 as bpfd-build - -RUN git clone https://github.com/libbpf/libbpf --branch v0.8.0 /usr/src/bpfd/libbpf - -RUN apt-get update && apt-get install -y\ - git\ - clang\ - protobuf-compiler\ - libelf-dev\ - gcc-multilib\ - musl-tools - -WORKDIR /usr/src/bpfd -COPY ./ /usr/src/bpfd - -RUN rustup target add x86_64-unknown-linux-musl - -# Compile only the C ebpf bytecode -RUN cargo xtask build-ebpf --release --libbpf-dir /usr/src/bpfd/libbpf -# Compile only bpfd -RUN cargo build --release -p bpfd --target x86_64-unknown-linux-musl - -FROM scratch - -COPY --from=bpfd-build /usr/src/bpfd/target/x86_64-unknown-linux-musl/release/bpfd . - -ENTRYPOINT ["./bpfd"] diff --git a/packaging/container-deployment/Containerfile.bpfman b/packaging/container-deployment/Containerfile.bpfman new file mode 100644 index 000000000..2a10b5d40 --- /dev/null +++ b/packaging/container-deployment/Containerfile.bpfman @@ -0,0 +1,27 @@ +FROM rust:1 as bpfman-build + +RUN git clone https://github.com/libbpf/libbpf --branch v0.8.0 /usr/src/bpfman/libbpf + +RUN apt-get update && apt-get install -y\ + git\ + clang\ + protobuf-compiler\ + libelf-dev\ + gcc-multilib\ + musl-tools + +WORKDIR /usr/src/bpfman +COPY ./ /usr/src/bpfman + +RUN rustup target add x86_64-unknown-linux-musl + +# Compile only the C ebpf bytecode +RUN cargo xtask build-ebpf --release --libbpf-dir /usr/src/bpfman/libbpf +# Compile only bpfman +RUN cargo build --release -p bpfman --target x86_64-unknown-linux-musl + +FROM scratch + +COPY --from=bpfman-build /usr/src/bpfman/target/x86_64-unknown-linux-musl/release/bpfman . + +ENTRYPOINT ["./bpfman"] diff --git a/packaging/container-deployment/Containerfile.bpfd.local b/packaging/container-deployment/Containerfile.bpfman.local similarity index 52% rename from packaging/container-deployment/Containerfile.bpfd.local rename to packaging/container-deployment/Containerfile.bpfman.local index 1d657c2de..5d5ca9530 100644 --- a/packaging/container-deployment/Containerfile.bpfd.local +++ b/packaging/container-deployment/Containerfile.bpfman.local @@ -1,8 +1,8 @@ ## This Containerfile makes use of docker's Buildkit to cache crates between ## builds, dramatically speeding up the local development process. -FROM rust:1 as bpfd-build +FROM rust:1 as bpfman-build -RUN git clone https://github.com/libbpf/libbpf --branch v0.8.0 /usr/src/bpfd/libbpf +RUN git clone https://github.com/libbpf/libbpf --branch v0.8.0 /usr/src/bpfman/libbpf RUN apt-get update && apt-get install -y\ git\ @@ -12,26 +12,26 @@ RUN apt-get update && apt-get install -y\ gcc-multilib\ musl-tools -WORKDIR /usr/src/bpfd -COPY ./ /usr/src/bpfd +WORKDIR /usr/src/bpfman +COPY ./ /usr/src/bpfman RUN rustup target add x86_64-unknown-linux-musl # Compile only the C ebpf bytecode -RUN --mount=type=cache,target=/usr/src/bpfd/target/ \ +RUN --mount=type=cache,target=/usr/src/bpfman/target/ \ --mount=type=cache,target=/usr/local/cargo/registry \ - cargo xtask build-ebpf --release --libbpf-dir /usr/src/bpfd/libbpf + cargo xtask build-ebpf --release --libbpf-dir /usr/src/bpfman/libbpf -# Compile only bpfd -RUN --mount=type=cache,target=/usr/src/bpfd/target/ \ +# Compile only bpfman +RUN --mount=type=cache,target=/usr/src/bpfman/target/ \ --mount=type=cache,target=/usr/local/cargo/registry \ cargo build --release --target x86_64-unknown-linux-musl -RUN --mount=type=cache,target=/usr/src/bpfd/target/ \ - cp /usr/src/bpfd/target/x86_64-unknown-linux-musl/release/bpfd ./bpfd/ +RUN --mount=type=cache,target=/usr/src/bpfman/target/ \ + cp /usr/src/bpfman/target/x86_64-unknown-linux-musl/release/bpfman ./bpfman/ -RUN --mount=type=cache,target=/usr/src/bpfd/target/ \ - cp /usr/src/bpfd/target/x86_64-unknown-linux-musl/release/bpfctl ./bpfctl/ +RUN --mount=type=cache,target=/usr/src/bpfman/target/ \ + cp /usr/src/bpfman/target/x86_64-unknown-linux-musl/release/bpfctl ./bpfctl/ ## Image for Local testing is much more of a debug image, give it bpftool, tcpdump ## and bpfctl. @@ -39,7 +39,7 @@ FROM fedora:36 RUN dnf makecache --refresh && dnf -y install bpftool tcpdump -COPY --from=bpfd-build ./usr/src/bpfd/bpfd . -COPY --from=bpfd-build ./usr/src/bpfd/bpfctl . +COPY --from=bpfman-build ./usr/src/bpfman/bpfman . +COPY --from=bpfman-build ./usr/src/bpfman/bpfctl . -ENTRYPOINT ["./bpfd"] +ENTRYPOINT ["./bpfman"] diff --git a/packaging/rust-bpfd.spec b/packaging/rust-bpfman.spec similarity index 91% rename from packaging/rust-bpfd.spec rename to packaging/rust-bpfman.spec index f907a22d1..4c6e7c25d 100644 --- a/packaging/rust-bpfd.spec +++ b/packaging/rust-bpfman.spec @@ -1,7 +1,7 @@ # Generated by rust2rpm 20 %bcond_without check -%global crate bpfd +%global crate bpfman Name: rust-%{crate} Version: 0.1.0 @@ -11,7 +11,7 @@ Summary: # FIXME # Upstream license specification: None License: # FIXME -URL: https://crates.io/crates/bpfd +URL: https://crates.io/crates/bpfman Source: %{crates_source} ExclusiveArch: %{rust_arches} @@ -32,7 +32,7 @@ Summary: %{summary} %license LICENSE-APACHE LICENSE-GPL2 LICENSE-MIT libbpf/LICENSE libbpf/LICENSE.BSD-2-Clause libbpf/LICENSE.LGPL-2.1 %doc README.md %{_bindir}/bpfctl -%{_bindir}/bpfd +%{_bindir}/bpfman %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 diff --git a/packaging/vm-deployment/README.md b/packaging/vm-deployment/README.md index d669e692c..843f676a3 100644 --- a/packaging/vm-deployment/README.md +++ b/packaging/vm-deployment/README.md @@ -1,6 +1,6 @@ # Developer VM Provisioning -As a developer, if you would like to deploy a VM with BPFD running this will spin up the latest Fedora release with BPFD installed and running. +As a developer, if you would like to deploy a VM with BPFMAN running this will spin up the latest Fedora release with BPFMAN installed and running. ### Pre-requisite @@ -10,12 +10,12 @@ As a developer, if you would like to deploy a VM with BPFD running this will spi ### Deploy the VM -Once the dependencies are installed, simply clone bpfd and run the following commands: +Once the dependencies are installed, simply clone bpfman and run the following commands: ```console -# Clone the bpfd repo: -$ git clone https://github.com/bpfd-dev/bpfd.git -$ cd bpfd/packaging/vm-deployment/ +# Clone the bpfman repo: +$ git clone https://github.com/bpfman/bpfman.git +$ cd bpfman/packaging/vm-deployment/ # Start the vagrant deployment $ vagrant up @@ -23,7 +23,7 @@ $ vagrant up # Once the installation is complete, ssh to the VM $ vagrant ssh -# View the status of bpfd and run bpfctl -$ sudo systemctl status bpfd +# View the status of bpfman and run bpfctl +$ sudo systemctl status bpfman $ sudo bpfctl --help ``` diff --git a/packaging/vm-deployment/provision.yaml b/packaging/vm-deployment/provision.yaml index c4448f8db..a84f426c9 100644 --- a/packaging/vm-deployment/provision.yaml +++ b/packaging/vm-deployment/provision.yaml @@ -8,22 +8,22 @@ set_fact: vagrant_user: "vagrant" - - name: Make directories for bpfd binaries and scripts + - name: Make directories for bpfman binaries and scripts shell: | - mkdir -p /home/{{ vagrant_user }}/bpfd/target/debug/ + mkdir -p /home/{{ vagrant_user }}/bpfman/target/debug/ - name: Copy bpfctl binary to the remote host ansible.builtin.copy: src: ../../target/debug/bpfctl - dest: /home/{{ vagrant_user }}/bpfd/target/debug/ + dest: /home/{{ vagrant_user }}/bpfman/target/debug/ owner: "{{ vagrant_user }}" group: "{{ vagrant_user }}" mode: "0755" - - name: Copy bpfd binary to the remote host + - name: Copy bpfman binary to the remote host ansible.builtin.copy: - src: ../../target/debug/bpfd - dest: /home/{{ vagrant_user }}/bpfd/target/debug/ + src: ../../target/debug/bpfman + dest: /home/{{ vagrant_user }}/bpfman/target/debug/ owner: "{{ vagrant_user }}" group: "{{ vagrant_user }}" mode: "0755" @@ -31,7 +31,7 @@ - name: Copy the scripts directory to the remote host ansible.builtin.copy: src: ../../scripts/ - dest: /home/{{ vagrant_user }}/bpfd/scripts/ + dest: /home/{{ vagrant_user }}/bpfman/scripts/ owner: "{{ vagrant_user }}" group: "{{ vagrant_user }}" @@ -47,10 +47,10 @@ package: name: ["openssl", "acl"] - - name: Change the working directory to bpfd/scripts and run + - name: Change the working directory to bpfman/scripts and run become: true shell: | chmod +x ./scripts/*.sh ./scripts/setup.sh install args: - chdir: /home/{{ vagrant_user }}/bpfd + chdir: /home/{{ vagrant_user }}/bpfman diff --git a/proto/bpfd.proto b/proto/bpfman.proto similarity index 88% rename from proto/bpfd.proto rename to proto/bpfman.proto index 8c82c2443..3f17f6fdb 100644 --- a/proto/bpfd.proto +++ b/proto/bpfman.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package bpfd.v1; -option go_package = "github.com/bpfd-dev/clients/gobpfd/v1;v1"; +package bpfman.v1; +option go_package = "github.com/bpfman/clients/gobpfman/v1;v1"; -service Bpfd { +service Bpfman { rpc Load (LoadRequest) returns (LoadResponse); rpc Unload (UnloadRequest) returns (UnloadResponse); rpc List (ListRequest) returns (ListResponse); @@ -56,7 +56,7 @@ message KernelProgramInfo { } /* ProgramInfo represents the state for a single eBPF program that is maintained - * internally by bpfd. */ + * internally by bpfman. */ message ProgramInfo { /* Name entered by user */ @@ -70,7 +70,7 @@ message ProgramInfo { map metadata = 8; } -/* XDPAttachInfo represents the program specific metadata which bpfd needs to +/* XDPAttachInfo represents the program specific metadata which bpfman needs to * attach and observe a XDP program on a given network interface. */ @@ -81,7 +81,7 @@ message XDPAttachInfo { repeated int32 proceed_on = 4; } -/* TCAttachInfo represents the program specific metadata which bpfd needs to +/* TCAttachInfo represents the program specific metadata which bpfman needs to * attach and observe a TC program on a given network interface. */ @@ -93,7 +93,7 @@ message TCAttachInfo { repeated int32 proceed_on = 5; } -/* TracepointAttachInfo represents the program specific metadata which bpfd +/* TracepointAttachInfo represents the program specific metadata which bpfman * needs to attach and observe a Tracepoint program for a given kernel * tracepoint. */ @@ -102,7 +102,7 @@ message TCAttachInfo { string tracepoint = 1; } -/* KprobeAttachInfo represents the program specific metadata which bpfd +/* KprobeAttachInfo represents the program specific metadata which bpfman * needs to attach and observe a Kprobe program for a given kernel probe. */ @@ -113,7 +113,7 @@ message KprobeAttachInfo { optional string namespace = 4; } -/* UprobeAttachInfo represents the program specific metadata which bpfd +/* UprobeAttachInfo represents the program specific metadata which bpfman * needs to attach and observe a Uprobe program for a given user-space probe. */ @@ -154,7 +154,7 @@ message LoadRequest { }; /* LoadResponse represents a response from loading and attaching an eBPF program. - * It includes all of the state kept by bpfd and the Linux kernel for the + * It includes all of the state kept by bpfman and the Linux kernel for the * program. */ @@ -164,7 +164,7 @@ message LoadRequest { } /* UnloadRequest represents a request to unload an eBPF program that was loaded - * and attached by bpfd. To identify a program pass in a valid kernel ID. + * and attached by bpfman. To identify a program pass in a valid kernel ID. */ message UnloadRequest { @@ -174,21 +174,21 @@ message UnloadRequest { message UnloadResponse {} /* ListRequest represents a request to get information regarding eBPF programs - * that are loaded and attached by bpfd AND/OR programs that are loaded by other + * that are loaded and attached by bpfman AND/OR programs that are loaded by other * users. */ message ListRequest { optional uint32 program_type = 1; - optional bool bpfd_programs_only = 2; + optional bool bpfman_programs_only = 2; map match_metadata = 3; } /* ListResponse represents a response from listing loaded and attached * eBPF programs. Based on the corresponding ListRequest programs will include - * those loaded by bpfd AND/OR those loaded by other users. The ListResults - * will ALWAYS contain a program's kernel info and if loaded by bpfd, will - * also contain the state kept by bpfd. + * those loaded by bpfman AND/OR those loaded by other users. The ListResults + * will ALWAYS contain a program's kernel info and if loaded by bpfman, will + * also contain the state kept by bpfman. */ message ListResponse { @@ -210,7 +210,7 @@ message PullBytecodeRequest { message PullBytecodeResponse {} /* GetRequest represents a request to get information regarding a single - * eBPF program that is loaded and attached by bpfd AND/OR that is loaded by + * eBPF program that is loaded and attached by bpfman AND/OR that is loaded by * another user. To identify a program pass in a valid kernel ID. */ message GetRequest { @@ -218,8 +218,8 @@ message GetRequest { } /* GetResponse represents a response from getting an eBPF program. - * It will ALWAYS contain a program's kernel info and if loaded by bpfd, will - * contain the state kept by bpfd. */ + * It will ALWAYS contain a program's kernel info and if loaded by bpfman, will + * contain the state kept by bpfman. */ message GetResponse { optional ProgramInfo info = 1; diff --git a/release.toml b/release.toml index bed62bbb1..da8b334f0 100644 --- a/release.toml +++ b/release.toml @@ -2,6 +2,6 @@ consolidate-commits = true consolidate-pushes = true dev-version = true dev-version-ext = "dev" -post-release-commit-message = "bpfd, bpfd-common: start next development iteration {{next_version}}" -pre-release-commit-message = "bpfd, bpfd-common: release version {{version}}" +post-release-commit-message = "bpfman, bpfman-common: start next development iteration {{next_version}}" +pre-release-commit-message = "bpfman, bpfman-common: release version {{version}}" shared-version = true diff --git a/requirements.txt b/requirements.txt index 46e20b783..e606c3897 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,22 +1,40 @@ +Babel==2.13.1 +beautifulsoup4==4.12.2 +certifi==2023.11.17 +charset-normalizer==3.3.2 click==8.1.3 +colorama==0.4.6 +cssselect==1.2.0 ghp-import==2.1.0 +idna==3.4 importlib-metadata==4.11.4 Jinja2==3.1.2 +lxml==4.9.3 Markdown==3.3.7 +markdown2==2.4.10 MarkupSafe==2.1.1 mergedeep==1.3.4 mike==1.1.2 -mkdocs==1.5.2 -mkdocs-material==9.2.0b3 -mkdocs-material-extensions==1.1.1 +mkdocs==1.5.3 +mkdocs-material==9.4.11 +mkdocs-material-extensions==1.3.1 packaging==21.3 -Pygments==2.14.0 -pymdown-extensions==9.9.1 +paginate==0.5.6 +pathspec==0.11.2 +platformdirs==4.0.0 +Pygments==2.17.2 +pymdown-extensions==10.4 pyparsing==3.0.9 +pyquery==2.0.0 python-dateutil==2.8.2 PyYAML==6.0 pyyaml_env_tag==0.1 +readtime==3.0.0 +regex==2023.10.3 +requests==2.31.0 six==1.16.0 +soupsieve==2.5 +urllib3==2.1.0 verspec==0.1.0 watchdog==2.1.9 zipp==3.8.0 diff --git a/scripts/bpfd.service b/scripts/bpfman.service similarity index 82% rename from scripts/bpfd.service rename to scripts/bpfman.service index 846b4c449..c998172d3 100644 --- a/scripts/bpfd.service +++ b/scripts/bpfman.service @@ -1,10 +1,10 @@ [Unit] -Description=Run bpfd as a service +Description=Run bpfman as a service DefaultDependencies=no After=network.target [Service] Environment="RUST_LOG=Info" -ExecStart=/usr/sbin/bpfd +ExecStart=/usr/sbin/bpfman AmbientCapabilities=CAP_BPF CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_SETPCAP CAP_SYS_ADMIN CAP_SYS_RESOURCE CapabilityBoundingSet=CAP_BPF CAP_DAC_READ_SEARCH CAP_NET_ADMIN CAP_SETPCAP CAP_SYS_ADMIN CAP_SYS_RESOURCE diff --git a/scripts/bpfd.toml b/scripts/bpfman.toml similarity index 87% rename from scripts/bpfd.toml rename to scripts/bpfman.toml index 7ba1d122f..f7b3eb7c0 100644 --- a/scripts/bpfd.toml +++ b/scripts/bpfman.toml @@ -10,5 +10,5 @@ type = "tcp" [[grpc.endpoints]] enabled = false -path = "/run/bpfd/bpfd.sock" +path = "/run/bpfman/bpfman.sock" type = "unix" diff --git a/scripts/certificates.sh b/scripts/certificates.sh index 544ef7c40..4fb8e9d4d 100755 --- a/scripts/certificates.sh +++ b/scripts/certificates.sh @@ -18,15 +18,15 @@ cert_init() { mkdir -p "${CFG_CA_CERT_DIR}" if [ ! -f "${CFG_CA_CERT_DIR}"/ca.pem ] || [ "${regen}" == true ]; then openssl genrsa -out "${CFG_CA_CERT_DIR}"/ca.key ${KEY_LEN} - openssl req -new -x509 -key "${CFG_CA_CERT_DIR}"/ca.key -subj "/CN=bpfd-ca/" -out "${CFG_CA_CERT_DIR}"/ca.pem - # Set the private key such that only members of the "bpfd" group can read + openssl req -new -x509 -key "${CFG_CA_CERT_DIR}"/ca.key -subj "/CN=bpfman-ca/" -out "${CFG_CA_CERT_DIR}"/ca.pem + # Set the private key such that only members of the "bpfman" group can read chmod -v 0440 "${CFG_CA_CERT_DIR}"/ca.key # Set the public key such that any user can read chmod -v 0444 "${CFG_CA_CERT_DIR}"/ca.pem fi - cert_client "${BIN_BPFD}" ${regen} - cert_client "${BIN_BPFD_CLIENT}" ${regen} + cert_client "${BIN_BPFMAN}" ${regen} + cert_client "${BIN_BPFMAN_CLIENT}" ${regen} } cert_client() { diff --git a/scripts/del-bpfd-qdiscs.sh b/scripts/del-bpfman-qdiscs.sh similarity index 88% rename from scripts/del-bpfd-qdiscs.sh rename to scripts/del-bpfman-qdiscs.sh index 14327eef9..115f4c1d4 100755 --- a/scripts/del-bpfd-qdiscs.sh +++ b/scripts/del-bpfman-qdiscs.sh @@ -2,7 +2,7 @@ # This script deletes the clsact and ingress qdiscs (if they exist) on all # interfaces. This has the side-effect of removing any tc_dispatchers (or other # programs) that happen to be attached to them. This is intended to be part of -# completely cleaning up the bpfd state on a system. Caution should be used if +# completely cleaning up the bpfman state on a system. Caution should be used if # other applications are currently using these qdiscs for other purposes. interfaces=() diff --git a/scripts/install.sh b/scripts/install.sh index e3fa9c176..ff71641af 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -71,9 +71,9 @@ install() { if [ -z "${reinstall}" ]; then reinstall=false fi - start_bpfd=$2 - if [ -z "${start_bpfd}" ]; then - start_bpfd=false + start_bpfman=$2 + if [ -z "${start_bpfman}" ]; then + start_bpfman=false fi release=$3 if [ -z "${release}" ]; then @@ -83,36 +83,36 @@ install() { echo "Copy binaries:" if [ "${reinstall}" == true ]; then - systemctl status bpfd | grep "Active:" | grep running &>/dev/null + systemctl status bpfman | grep "Active:" | grep running &>/dev/null if [ $? -eq 0 ]; then - echo " Stopping \"${BIN_BPFD}.service\"" - systemctl stop ${BIN_BPFD}.service - start_bpfd=true + echo " Stopping \"${BIN_BPFMAN}.service\"" + systemctl stop ${BIN_BPFMAN}.service + start_bpfman=true fi fi - copy_bin "${BIN_BPFD}" ${release} + copy_bin "${BIN_BPFMAN}" ${release} copy_bin "${BIN_BPFCTL}" ${release} if [ "${reinstall}" == false ]; then echo "Copy service file:" - copy_svc "${BIN_BPFD}" + copy_svc "${BIN_BPFMAN}" systemctl daemon-reload fi - if [ "${start_bpfd}" == true ]; then - echo " Starting \"${BIN_BPFD}.service\"" - systemctl start ${BIN_BPFD}.service + if [ "${start_bpfman}" == true ]; then + echo " Starting \"${BIN_BPFMAN}.service\"" + systemctl start ${BIN_BPFMAN}.service fi } uninstall() { echo "Remove service file:" - del_svc "${BIN_BPFD}" + del_svc "${BIN_BPFMAN}" echo "Remove binaries:" del_bin "${BIN_BPFCTL}" - del_bin "${BIN_BPFD}" + del_bin "${BIN_BPFMAN}" del_kubectl_plugin } diff --git a/scripts/make-docs.sh b/scripts/make-docs.sh index de3b645c7..159a59e4c 100755 --- a/scripts/make-docs.sh +++ b/scripts/make-docs.sh @@ -33,7 +33,7 @@ esac # Generate docs with mkdocs mkdocs build -d site # Generate v1alpha2 API docs -./bpfd-operator/hack/api-docs/generate.sh site/api-spec.html +./bpfman-operator/hack/api-docs/generate.sh site/api-spec.html # Add them to spec page originally generated by mkdocs run::sed -e '/REPLACE_WITH_GENERATED_CONTENT/{r site/api-spec.html' -e 'd;}' site/developer-guide/api-spec/index.html run::sed -e '/REPLACE_WITH_GENERATED_CONTENT/{r site/api-spec.html' -e 'd;}' site/developer-guide/api-spec/index.html diff --git a/scripts/setup.sh b/scripts/setup.sh index 12d47661d..64b5e4116 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -10,9 +10,9 @@ fi . install.sh . user.sh -BIN_BPFD="bpfd" +BIN_BPFMAN="bpfman" BIN_BPFCTL="bpfctl" -BIN_BPFD_CLIENT="bpfd-client" +BIN_BPFMAN_CLIENT="bpfman-client" # Well known directories SRC_DEBUG_BIN_PATH="../target/debug" @@ -20,38 +20,38 @@ SRC_RELEASE_BIN_PATH="../target/x86_64-unknown-linux-musl/release" DST_BIN_PATH="/usr/sbin" DST_SVC_PATH="/usr/lib/systemd/system" -# ConfigurationDirectory: /etc/bpfd/ -CONFIGURATION_DIR="/etc/bpfd" -CFG_CA_CERT_DIR="/etc/bpfd/certs/ca" +# ConfigurationDirectory: /etc/bpfman/ +CONFIGURATION_DIR="/etc/bpfman" +CFG_CA_CERT_DIR="/etc/bpfman/certs/ca" -# RuntimeDirectory: /run/bpfd/ -RUNTIME_DIR="/run/bpfd" -RTDIR_FS="/run/bpfd/fs" +# RuntimeDirectory: /run/bpfman/ +RUNTIME_DIR="/run/bpfman" +RTDIR_FS="/run/bpfman/fs" -# StateDirectory: /var/lib/bpfd/ -STATE_DIR="/var/lib/bpfd" +# StateDirectory: /var/lib/bpfman/ +STATE_DIR="/var/lib/bpfman" usage() { echo "USAGE:" echo "sudo ./scripts/setup.sh install [--release]" - echo " Prepare system for running \"bpfd\" as a systemd service. Performs the" + echo " Prepare system for running \"bpfman\" as a systemd service. Performs the" echo " following tasks:" - echo " * Copy \"bpfd\" and \"bpfctl\" binaries to \"/usr/sbin/.\"." - echo " * Copy \"bpfd.service\" to \"/usr/lib/systemd/system/\"." - echo " * Run \"systemctl start bpfd.service\" to start the sevice." + echo " * Copy \"bpfman\" and \"bpfctl\" binaries to \"/usr/sbin/.\"." + echo " * Copy \"bpfman.service\" to \"/usr/lib/systemd/system/\"." + echo " * Run \"systemctl start bpfman.service\" to start the sevice." echo "sudo ./scripts/setup.sh setup [--release]" echo " Same as \"install\" above, but don't start the service." echo "sudo ./scripts/setup.sh reinstall [--release]" - echo " Only copy the \"bpfd\" and \"bpfctl\" binaries to \"/usr/sbin/.\"" - echo " \"bpfd\" service will be restarted if it was running." + echo " Only copy the \"bpfman\" and \"bpfctl\" binaries to \"/usr/sbin/.\"" + echo " \"bpfman\" service will be restarted if it was running." echo "sudo ./scripts/setup.sh uninstall" echo " Unwind all actions performed by \"setup.sh install\" including stopping" - echo " the \"bpfd\" service if it is running." + echo " the \"bpfman\" service if it is running." echo "sudo ./scripts/setup.sh kubectl" echo " Install kubectl plugins for \"bpfprogramconfigs\" and \"bpfprograms\"." echo "sudo ./scripts/setup.sh examples" - echo " Copy examples bytecode files to a bpfd owned directory (${RTDIR_EXAMPLES})." + echo " Copy examples bytecode files to a bpfman owned directory (${RTDIR_EXAMPLES})." echo " This assumes bytecode has already been built. \"setup.sh install\" does" echo " this as well, so this is to overwrite after a rebuild." } @@ -64,31 +64,31 @@ fi case "$1" in "install") reinstall=false - start_bpfd=true + start_bpfman=true release=false if [ "$2" == "--release" ] || [ "$2" == "release" ] ; then release=true fi - install ${reinstall} ${start_bpfd} ${release} + install ${reinstall} ${start_bpfman} ${release} ;; "setup") reinstall=false - start_bpfd=false + start_bpfman=false release=false if [ "$2" == "--release" ] || [ "$2" == "release" ] ; then release=true fi - install ${reinstall} ${start_bpfd} ${release} + install ${reinstall} ${start_bpfman} ${release} ;; "reinstall") reinstall=true - # With reinstall true, start_bpfd will be set in function if bpfd is already running or not. - start_bpfd=false + # With reinstall true, start_bpfman will be set in function if bpfman is already running or not. + start_bpfman=false release=false if [ "$2" == "--release" ] || [ "$2" == "release" ] ; then release=true fi - install ${reinstall} ${start_bpfd} ${release} + install ${reinstall} ${start_bpfman} ${release} ;; "uninstall") uninstall diff --git a/scripts/user.sh b/scripts/user.sh index 2cc411d78..f9a8b5719 100755 --- a/scripts/user.sh +++ b/scripts/user.sh @@ -2,7 +2,7 @@ delete_directories() { # Remove directories - echo "Deleting \"bpfd\" specific directories" + echo "Deleting \"bpfman\" specific directories" echo " Deleting \"${CONFIGURATION_DIR}\"" rm -rf "${CONFIGURATION_DIR}" echo " Deleting \"${RUNTIME_DIR}\"" @@ -47,8 +47,8 @@ user_cleanup() { delete_directories # TO BE REMOVED! - # Left around to cleanup deprecated `bpfd` user and user group - USER_BPFD="bpfd" - USER_GROUP="bpfd" - delete_user "${USER_BPFD}" "${USER_GROUP}" + # Left around to cleanup deprecated `bpfman` user and user group + USER_BPFMAN="bpfman" + USER_GROUP="bpfman" + delete_user "${USER_BPFMAN}" "${USER_GROUP}" } diff --git a/scripts/verify-golint.sh b/scripts/verify-golint.sh index 7ca232eea..db6960148 100755 --- a/scripts/verify-golint.sh +++ b/scripts/verify-golint.sh @@ -15,8 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This script is used to manually run golangci-lint on the bpfd-operator code. -# In bpfd's github actions a dedicated action is used to run golangci-lint. It's +# This script is used to manually run golangci-lint on the bpfman-operator code. +# In bpfman's github actions a dedicated action is used to run golangci-lint. It's # important that the version here matches the version defined in `.github/workflows/build.yml`. set -o errexit set -o nounset @@ -30,9 +30,9 @@ cd "${KUBE_ROOT}" # See configuration file in ${KUBE_ROOT}/.golangci.yml. mkdir -p cache -docker run --rm -v $(pwd)/cache:/bpfd/cache -v $(pwd)/examples:/bpfd/examples -v $(pwd)/clients:/bpfd/clients \ - -v $(pwd)/bpfd-operator:/bpfd/bpfd-operator -v $(pwd)/go.mod:/bpfd/go.mod -v $(pwd)/go.sum:/bpfd/go.sum \ - -v $(pwd)/.golangci.yaml:/bpfd/.golangci.yaml --security-opt="label=disable" -e GOLANGCI_LINT_CACHE=/cache \ - -w /bpfd "golangci/golangci-lint:$VERSION" golangci-lint run -v --enable=gofmt,typecheck +docker run --rm -v $(pwd)/cache:/bpfman/cache -v $(pwd)/examples:/bpfman/examples -v $(pwd)/clients:/bpfman/clients \ + -v $(pwd)/bpfman-operator:/bpfman/bpfman-operator -v $(pwd)/go.mod:/bpfman/go.mod -v $(pwd)/go.sum:/bpfman/go.sum \ + -v $(pwd)/.golangci.yaml:/bpfman/.golangci.yaml --security-opt="label=disable" -e GOLANGCI_LINT_CACHE=/cache \ + -w /bpfman "golangci/golangci-lint:$VERSION" golangci-lint run -v --enable=gofmt,typecheck # ex: ts=2 sw=2 et filetype=sh diff --git a/tests/integration-test/Cargo.toml b/tests/integration-test/Cargo.toml index 8c465bdde..7c9e1cb33 100644 --- a/tests/integration-test/Cargo.toml +++ b/tests/integration-test/Cargo.toml @@ -7,7 +7,7 @@ version = "0.1.0" [dependencies] anyhow = { workspace = true, features = ["std"] } assert_cmd = { workspace = true } -bpfd-api = { workspace = true } +bpfman-api = { workspace = true } env_logger = { workspace = true } integration-test-macros = { workspace = true } inventory = { workspace = true } diff --git a/tests/integration-test/bpf/build_push_images.sh b/tests/integration-test/bpf/build_push_images.sh index 137dead41..25ae068d6 100755 --- a/tests/integration-test/bpf/build_push_images.sh +++ b/tests/integration-test/bpf/build_push_images.sh @@ -8,9 +8,9 @@ docker build \ --build-arg PROGRAM_TYPE=xdp \ --build-arg BYTECODE_FILENAME=xdp_pass.bpf.o \ -f ../../../packaging/container-deployment/Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/xdp_pass:latest + ./.output -t quay.io/bpfman-bytecode/xdp_pass:latest -docker push quay.io/bpfd-bytecode/xdp_pass +docker push quay.io/bpfman-bytecode/xdp_pass docker build \ --build-arg PROGRAM_NAME=xdp_pass_private \ @@ -18,9 +18,9 @@ docker build \ --build-arg PROGRAM_TYPE=xdp \ --build-arg BYTECODE_FILENAME=xdp_pass.bpf.o \ -f ../../../packaging/container-deployment/Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/xdp_pass_private:latest + ./.output -t quay.io/bpfman-bytecode/xdp_pass_private:latest -docker push quay.io/bpfd-bytecode/xdp_pass_private +docker push quay.io/bpfman-bytecode/xdp_pass_private docker build \ --build-arg PROGRAM_NAME=tc_pass \ @@ -28,9 +28,9 @@ docker build \ --build-arg PROGRAM_TYPE=tc \ --build-arg BYTECODE_FILENAME=tc_pass.bpf.o \ -f ../../../packaging/container-deployment/Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/tc_pass:latest + ./.output -t quay.io/bpfman-bytecode/tc_pass:latest -docker push quay.io/bpfd-bytecode/tc_pass +docker push quay.io/bpfman-bytecode/tc_pass docker build \ --build-arg PROGRAM_NAME=tracepoint \ @@ -38,9 +38,9 @@ docker build \ --build-arg PROGRAM_TYPE=tracepoint \ --build-arg BYTECODE_FILENAME=tp_openat.bpf.o \ -f ../../../packaging/container-deployment//Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/tracepoint:latest + ./.output -t quay.io/bpfman-bytecode/tracepoint:latest -docker push quay.io/bpfd-bytecode/tracepoint +docker push quay.io/bpfman-bytecode/tracepoint docker build \ --build-arg PROGRAM_NAME=uprobe \ @@ -48,9 +48,9 @@ docker build \ --build-arg PROGRAM_TYPE=kprobe \ --build-arg BYTECODE_FILENAME=uprobe.bpf.o \ -f ../../../packaging/container-deployment//Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/uprobe:latest + ./.output -t quay.io/bpfman-bytecode/uprobe:latest -docker push quay.io/bpfd-bytecode/uprobe +docker push quay.io/bpfman-bytecode/uprobe docker build \ --build-arg PROGRAM_NAME=uretprobe \ @@ -58,9 +58,9 @@ docker build \ --build-arg PROGRAM_TYPE=kprobe \ --build-arg BYTECODE_FILENAME=uprobe.bpf.o \ -f ../../../packaging/container-deployment//Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/uretprobe:latest + ./.output -t quay.io/bpfman-bytecode/uretprobe:latest -docker push quay.io/bpfd-bytecode/uretprobe +docker push quay.io/bpfman-bytecode/uretprobe docker build \ --build-arg PROGRAM_NAME=kprobe \ @@ -68,9 +68,9 @@ docker build \ --build-arg PROGRAM_TYPE=kprobe \ --build-arg BYTECODE_FILENAME=kprobe.bpf.o \ -f ../../../packaging/container-deployment//Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/kprobe:latest + ./.output -t quay.io/bpfman-bytecode/kprobe:latest -docker push quay.io/bpfd-bytecode/kprobe +docker push quay.io/bpfman-bytecode/kprobe docker build \ --build-arg PROGRAM_NAME=kretprobe \ @@ -78,8 +78,8 @@ docker build \ --build-arg PROGRAM_TYPE=kprobe \ --build-arg BYTECODE_FILENAME=kprobe.bpf.o \ -f ../../../packaging/container-deployment//Containerfile.bytecode \ - ./.output -t quay.io/bpfd-bytecode/kretprobe:latest + ./.output -t quay.io/bpfman-bytecode/kretprobe:latest -docker push quay.io/bpfd-bytecode/kretprobe +docker push quay.io/bpfman-bytecode/kretprobe diff --git a/tests/integration-test/bpf/kprobe.bpf.c b/tests/integration-test/bpf/kprobe.bpf.c index 702475e02..a6e7ead38 100644 --- a/tests/integration-test/bpf/kprobe.bpf.c +++ b/tests/integration-test/bpf/kprobe.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman // Some kprobe test code diff --git a/tests/integration-test/bpf/tc_pass.bpf.c b/tests/integration-test/bpf/tc_pass.bpf.c index 1fbcc20e8..eb183e4bb 100644 --- a/tests/integration-test/bpf/tc_pass.bpf.c +++ b/tests/integration-test/bpf/tc_pass.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman // clang-format off #include diff --git a/tests/integration-test/bpf/tp_openat.bpf.c b/tests/integration-test/bpf/tp_openat.bpf.c index cb6b57f82..599c5f696 100644 --- a/tests/integration-test/bpf/tp_openat.bpf.c +++ b/tests/integration-test/bpf/tp_openat.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman // clang-format off #include diff --git a/tests/integration-test/bpf/uprobe.bpf.c b/tests/integration-test/bpf/uprobe.bpf.c index 5ba70e55a..33a74f6c6 100644 --- a/tests/integration-test/bpf/uprobe.bpf.c +++ b/tests/integration-test/bpf/uprobe.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman // Some uprobe test code diff --git a/tests/integration-test/bpf/xdp_pass.bpf.c b/tests/integration-test/bpf/xdp_pass.bpf.c index 889946e3a..3c125722d 100644 --- a/tests/integration-test/bpf/xdp_pass.bpf.c +++ b/tests/integration-test/bpf/xdp_pass.bpf.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -// Copyright Authors of bpfd +// Copyright Authors of bpfman // clang-format off #include diff --git a/tests/integration-test/src/tests/basic.rs b/tests/integration-test/src/tests/basic.rs index cf45ef337..5c34c4452 100644 --- a/tests/integration-test/src/tests/basic.rs +++ b/tests/integration-test/src/tests/basic.rs @@ -1,7 +1,7 @@ use std::process::Command; use assert_cmd::prelude::*; -use bpfd_api::util::directories::{ +use bpfman_api::util::directories::{ RTDIR_FS_MAPS, RTDIR_FS_TC_INGRESS, RTDIR_FS_XDP, STDIR_BYTECODE_IMAGE_CONTENT_STORE, }; use log::debug; @@ -30,9 +30,9 @@ fn test_unix_socket_load_unload_xdp() { cfgfile_append_unix_socket(); - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); debug!("Installing xdp_pass programs"); @@ -55,7 +55,7 @@ fn test_unix_socket_load_unload_xdp() { for _ in 0..5 { let priority = rng.gen_range(1..255); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, priority, Some(globals.clone()), Some(proceed_on.clone()), @@ -81,9 +81,9 @@ fn test_unix_socket_load_unload_xdp() { fn test_load_unload_xdp() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); - let bpfd_guard = start_bpfd().unwrap(); + let bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); debug!("Installing xdp_pass programs"); @@ -106,7 +106,7 @@ fn test_load_unload_xdp() { for _ in 0..5 { let priority = rng.gen_range(1..255); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, priority, Some(globals.clone()), Some(proceed_on.clone()), @@ -124,8 +124,8 @@ fn test_load_unload_xdp() { assert!(bpffs_has_entries(RTDIR_FS_XDP)); // Verify rule persistence between restarts - drop(bpfd_guard); - let _bpfd_guard = start_bpfd().unwrap(); + drop(bpfman_guard); + let _bpfman_guard = start_bpfman().unwrap(); verify_and_delete_programs(loaded_ids); @@ -136,15 +136,15 @@ fn test_load_unload_xdp() { fn test_map_sharing_load_unload_xdp() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); let load_type = LoadType::Image; - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); // Load first program, which will own the map. debug!("Installing xdp_counter map owner program 1"); let (map_owner_id, stdout_1) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, None, // globals None, // proceed_on @@ -179,7 +179,7 @@ fn test_map_sharing_load_unload_xdp() { Err(_) => None, }; let (shared_owner_id, stdout_2) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, None, // globals None, // proceed_on @@ -217,10 +217,10 @@ fn test_map_sharing_load_unload_xdp() { assert!(map_pin_path_2 == map_pin_path); // Unload the Map Owner Program - bpfd_del_program(&(map_owner_id.unwrap())); + bpfman_del_program(&(map_owner_id.unwrap())); // Retrive the Program sharing the map - let stdout_3 = bpfd_get(shared_owner_id.as_ref().unwrap()); + let stdout_3 = bpfman_get(shared_owner_id.as_ref().unwrap()); let binding_3 = stdout_3.unwrap(); // Verify "Map Used By:" field is set to only the @@ -230,16 +230,16 @@ fn test_map_sharing_load_unload_xdp() { assert!(map_used_by_3[0] == *(shared_owner_id.as_ref().unwrap())); // Unload the Map Sharing Program - bpfd_del_program(&(shared_owner_id.unwrap())); + bpfman_del_program(&(shared_owner_id.unwrap())); } #[integration_test] fn test_load_unload_tc() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); debug!("Installing ingress tc programs"); @@ -268,7 +268,7 @@ fn test_load_unload_tc() { let priority = rng.gen_range(1..255); let (prog_id, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, priority, Some(globals.clone()), Some(proceed_on.clone()), @@ -282,7 +282,7 @@ fn test_load_unload_tc() { assert_eq!(loaded_ids.len(), 10); // Verify TC filter is using correct priority - let output = tc_filter_list(DEFAULT_BPFD_IFACE).unwrap(); + let output = tc_filter_list(DEFAULT_BPFMAN_IFACE).unwrap(); assert!(output.contains("pref 50")); assert!(output.contains("handle 0x2")); @@ -292,13 +292,13 @@ fn test_load_unload_tc() { assert!(!bpffs_has_entries(RTDIR_FS_TC_INGRESS)); - let output = tc_filter_list(DEFAULT_BPFD_IFACE).unwrap(); + let output = tc_filter_list(DEFAULT_BPFMAN_IFACE).unwrap(); assert!(output.trim().is_empty()); } #[integration_test] fn test_load_unload_tracepoint() { - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); debug!("Installing tracepoint programs"); @@ -321,7 +321,7 @@ fn test_load_unload_tracepoint() { #[integration_test] fn test_load_unload_uprobe() { - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); debug!("Installing uprobe program"); @@ -345,7 +345,7 @@ fn test_load_unload_uprobe() { #[integration_test] fn test_load_unload_uretprobe() { - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); debug!("Installing uretprobe program"); @@ -369,7 +369,7 @@ fn test_load_unload_uretprobe() { #[integration_test] fn test_load_unload_kprobe() { - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); debug!("Installing kprobe program"); @@ -388,7 +388,7 @@ fn test_load_unload_kprobe() { #[integration_test] fn test_load_unload_kretprobe() { - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); debug!("Installing kretprobe program"); @@ -417,11 +417,11 @@ fn test_pull_bytecode() { std::fs::remove_dir_all(STDIR_BYTECODE_IMAGE_CONTENT_STORE).unwrap(); } - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); debug!("Pull bytecode image"); - let _result = bpfd_pull_bytecode().unwrap(); + let _result = bpfman_pull_bytecode().unwrap(); let path = get_image_path(); assert!(path.exists()); @@ -430,9 +430,9 @@ fn test_pull_bytecode() { #[integration_test] fn test_list_with_metadata() { let _namespace_guard = create_namespace().unwrap(); - let bpfd_guard = start_bpfd().unwrap(); + let bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); debug!("Installing xdp_pass programs"); @@ -455,7 +455,7 @@ fn test_list_with_metadata() { for _ in 0..2 { let priority = rng.gen_range(1..255); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, priority, Some(globals.clone()), Some(proceed_on.clone()), @@ -472,7 +472,7 @@ fn test_list_with_metadata() { let key = "uuid=ITS_BPF_NOT_EBPF"; let priority = rng.gen_range(1..255); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, priority, Some(globals.clone()), Some(proceed_on.clone()), @@ -486,7 +486,7 @@ fn test_list_with_metadata() { debug!("Listing programs with metadata {key}"); // ensure listing with metadata works - let list_output = bpfd_list(Some(vec![key])).unwrap(); + let list_output = bpfman_list(Some(vec![key])).unwrap(); assert!(list_output.contains(&id)); @@ -497,8 +497,8 @@ fn test_list_with_metadata() { assert!(bpffs_has_entries(RTDIR_FS_XDP)); // Verify rule persistence between restarts - drop(bpfd_guard); - let _bpfd_guard = start_bpfd().unwrap(); + drop(bpfman_guard); + let _bpfman_guard = start_bpfman().unwrap(); verify_and_delete_programs(loaded_ids); diff --git a/tests/integration-test/src/tests/e2e.rs b/tests/integration-test/src/tests/e2e.rs index f2b167ee7..68701d417 100644 --- a/tests/integration-test/src/tests/e2e.rs +++ b/tests/integration-test/src/tests/e2e.rs @@ -1,6 +1,6 @@ use std::{path::PathBuf, thread::sleep, time::Duration}; -use bpfd_api::util::directories::{RTDIR_FS_TC_EGRESS, RTDIR_FS_TC_INGRESS, RTDIR_FS_XDP}; +use bpfman_api::util::directories::{RTDIR_FS_TC_EGRESS, RTDIR_FS_TC_INGRESS, RTDIR_FS_XDP}; use log::debug; use super::{integration_test, IntegrationTest}; @@ -33,15 +33,15 @@ fn test_proceed_on_xdp() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); let trace_guard = start_trace_pipe().unwrap(); - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); let mut loaded_ids = vec![]; debug!("Installing 1st xdp program"); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 75, Some([GLOBAL_1, "GLOBAL_u32=0A0B0C0D"].to_vec()), None, // proceed_on @@ -70,7 +70,7 @@ fn test_proceed_on_xdp() { // program from being executed. debug!("Installing 2nd xdp program"); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_2, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["drop", "dispatcher_return"].to_vec()), @@ -100,7 +100,7 @@ fn test_proceed_on_xdp() { // and 3rd programs, but still not the first. debug!("Installing 3rd xdp program"); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 25, Some([GLOBAL_3, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["pass", "dispatcher_return"].to_vec()), @@ -136,21 +136,21 @@ fn test_unload_xdp() { // This test confirms that after unloading a high priority program, the // proceedon configuration still works. This test reproduces the case that // produced the xdp unload issue described in - // https://github.com/bpfd-dev/bpfd/issues/791 + // https://github.com/bpfman/bpfman/issues/791 let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); let trace_guard = start_trace_pipe().unwrap(); - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); let mut loaded_ids = vec![]; // Install the first lowest priority program. debug!("Installing 1st xdp program"); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 75, Some([GLOBAL_1, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["pass", "dispatcher_return"].to_vec()), @@ -166,7 +166,7 @@ fn test_unload_xdp() { // proceed on "pass", which this program will return. debug!("Installing 2nd xdp program"); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_2, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["pass", "dispatcher_return"].to_vec()), @@ -182,7 +182,7 @@ fn test_unload_xdp() { // proceed on "pass", which this program will return. debug!("Installing 3rd xdp program"); let (prog_id_high_pri, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 25, Some([GLOBAL_3, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["pass", "dispatcher_return"].to_vec()), @@ -213,7 +213,7 @@ fn test_unload_xdp() { // Now delete the highest priority program and confirm that the other two // are still running. - bpfd_del_program(prog_id_high_pri.unwrap().as_str()); + bpfman_del_program(prog_id_high_pri.unwrap().as_str()); debug!("Clear the trace_pipe_log"); drop(trace_guard); @@ -238,16 +238,16 @@ fn test_proceed_on_tc() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); let trace_guard = start_trace_pipe().unwrap(); - let bpfd_guard = start_bpfd().unwrap(); + let bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); let mut loaded_ids = vec![]; debug!("Installing 1st tc ingress program"); let (prog_id, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 75, Some([GLOBAL_1, "GLOBAL_u32=0A0B0C0D"].to_vec()), None, @@ -260,7 +260,7 @@ fn test_proceed_on_tc() { debug!("Installing 1st tc egress program"); let (prog_id, _) = add_tc( "egress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 75, Some([GLOBAL_4, "GLOBAL_u32=0A0B0C0D"].to_vec()), None, @@ -289,7 +289,7 @@ fn test_proceed_on_tc() { debug!("Installing 2nd tc ingress program"); let (prog_id, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_2, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["shot", "dispatcher_return"].to_vec()), @@ -302,7 +302,7 @@ fn test_proceed_on_tc() { debug!("Installing 2nd tc egress program"); let (prog_id, _) = add_tc( "egress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_5, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["shot", "dispatcher_return"].to_vec()), @@ -334,7 +334,7 @@ fn test_proceed_on_tc() { debug!("Installing 3rd tc ingress program"); let (prog_id, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 25, Some([GLOBAL_3, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -347,7 +347,7 @@ fn test_proceed_on_tc() { debug!("Installing 3rd tc egress program"); let (prog_id, _) = add_tc( "egress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 25, Some([GLOBAL_6, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -377,11 +377,11 @@ fn test_proceed_on_tc() { assert!(trace_pipe_log.contains(TC_EG_GLOBAL_6_LOG)); debug!("Successfully completed tc egress proceed-on test"); - // Verify that the programs still work after we stop and restart bpfd - drop(bpfd_guard); - let _bpfd_guard = start_bpfd().unwrap(); + // Verify that the programs still work after we stop and restart bpfman + drop(bpfman_guard); + let _bpfman_guard = start_bpfman().unwrap(); - // Make sure it still works like it did before we stopped and restarted bpfd + // Make sure it still works like it did before we stopped and restarted bpfman debug!("Clear the trace_pipe_log"); drop(trace_guard); let _trace_guard = start_trace_pipe().unwrap(); @@ -410,14 +410,14 @@ fn test_unload_tc() { // This test confirms that after unloading a high priority program, the // proceedon configuration still works. This test reproduces the case that // produced the tc unload issue described in - // https://github.com/bpfd-dev/bpfd/issues/791 + // https://github.com/bpfman/bpfman/issues/791 let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); let trace_guard = start_trace_pipe().unwrap(); - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); let mut loaded_ids = vec![]; @@ -425,7 +425,7 @@ fn test_unload_tc() { debug!("Installing 1st tc ingress program"); let (prog_id, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 75, Some([GLOBAL_1, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -438,7 +438,7 @@ fn test_unload_tc() { debug!("Installing 1st tc egress program"); let (prog_id, _) = add_tc( "egress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 75, Some([GLOBAL_4, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -453,7 +453,7 @@ fn test_unload_tc() { debug!("Installing 2nd tc ingress program"); let (prog_id, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_2, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -466,7 +466,7 @@ fn test_unload_tc() { debug!("Installing 2nd tc egress program"); let (prog_id, _) = add_tc( "egress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_5, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -481,7 +481,7 @@ fn test_unload_tc() { debug!("Installing 3rd tc ingress program"); let (prog_id_ing_high_pri, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 25, Some([GLOBAL_3, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -493,7 +493,7 @@ fn test_unload_tc() { debug!("Installing 3rd tc egress program"); let (prog_id_eg_high_pri, _) = add_tc( "egress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 25, Some([GLOBAL_6, "GLOBAL_u32=0A0B0C0D"].to_vec()), Some(["ok", "dispatcher_return"].to_vec()), @@ -524,8 +524,8 @@ fn test_unload_tc() { debug!("All 3 tc egress logs found"); // Unload the 3rd programs - bpfd_del_program(prog_id_ing_high_pri.unwrap().as_str()); - bpfd_del_program(prog_id_eg_high_pri.unwrap().as_str()); + bpfman_del_program(prog_id_ing_high_pri.unwrap().as_str()); + bpfman_del_program(prog_id_eg_high_pri.unwrap().as_str()); debug!("Clear the trace_pipe_log"); drop(trace_guard); @@ -554,15 +554,15 @@ fn test_program_execution_with_global_variables() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); let _trace_guard = start_trace_pipe().unwrap(); - let _bpfd_guard = start_bpfd().unwrap(); + let _bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); let mut loaded_ids = vec![]; debug!("Installing xdp program"); let (prog_id, _) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 75, Some([GLOBAL_1, "GLOBAL_u32=0A0B0C0D"].to_vec()), None, // proceed_on @@ -580,7 +580,7 @@ fn test_program_execution_with_global_variables() { debug!("Installing tc ingress program"); let (prog_id, _) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_1, "GLOBAL_u32=0A0B0C0D"].to_vec()), None, @@ -596,7 +596,7 @@ fn test_program_execution_with_global_variables() { debug!("Installing tc egress program"); let (prog_id, _) = add_tc( "egress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 50, Some([GLOBAL_4, "GLOBAL_u32=0A0B0C0D"].to_vec()), None, @@ -697,15 +697,15 @@ fn test_program_execution_with_global_variables() { fn test_load_unload_xdp_maps() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); - let bpfd_guard = start_bpfd().unwrap(); + let bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); debug!("Installing xdp_counter program"); // Install an xdp counter program let (prog_id, stdout) = add_xdp( - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 100, None, // globals None, // proceed_on @@ -725,8 +725,8 @@ fn test_load_unload_xdp_maps() { assert!(PathBuf::from(map_pin_path).join("xdp_stats_map").exists()); // Verify rule persistence between restarts - drop(bpfd_guard); - let _bpfd_guard = start_bpfd().unwrap(); + drop(bpfman_guard); + let _bpfman_guard = start_bpfman().unwrap(); verify_and_delete_programs(vec![prog_id.unwrap()]); @@ -737,16 +737,16 @@ fn test_load_unload_xdp_maps() { fn test_load_unload_tc_maps() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); - let bpfd_guard = start_bpfd().unwrap(); + let bpfman_guard = start_bpfman().unwrap(); - assert!(iface_exists(DEFAULT_BPFD_IFACE)); + assert!(iface_exists(DEFAULT_BPFMAN_IFACE)); debug!("Installing tc_counter program"); // Install an counter program let (prog_id, stdout) = add_tc( "ingress", - DEFAULT_BPFD_IFACE, + DEFAULT_BPFMAN_IFACE, 100, None, None, @@ -764,8 +764,8 @@ fn test_load_unload_tc_maps() { assert!(PathBuf::from(map_pin_path).join("tc_stats_map").exists()); // Verify rule persistence between restarts - drop(bpfd_guard); - let _bpfd_guard = start_bpfd().unwrap(); + drop(bpfman_guard); + let _bpfman_guard = start_bpfman().unwrap(); verify_and_delete_programs(vec![prog_id.unwrap()]); @@ -776,7 +776,7 @@ fn test_load_unload_tc_maps() { fn test_load_unload_tracepoint_maps() { let _namespace_guard = create_namespace().unwrap(); let _ping_guard = start_ping().unwrap(); - let bpfd_guard = start_bpfd().unwrap(); + let bpfman_guard = start_bpfman().unwrap(); debug!("Installing tracepoint_counter program"); @@ -792,8 +792,8 @@ fn test_load_unload_tracepoint_maps() { .exists()); // Verify rule persistence between restarts - drop(bpfd_guard); - let _bpfd_guard = start_bpfd().unwrap(); + drop(bpfman_guard); + let _bpfman_guard = start_bpfman().unwrap(); verify_and_delete_programs(vec![prog_id.unwrap()]); } diff --git a/tests/integration-test/src/tests/utils.rs b/tests/integration-test/src/tests/utils.rs index a3536d460..752d20639 100644 --- a/tests/integration-test/src/tests/utils.rs +++ b/tests/integration-test/src/tests/utils.rs @@ -10,26 +10,26 @@ use std::{ use anyhow::Result; use assert_cmd::prelude::*; -use bpfd_api::util::directories::{CFGPATH_BPFD_CONFIG, STDIR_BYTECODE_IMAGE_CONTENT_STORE}; +use bpfman_api::util::directories::{CFGPATH_BPFMAN_CONFIG, STDIR_BYTECODE_IMAGE_CONTENT_STORE}; use log::debug; use predicates::str::is_empty; use regex::Regex; -const NS_NAME: &str = "bpfd-int-test"; +const NS_NAME: &str = "bpfman-int-test"; -const HOST_VETH: &str = "veth-bpfd-host"; -const NS_VETH: &str = "veth-bpfd-ns"; +const HOST_VETH: &str = "veth-bpfm-host"; +const NS_VETH: &str = "veth-bpfm-ns"; -// The default prefix can be overriden by setting the BPFD_IP_PREFIX environment variable +// The default prefix can be overriden by setting the BPFMAN_IP_PREFIX environment variable const DEFAULT_IP_PREFIX: &str = "172.37.37"; const IP_MASK: &str = "24"; const HOST_IP_ID: &str = "1"; const NS_IP_ID: &str = "2"; -pub const DEFAULT_BPFD_IFACE: &str = HOST_VETH; +pub const DEFAULT_BPFMAN_IFACE: &str = HOST_VETH; -const PING_FILE_NAME: &str = "/tmp/bpfd_ping.log"; -const TRACE_PIPE_FILE_NAME: &str = "/tmp/bpfd_trace_pipe.log"; +const PING_FILE_NAME: &str = "/tmp/bpfman_ping.log"; +const TRACE_PIPE_FILE_NAME: &str = "/tmp/bpfman_trace_pipe.log"; #[derive(Debug)] pub enum LoadType { @@ -39,16 +39,16 @@ pub enum LoadType { pub static LOAD_TYPES: &[LoadType] = &[LoadType::Image, LoadType::File]; -pub const XDP_PASS_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/xdp_pass:latest"; -pub const TC_PASS_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/tc_pass:latest"; -pub const TRACEPOINT_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/tracepoint:latest"; -pub const UPROBE_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/uprobe:latest"; -pub const URETPROBE_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/uretprobe:latest"; -pub const KPROBE_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/kprobe:latest"; -pub const KRETPROBE_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/kretprobe:latest"; -pub const XDP_COUNTER_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/go-xdp-counter"; -pub const TC_COUNTER_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/go-tc-counter"; -pub const TRACEPOINT_COUNTER_IMAGE_LOC: &str = "quay.io/bpfd-bytecode/go-tracepoint-counter"; +pub const XDP_PASS_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/xdp_pass:latest"; +pub const TC_PASS_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/tc_pass:latest"; +pub const TRACEPOINT_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/tracepoint:latest"; +pub const UPROBE_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/uprobe:latest"; +pub const URETPROBE_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/uretprobe:latest"; +pub const KPROBE_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/kprobe:latest"; +pub const KRETPROBE_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/kretprobe:latest"; +pub const XDP_COUNTER_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/go-xdp-counter"; +pub const TC_COUNTER_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/go-tc-counter"; +pub const TRACEPOINT_COUNTER_IMAGE_LOC: &str = "quay.io/bpfman-bytecode/go-tracepoint-counter"; pub const XDP_PASS_FILE_LOC: &str = "tests/integration-test/bpf/.output/xdp_pass.bpf.o"; pub const TC_PASS_FILE_LOC: &str = "tests/integration-test/bpf/.output/tc_pass.bpf.o"; @@ -77,24 +77,24 @@ impl Drop for ChildGuard { } } -/// Spawn a bpfd process -pub fn start_bpfd() -> Result { - debug!("Starting bpfd"); +/// Spawn a bpfman process +pub fn start_bpfman() -> Result { + debug!("Starting bpfman"); - let bpfd_process = Command::cargo_bin("bpfd")? - .env("RUST_LOG", "bpfd=debug") + let bpfman_process = Command::cargo_bin("bpfman")? + .env("RUST_LOG", "bpfman=debug") .spawn() .map(|c| ChildGuard { - name: "bpfd", + name: "bpfman", child: c, })?; - // Wait for up to 5 seconds for bpfd to be ready + // Wait for up to 5 seconds for bpfman to be ready sleep(Duration::from_millis(100)); for i in 1..51 { if let Err(e) = Command::cargo_bin("bpfctl")?.args(["list"]).ok() { if i == 50 { - panic!("bpfd not ready after {} ms. Error:\n{}", i * 100, e); + panic!("bpfman not ready after {} ms. Error:\n{}", i * 100, e); } else { sleep(Duration::from_millis(100)); } @@ -102,27 +102,27 @@ pub fn start_bpfd() -> Result { break; } } - debug!("Successfully Started bpfd"); + debug!("Successfully Started bpfman"); - Ok(bpfd_process) + Ok(bpfman_process) } -/// Update bpfd.toml with Unix Socket +/// Update bpfman.toml with Unix Socket pub fn cfgfile_append_unix_socket() { - debug!("Setup bpfd.toml with Unix Socket"); + debug!("Setup bpfman.toml with Unix Socket"); - let mut f = File::create(CFGPATH_BPFD_CONFIG).unwrap(); + let mut f = File::create(CFGPATH_BPFMAN_CONFIG).unwrap(); f.write_all( - b"[[grpc.endpoints]]\ntype = \"unix\"\nenabled = true\npath = \"/run/bpfd/bpfd.sock\"", + b"[[grpc.endpoints]]\ntype = \"unix\"\nenabled = true\npath = \"/run/bpfman/bpfman.sock\"", ) - .expect("could not write unix socket to bpfd.toml file"); + .expect("could not write unix socket to bpfman.toml file"); } -/// Update bpfd.toml with Unix Socket +/// Update bpfman.toml with Unix Socket pub fn cfgfile_remove() { - debug!("Remove bpfd.toml"); + debug!("Remove bpfman.toml"); - fs::remove_file(CFGPATH_BPFD_CONFIG).expect("could not remove bpfd.toml file"); + fs::remove_file(CFGPATH_BPFMAN_CONFIG).expect("could not remove bpfman.toml file"); } /// Install an xdp program with bpfctl @@ -473,8 +473,8 @@ pub fn add_kretprobe( Ok(prog_id) } -/// Delete a bpfd program using bpfctl -pub fn bpfd_del_program(prog_id: &str) { +/// Delete a bpfman program using bpfctl +pub fn bpfman_del_program(prog_id: &str) { Command::cargo_bin("bpfctl") .unwrap() .args(["unload", prog_id.trim()]) @@ -486,7 +486,7 @@ pub fn bpfd_del_program(prog_id: &str) { } /// Retrieve the output of bpfctl list -pub fn bpfd_list(metadata_selector: Option>) -> Result { +pub fn bpfman_list(metadata_selector: Option>) -> Result { let mut args = vec!["list"]; if let Some(g) = metadata_selector { args.push("--metadata-selector"); @@ -499,7 +499,7 @@ pub fn bpfd_list(metadata_selector: Option>) -> Result { } /// Retrieve program data for a given program with bpfctl -pub fn bpfd_get(prog_id: &str) -> Result { +pub fn bpfman_get(prog_id: &str) -> Result { let output = Command::cargo_bin("bpfctl") .unwrap() .args(["get", prog_id.trim()]) @@ -515,7 +515,7 @@ pub fn bpfd_get(prog_id: &str) -> Result { Ok(stdout) } -pub fn bpfd_pull_bytecode() -> Result { +pub fn bpfman_pull_bytecode() -> Result { let mut args = vec!["pull-bytecode"]; args.extend([ @@ -547,14 +547,14 @@ pub fn tc_filter_list(iface: &str) -> Result { /// Verify the specified interface exists /// TODO: make OS agnostic (network-interface crate https://lib.rs/crates/network-interface?) -pub fn iface_exists(bpfd_iface: &str) -> bool { +pub fn iface_exists(bpfman_iface: &str) -> bool { let output = Command::new("ip") .args(["link", "show"]) .output() .expect("ip link show"); let link_out = String::from_utf8(output.stdout).unwrap(); - if link_out.contains(bpfd_iface) { + if link_out.contains(bpfman_iface) { return true; } @@ -587,7 +587,7 @@ impl Drop for NamespaceGuard { } fn get_ip_prefix() -> String { - match option_env!("BPFD_IP_PREFIX") { + match option_env!("BPFMAN_IP_PREFIX") { Some(ip_prefix) => ip_prefix.to_string(), None => DEFAULT_IP_PREFIX.to_string(), } @@ -619,7 +619,7 @@ fn ip_prefix_exists(prefix: &String) -> bool { pub fn create_namespace() -> Result { if ip_prefix_exists(&get_ip_prefix()) { panic!( - "ip prefix {} is in use, specify an available prefix with env BPFD_IP_PREFIX.", + "ip prefix {} is in use, specify an available prefix with env BPFMAN_IP_PREFIX.", get_ip_prefix() ); } @@ -676,8 +676,8 @@ pub fn create_namespace() -> Result { delete_namespace(NS_NAME); panic!( "failed to add ip address {ns_ip_mask} to {NS_VETH}: {status}\n - if {ns_ip_mask} is not available, specify a usable prefix with env BPFD_IT_PREFIX.\n - for example: export BPFD_IT_PREFIX=\"192.168.1\"" + if {ns_ip_mask} is not available, specify a usable prefix with env BPFMAN_IT_PREFIX.\n + for example: export BPFMAN_IT_PREFIX=\"192.168.1\"" ); } @@ -803,20 +803,20 @@ pub fn read_trace_pipe_log() -> Result { /// and verify that they have been deleted. pub fn verify_and_delete_programs(loaded_ids: Vec) { // Verify bpfctl list contains the loaded_ids of each program - let bpfctl_list = bpfd_list(None).unwrap(); + let bpfctl_list = bpfman_list(None).unwrap(); for id in loaded_ids.iter() { assert!(bpfctl_list.contains(id.trim())); } // Delete the installed programs - debug!("Deleting bpfd program(s)"); + debug!("Deleting bpfman program(s)"); for id in loaded_ids.iter() { - bpfd_del_program(id) + bpfman_del_program(id) } // Verify bpfctl list does not contain the loaded_ids of the deleted programs // and that there are no panics if bpfctl does not contain any programs. - let bpfctl_list = bpfd_list(None).unwrap(); + let bpfctl_list = bpfman_list(None).unwrap(); for id in loaded_ids.iter() { assert!(!bpfctl_list.contains(id.trim())); } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index d908ec0d2..e1b1a7361 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -21,11 +21,11 @@ enum Command { BuildEbpf(build_ebpf::Options), /// Build the gRPC protobuf files. BuildProto(protobuf::Options), - /// Prep the system for using bpfd by copying binaries to "/usr/sbin/". + /// Prep the system for using bpfman by copying binaries to "/usr/sbin/". Copy(copy::Options), - /// Run bpfd on the local host. + /// Run bpfman on the local host. Run(run::Options), - /// Run the integration tests for bpfd. + /// Run the integration tests for bpfman. IntegrationTest(integration_test::Options), } diff --git a/xtask/src/protobuf.rs b/xtask/src/protobuf.rs index 9de1bb882..ec238c274 100644 --- a/xtask/src/protobuf.rs +++ b/xtask/src/protobuf.rs @@ -22,29 +22,29 @@ fn workspace_root() -> String { } pub fn build(_opts: Options) -> anyhow::Result<()> { - build_bpfd(&_opts)?; + build_bpfman(&_opts)?; build_csi(&_opts)?; Ok(()) } -fn build_bpfd(_opts: &Options) -> anyhow::Result<()> { +fn build_bpfman(_opts: &Options) -> anyhow::Result<()> { let root = PathBuf::from(WORKSPACE_ROOT.to_string()); - let out_dir = root.join("bpfd-api/src"); + let out_dir = root.join("bpfman-api/src"); let proto_dir = root.join("proto"); - let protos = &["bpfd.proto"]; + let protos = &["bpfman.proto"]; let includes = &[proto_dir.to_str().unwrap()]; tonic_build::configure() .out_dir(out_dir) .compile(protos, includes)?; - // protoc -I=./bpfd/proto --go_out=paths=source_relative:./clients/gobpfd ./bpfd/proto/bpfd.proto + // protoc -I=./bpfman/proto --go_out=paths=source_relative:./clients/gobpfman ./bpfman/proto/bpfman.proto let status = Command::new("protoc") .current_dir(&root) .args([ "-I=./proto", - "--go_out=paths=source_relative:./clients/gobpfd/v1", - "bpfd.proto", + "--go_out=paths=source_relative:./clients/gobpfman/v1", + "bpfman.proto", ]) .status() .expect("failed to build bpf program"); @@ -53,9 +53,9 @@ fn build_bpfd(_opts: &Options) -> anyhow::Result<()> { .current_dir(&root) .args([ "-I=./proto", - "--go-grpc_out=./clients/gobpfd/v1", + "--go-grpc_out=./clients/gobpfman/v1", "--go-grpc_opt=paths=source_relative", - "bpfd.proto", + "bpfman.proto", ]) .status() .expect("failed to build bpf program"); diff --git a/xtask/src/run.rs b/xtask/src/run.rs index a4532ace3..18b6cb70b 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -55,7 +55,7 @@ pub fn run(opts: Options) -> Result<(), anyhow::Error> { // profile we are building (release or debug) let profile = if opts.release { "release" } else { "debug" }; - let bin_path = format!("target/{profile}/bpfd"); + let bin_path = format!("target/{profile}/bpfman"); // arguments to pass to the application let mut run_args: Vec<_> = opts.run_args.iter().map(String::as_str).collect();