bpfmanagent

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetID added in v0.5.5

func GetID[T BpfProg](p *T) (*uint32, error)

get the program ID from a bpfProgram

func TestGetPods added in v0.5.5

func TestGetPods(t *testing.T)

Types

type BpfApplicationReconciler added in v0.5.0

type BpfApplicationReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

func (*BpfApplicationReconciler) Reconcile added in v0.5.0

func (*BpfApplicationReconciler) SetupWithManager added in v0.5.0

func (r *BpfApplicationReconciler) 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 the programs to the node via bpfman, and then create a bpfProgram object to reflect per node state information.

type BpfNsApplicationReconciler added in v0.5.5

type BpfNsApplicationReconciler struct {
	NamespaceProgramReconciler
	// contains filtered or unexported fields
}

func (*BpfNsApplicationReconciler) Reconcile added in v0.5.5

func (*BpfNsApplicationReconciler) SetupWithManager added in v0.5.5

func (r *BpfNsApplicationReconciler) 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 the programs to the node via bpfman, and then create a BpfNsProgram object to reflect per node state information.

type BpfProg added in v0.5.5

type BpfProg interface {

	// GetName returns the name of the current program.
	GetName() string

	// GetUID returns the UID of the current program.
	GetUID() types.UID
	GetAnnotations() map[string]string
	GetLabels() map[string]string
	GetStatus() *bpfmaniov1alpha1.BpfProgramStatus
	GetClientObject() client.Object
}

type BpfProgList added in v0.5.5

type BpfProgList[T any] interface {
	GetItems() []T
}

type ClusterProgramReconciler added in v0.5.5

type ClusterProgramReconciler struct {
	ReconcilerCommon[bpfmaniov1alpha1.BpfProgram, bpfmaniov1alpha1.BpfProgramList]
}

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 FentryProgramReconciler

type FentryProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfProgram object

func (*FentryProgramReconciler) Reconcile

func (r *FentryProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*FentryProgramReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a FentryProgram is updated, load the program to the node via bpfman, and then create a bpfProgram object to reflect per node state information.

type FexitProgramReconciler

type FexitProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfProgram object

func (*FexitProgramReconciler) Reconcile

func (r *FexitProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*FexitProgramReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a FexitProgram is updated, load the program to the node via bpfman, and then create a bpfProgram object to reflect per node state information.

type KprobeProgramReconciler

type KprobeProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfProgram object

func (*KprobeProgramReconciler) Reconcile

func (r *KprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*KprobeProgramReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. 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.

type MapOwnerParamStatus

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

MapOwnerParamStatus provides the output from a MapOwerSelector being parsed.

type NamespaceProgramReconciler added in v0.5.5

type NamespaceProgramReconciler struct {
	ReconcilerCommon[bpfmaniov1alpha1.BpfNsProgram, bpfmaniov1alpha1.BpfNsProgramList]
}

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[T BpfProg, TL BpfProgList[T]] struct {
	client.Client
	Scheme       *runtime.Scheme
	GrpcConn     *grpc.ClientConn
	BpfmanClient gobpfman.BpfmanClient
	Logger       logr.Logger
	NodeName     string

	Containers ContainerGetter
	// contains filtered or unexported fields
}

ReconcilerCommon provides a skeleton for all *Program Reconcilers.

type TcNsProgramReconciler added in v0.5.5

type TcNsProgramReconciler struct {
	NamespaceProgramReconciler
	// contains filtered or unexported fields
}

TcNsProgramReconciler reconciles a TcNsProgram object by creating multiple BpfNsProgram objects and managing bpfman for each one.

func (*TcNsProgramReconciler) Reconcile added in v0.5.5

func (r *TcNsProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TcNsProgramReconciler) SetupWithManager added in v0.5.5

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

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a TcNsProgram is updated, load the program to the node via bpfman, and then create BpfNsProgram object(s) to reflect per node state information.

type TcProgramReconciler

type TcProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

TcProgramReconciler reconciles a tcProgram object by creating multiple bpfProgram objects and managing bpfman for each one.

func (*TcProgramReconciler) Reconcile

func (r *TcProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TcProgramReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. 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.

type TcxNsProgramReconciler added in v0.5.5

type TcxNsProgramReconciler struct {
	NamespaceProgramReconciler
	// contains filtered or unexported fields
}

TcxNsProgramReconciler reconciles a tcxNsProgram object by creating multiple bpfNsProgram objects and managing bpfman for each one.

func (*TcxNsProgramReconciler) Reconcile added in v0.5.5

func (r *TcxNsProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TcxNsProgramReconciler) SetupWithManager added in v0.5.5

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

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a TcxNsProgram is updated, load the program to the node via bpfman, and then create bpfNsProgram object(s) to reflect per node state information.

type TcxProgramReconciler added in v0.5.5

type TcxProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

TcxProgramReconciler reconciles a tcxProgram object by creating multiple bpfProgram objects and managing bpfman for each one.

func (*TcxProgramReconciler) Reconcile added in v0.5.5

func (r *TcxProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TcxProgramReconciler) SetupWithManager added in v0.5.5

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

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a TcxProgram is updated, load the program to the node via bpfman, and then create bpfProgram object(s) to reflect per node state information.

type TracepointProgramReconciler

type TracepointProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfProgram object

func (*TracepointProgramReconciler) Reconcile

func (*TracepointProgramReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. 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.

type UprobeNsProgramReconciler added in v0.5.5

type UprobeNsProgramReconciler struct {
	NamespaceProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfNsProgram object

func (*UprobeNsProgramReconciler) Reconcile added in v0.5.5

func (*UprobeNsProgramReconciler) SetupWithManager added in v0.5.5

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

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a UprobeNsProgram is updated, load the program to the node via bpfman, and then create a BpfNsProgram object to reflect per node state information.

type UprobeProgramReconciler

type UprobeProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfProgram object

func (*UprobeProgramReconciler) Reconcile

func (r *UprobeProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*UprobeProgramReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. 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.

type XdpNsProgramReconciler added in v0.5.5

type XdpNsProgramReconciler struct {
	NamespaceProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfNsProgram object

func (*XdpNsProgramReconciler) Reconcile added in v0.5.5

func (r *XdpNsProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*XdpNsProgramReconciler) SetupWithManager added in v0.5.5

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

SetupWithManager sets up the controller with the Manager. The Bpfman-Agent should reconcile whenever a XdpNsProgram is updated, load the program to the node via bpfman, and then create a bpfProgram object to reflect per node state information.

type XdpProgramReconciler

type XdpProgramReconciler struct {
	ClusterProgramReconciler
	// contains filtered or unexported fields
}

BpfProgramReconciler reconciles a BpfProgram object

func (*XdpProgramReconciler) Reconcile

func (r *XdpProgramReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*XdpProgramReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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