controller

package
v1.0.0-pre2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: GPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The name used by our controller to claim ownership of fields when doing server-side apply in Kubernetes.
	FieldOwnerKiveController = "kive-controller"

	// Where to find the identifier of this running kernel
	KernelIDPath = "/proc/sys/kernel/random/boot_id"

	// Label used to store the trap identifier
	TrapIDLabel = "trap-id"
)
View Source
const (
	KiveDataFinalizerName = "kivedata.kivebpf.san7o.github.io/finalizer"
)
View Source
const (
	KivePolicyFinalizerName = "kivepolicy.kivebpf.san7o.github.io/finalizer"
)

Variables

View Source
var (
	KernelID string = ""
)

Functions

func KiveDataContainerCmp

func KiveDataContainerCmp(kiveData kivev2alpha1.KiveData, pod corev1.Pod, containerStatus corev1.ContainerStatus) bool

func KiveDataTrapCmp

func KiveDataTrapCmp(kiveData kivev2alpha1.KiveData, kiveTrap kivev2alpha1.KiveTrap) (bool, error)

func KiveTrapHashID

func KiveTrapHashID(kiveTrap kivev2alpha1.KiveTrap, alertVersion string) (string, error)

func NewKiveDataName

func NewKiveDataName(inode uint64, dev uint32, pod corev1.Pod, containerStatus corev1.ContainerStatus) string

func Output

func Output(client client.Reader)

func RegexMatch

func RegexMatch(regex string, containerName string) (bool, error)

Types

type KiveDataReconciler

type KiveDataReconciler struct {
	client.Client
	UncachedClient client.Reader
	Scheme         *runtime.Scheme
}

func (*KiveDataReconciler) Reconcile

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

func (*KiveDataReconciler) SetupWithManager

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

type KivePodReconciler

type KivePodReconciler struct {
	client.Client
	UncachedClient client.Reader
}

func (*KivePodReconciler) Reconcile

There are two main operations we are concearned about with pods: pod creation and pod termination.

  • creation: upon creation, the controller should send a reconcile request for KivePolicy so that new KiveData will be generated for the new pod.
  • termination: upon termination, the controller should check if each KiveData refers to an existing pod. If it doesn't, then that resource should be eliminated.

Failures are treated as terminations.

func (*KivePodReconciler) SetupWithManager

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

type KivePolicyReconciler

type KivePolicyReconciler struct {
	client.Client
	UncachedClient client.Reader
	Scheme         *runtime.Scheme
}

func (*KivePolicyReconciler) Reconcile

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

The KivePolicy reconciliation is responsible for the following:

  • For each KivePolicy, fetch files' information such as the inode number from the matched container.
  • create KiveData resources with the previously fetched information if not already present.

func (*KivePolicyReconciler) SetupWithManager

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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