bpfmanagent

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOneContainerPerPod added in v0.6.0

func GetOneContainerPerPod(containers *[]ContainerInfo) *[]ContainerInfo

func TestGetPods added in v0.5.5

func TestGetPods(t *testing.T)

Types

type ApplicationReconciler added in v0.6.0

type ApplicationReconciler interface {
	// SetupWithManager registers the reconciler with the manager and defines
	// which kubernetes events will trigger a reconcile.
	SetupWithManager(mgr ctrl.Manager) error
	// Reconcile is the main entry point to the reconciler. It will be called by
	// the controller runtime when something happens that the reconciler is
	// interested in. When Reconcile is invoked, it initializes some state in
	// the given bpfmanReconciler, retrieves a list of all programs of the given
	// type, and then calls reconcileCommon.
	Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
	// contains filtered or unexported methods
}

ApplicationReconciler is an interface that defines the methods needed to reconcile a BpfApplication.

type ClBpfApplicationReconciler added in v0.6.0

type ClBpfApplicationReconciler struct {
	ReconcilerCommon
	// contains filtered or unexported fields
}

func (*ClBpfApplicationReconciler) Reconcile added in v0.6.0

func (*ClBpfApplicationReconciler) SetupWithManager added in v0.6.0

func (r *ClBpfApplicationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a BpfApplication object is updated, load/unload bpf programs on the node via bpfman, and create or update a BpfApplicationState object to reflect per node state information.

type ClFentryProgramReconciler added in v0.6.0

type ClFentryProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClFentryProgramReconciler contains the info required to reconcile a FentryProgram

type ClFexitProgramReconciler added in v0.6.0

type ClFexitProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClFexitProgramReconciler contains the info required to reconcile a FexitProgram

type ClKprobeProgramReconciler added in v0.6.0

type ClKprobeProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClKprobeProgramReconciler contains the info required to reconcile a KprobeProgram

type ClKretprobeProgramReconciler added in v0.6.0

type ClKretprobeProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClKretprobeProgramReconciler contains the info required to reconcile a KretprobeProgram

type ClProgramReconcilerCommon added in v0.6.0

type ClProgramReconcilerCommon struct {
	// contains filtered or unexported fields
}

type ClTcProgramReconciler added in v0.6.0

type ClTcProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClTcProgramReconciler contains the info required to reconcile a TcProgram

type ClTcxProgramReconciler added in v0.6.0

type ClTcxProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClTcxProgramReconciler contains the info required to reconcile a TcxProgram

type ClTracepointProgramReconciler added in v0.6.0

type ClTracepointProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClTracepointProgramReconciler contains the info required to reconcile a TracepointProgram

type ClUprobeProgramReconciler added in v0.6.0

type ClUprobeProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClUprobeProgramReconciler contains the info required to reconcile a UprobeProgram

type ClXdpProgramReconciler added in v0.6.0

type ClXdpProgramReconciler struct {
	ReconcilerCommon
	ClProgramReconcilerCommon
	// contains filtered or unexported fields
}

ClXdpProgramReconciler contains the info required to reconcile an XdpProgram

type ContainerGetter added in v0.5.5

type ContainerGetter interface {
	// Get the list of containers on this node that match the containerSelector.
	GetContainers(ctx context.Context,
		selectorNamespace string,
		selectorPods metav1.LabelSelector,
		selectorContainerNames *[]string,
		logger logr.Logger) (*[]ContainerInfo, error)
}

Create an interface for getting the list of containers in which the program should be attached so we can mock it in unit tests.

type ContainerInfo added in v0.5.5

type ContainerInfo struct {
	// contains filtered or unexported fields
}

type FakeContainerGetter added in v0.5.5

type FakeContainerGetter struct {
	// contains filtered or unexported fields
}

func (*FakeContainerGetter) GetContainers added in v0.5.5

func (f *FakeContainerGetter) GetContainers(
	ctx context.Context,
	selectorNamespace string,
	selectorPods metav1.LabelSelector,
	selectorContainerNames *[]string,
	logger logr.Logger,
) (*[]ContainerInfo, error)

type MockNetNsCache added in v0.6.0

type MockNetNsCache map[string]*uint64

func (MockNetNsCache) GetNetNsId added in v0.6.0

func (mnnc MockNetNsCache) GetNetNsId(path string) *uint64

func (MockNetNsCache) Reset added in v0.6.0

func (mnnc MockNetNsCache) Reset()

type NetNsCache added in v0.6.0

type NetNsCache interface {
	GetNetNsId(path string) *uint64
	Reset()
}

type NsBpfApplicationReconciler added in v0.6.0

type NsBpfApplicationReconciler struct {
	ReconcilerCommon
	// contains filtered or unexported fields
}

func (*NsBpfApplicationReconciler) Reconcile added in v0.6.0

func (*NsBpfApplicationReconciler) SetupWithManager added in v0.6.0

func (r *NsBpfApplicationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a BpfNsApplication object is updated, load/unload bpf programs on the node via bpfman, and create or update a BpfNsApplicationState object to reflect per node state information.

type NsProgramReconcilerCommon added in v0.6.0

type NsProgramReconcilerCommon struct {
	// contains filtered or unexported fields
}

type NsTcProgramReconciler added in v0.6.0

type NsTcProgramReconciler struct {
	ReconcilerCommon
	NsProgramReconcilerCommon
	// contains filtered or unexported fields
}

NsTcProgramReconciler contains the info required to reconcile a TcNsProgram

type NsTcxProgramReconciler added in v0.6.0

type NsTcxProgramReconciler struct {
	ReconcilerCommon
	NsProgramReconcilerCommon
	// contains filtered or unexported fields
}

NsTcxProgramReconciler contains the info required to reconcile a TcxNsProgram

type NsUprobeProgramReconciler added in v0.6.0

type NsUprobeProgramReconciler struct {
	ReconcilerCommon
	NsProgramReconcilerCommon
	// contains filtered or unexported fields
}

NsUprobeProgramReconciler contains the info required to reconcile a UprobeNsProgram

type NsXdpProgramReconciler added in v0.6.0

type NsXdpProgramReconciler struct {
	ReconcilerCommon
	NsProgramReconcilerCommon
	// contains filtered or unexported fields
}

NsXdpProgramReconciler contains the info required to reconcile an XdpNsProgram

type ProgramReconciler added in v0.6.0

type ProgramReconciler interface {
	// contains filtered or unexported methods
}

ProgramReconciler is an interface that defines the methods needed to reconcile a program contained in a BpfApplication.

type RealContainerGetter added in v0.5.5

type RealContainerGetter struct {
	// contains filtered or unexported fields
}

func NewRealContainerGetter added in v0.5.5

func NewRealContainerGetter(nodeName string) (*RealContainerGetter, error)

func (*RealContainerGetter) GetContainers added in v0.5.5

func (c *RealContainerGetter) GetContainers(
	ctx context.Context,
	selectorNamespace string,
	selectorPods metav1.LabelSelector,
	selectorContainerNames *[]string,
	logger logr.Logger) (*[]ContainerInfo, error)

type ReconcilerCommon

type ReconcilerCommon struct {
	client.Client
	Scheme       *runtime.Scheme
	GrpcConn     *grpc.ClientConn
	BpfmanClient gobpfman.BpfmanClient
	Logger       logr.Logger
	NodeName     string

	Containers ContainerGetter

	Interfaces *sync.Map
	NetNsCache NetNsCache
	// contains filtered or unexported fields
}

type ReconcilerNetNsCache added in v0.6.0

type ReconcilerNetNsCache struct {
	// contains filtered or unexported fields
}

func (*ReconcilerNetNsCache) GetNetNsId added in v0.6.0

func (rnnc *ReconcilerNetNsCache) GetNetNsId(path string) *uint64

GetNetnsId returns the network namespace ID from the given path. If the path is empty, it defaults to "/host/proc/1/ns/net". If the file is a hard link, it returns the inode number of the file. If the file is a soft link, it returns the inode of the file linked. If the path is not valid or the conversion to Stat_t fails, it returns nil.

func (*ReconcilerNetNsCache) Reset added in v0.6.0

func (rnnc *ReconcilerNetNsCache) Reset()

Reset reinitializes the cache to an empty state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL