internal

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	K8sHostLabel                              = "kubernetes.io/hostname"
	DiscoveredLabel                           = "bpfman.io/discoveredProgram"
	UuidMetadataKey                           = "bpfman.io/uuid"
	ProgramNameKey                            = "bpfman.io/ProgramName"
	BpfmanNamespace                           = "bpfman"
	BpfmanOperatorName                        = "bpfman-operator"
	BpfmanDsName                              = "bpfman-daemon"
	BpfmanMetricsProxyDsName                  = "bpfman-metrics-proxy"
	BpfmanConfigName                          = "bpfman-config"
	BpfmanCmName                              = "bpfman-config"
	BpfmanCsiDriverName                       = "csi.bpfman.io"
	BpfmanRestrictedSccName                   = "bpfman-restricted"
	BpfmanAgentServiceMonitorName             = "bpfman-agent-metrics-monitor"
	BpfmanControllerServiceMonitorName        = "bpfman-controller-manager-metrics-monitor"
	BpfmanAgentMetricsServiceName             = "bpfman-agent-metrics-service"
	BpfmanControllerMetricsServiceName        = "bpfman-controller-manager-metrics-service"
	BpfmanContainerName                       = "bpfman"
	BpfmanAgentContainerName                  = "bpfman-agent"
	BpfmanInitContainerName                   = "mount-bpffs"
	BpfmanCsiDriverRegistrarName              = "node-driver-registrar"
	BpfmanMetricsProxyContainer               = "metrics-proxy"
	BpfmanPrivilegedSccClusterRoleBindingName = "bpfman-privileged-scc"
	BpfmanUserClusterRoleName                 = "bpfman-user"
	BpfmanPrometheusClusterRoleBindingName    = "bpfman-prometheus-metrics-reader"
	BpfmanPrometheusRoleName                  = "bpfman-prometheus-k8s"
	BpfmanPrometheusRoleBindingName           = "bpfman-prometheus-k8s"
	BpfmanDaemonManifestPath                  = "./config/bpfman-deployment/daemonset.yaml"
	BpfmanMetricsProxyPath                    = "./config/bpfman-deployment/metrics-proxy-daemonset.yaml"
	BpfmanCsiDriverPath                       = "./config/bpfman-deployment/csidriverinfo.yaml"
	DefaultType                               = "tcp"
	DefaultPath                               = "/run/bpfman-sock/bpfman.sock"
	DefaultPort                               = 50051
	DefaultEnabled                            = true
	DefaultConfigNamespace                    = "bpfman"
	DefaultLogLevel                           = "info"
	DefaultHealthProbePort                    = 8175
	DefaultConfiguration                      = `[database]
max_retries = 30
millisec_delay = 10000
[signing]
allow_unsigned = true
verify_enabled = true
`
	BpfAppStateOwner              = "bpfman.io/ownedByProgram"
	NetNsPath                     = "/run/netns"
	BpfmanTOML                    = "bpfman.toml"
	BpfmanLogLevel                = "bpfman.log.level"
	BpfmanAgentLogLevel           = "bpfman.agent.log.level"
	BpfmanAgentHealthProbeAddress = "bpfman.agent.healthprobeaddr"
	APIPrefix                     = "bpfman.io"
)
View Source
const (
	// BpfmanOperatorFinalizer is the finalizer that holds a *Program from
	// deletion until cleanup can be performed.
	BpfmanOperatorFinalizer = "bpfman.io.operator/finalizer"
	// BpfmanConfigFinalizer is the finalizer that holds a Config from
	// deletion until cleanup can be performed and prevents race conditions during deletion.
	BpfmanConfigFinalizer = "bpfman.io/config-finalizer"
	// ClBpfApplicationControllerFinalizer is the finalizer that holds a ClusterBpfApplication
	ClBpfApplicationControllerFinalizer = "bpfman.io.clbpfapplicationcontroller/finalizer"
	// NsBpfApplicationControllerFinalizer is the finalizer that holds a BpfApplication
	NsBpfApplicationControllerFinalizer = "bpfman.io.nsbpfapplicationcontroller/finalizer"
)
View Source
const ApplicationString = "application"
View Source
const FentryString = "fentry"
View Source
const FexitString = "fexit"
View Source
const TcxString = "tcx"
View Source
const UprobeString = "uprobe"

Define a constant strings for Uprobe, Fentry and Fexit. Uprobe has the same kernel ProgramType as Kprobe, and Fentry and Fexit both have the Tracing ProgramType, so we can't use the ProgramType String() method above.

Variables

This section is empty.

Functions

func BpfNodePredicate added in v0.6.0

func BpfNodePredicate(nodeName string) predicate.Funcs

Only reconcile if a program has been created for a controller's node.

func DiscoveredBpfProgramPredicate

func DiscoveredBpfProgramPredicate() predicate.Funcs

Only reconcile if a bpfprogram has been created for a controller's node.

func HasMonitoringAPI added in v0.6.0

func HasMonitoringAPI(client discovery.DiscoveryInterface, setupLog logr.Logger) (bool, error)

HasMonitoringAPI returns true if the monitoring.coreos.com API group is available on the cluster, indicating the Prometheus Operator (or compatible) is installed.

func IsOpenShift added in v0.6.0

func IsOpenShift(client discovery.DiscoveryInterface, setupLog logr.Logger) (bool, error)

Returns true if the current platform is Openshift.

Types

type ProgramType

type ProgramType int32

Must match the kernel's `bpf_prog_type` enum. https://elixir.bootlin.com/linux/v6.4.4/source/include/uapi/linux/bpf.h#L948

const (
	Unspec ProgramType = iota
	SocketFilter
	Kprobe
	Tc
	SchedAct
	Tracepoint
	Xdp
	PerfEvent
	CgroupSkb
	CgroupSock
	LwtIn
	LwtOut
	LwtXmit
	SockOps
	SkSkb
	CgroupDevice
	SkMsg
	RawTracepoint
	CgroupSockAddr
	LwtSeg6Local
	LircMode2
	SkReuseport
	FlowDissector
	CgroupSysctl
	RawTracepointWritable
	CgroupSockopt
	Tracing
	StructOps
	Ext
	Lsm
	SkLookup
	Syscall
	// Keep "AllPrograms" at the end of the list.
	AllPrograms
)

func FromString

func FromString(p string) (*ProgramType, error)

func (ProgramType) String

func (p ProgramType) String() string

func (ProgramType) Uint32

func (p ProgramType) Uint32() *uint32

type ReconcileResult

type ReconcileResult uint8
const (
	// No changes were made to k8s objects, and rescheduling another reconcile
	// is not necessary. The calling code may continue reconciling other
	// programs in it's list.
	Unchanged ReconcileResult = 0
	// Changes were made to k8s objects that we know will trigger another
	// reconcile. Calling code should stop reconciling additional programs and
	// return immediately to avoid multiple concurrent reconcile threads.
	Updated ReconcileResult = 1
	// A retry should be scheduled. This should only be used when "Updated"
	// doesn't apply, but we want to trigger another reconcile anyway. For
	// example, there was a transient error. The calling code may continue
	// reconciling other programs in it's list.
	Requeue ReconcileResult = 2
)

func (ReconcileResult) String

func (r ReconcileResult) String() string

Directories

Path Synopsis
Package bpffs provides functions to check and mount the BPF filesystem.
Package bpffs provides functions to check and mount the BPF filesystem.
Package version holds build-time version information injected via ldflags.
Package version holds build-time version information injected via ldflags.

Jump to

Keyboard shortcuts

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