monitor

package
v10.248.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 16 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMonitor

func NewMonitor(opts ...Options) *config.MonitorConfig

NewMonitor provides a configuration for monitors.

Types

type CNIMonitorOption

type CNIMonitorOption func(*cnimonitor.Config)

CNIMonitorOption is provided using functional arguments.

func SubOptionMonitorCNIExtractor

func SubOptionMonitorCNIExtractor(extractor extractors.EventMetadataExtractor) CNIMonitorOption

SubOptionMonitorCNIExtractor provides a way to specify metadata extractor for CNI monitors.

type DockerMonitorOption

type DockerMonitorOption func(*dockermonitor.Config)

DockerMonitorOption is provided using functional arguments.

func SubOptionMonitorDockerDestroyStoppedContainers

func SubOptionMonitorDockerDestroyStoppedContainers(f bool) DockerMonitorOption

SubOptionMonitorDockerDestroyStoppedContainers sets the option to destroy stopped containers.

func SubOptionMonitorDockerExtractor

func SubOptionMonitorDockerExtractor(extractor extractors.DockerMetadataExtractor) DockerMonitorOption

SubOptionMonitorDockerExtractor provides a way to specify metadata extractor for docker.

func SubOptionMonitorDockerFlags

func SubOptionMonitorDockerFlags(syncAtStart, killContainerOnPolicyError bool) DockerMonitorOption

SubOptionMonitorDockerFlags provides a way to specify configuration flags info for docker.

func SubOptionMonitorDockerSocket

func SubOptionMonitorDockerSocket(socketType, socketAddress string) DockerMonitorOption

SubOptionMonitorDockerSocket provides a way to specify socket info for docker.

type Implementation

type Implementation interface {

	// Run starts the monitor implementation.
	Run(ctx context.Context) error

	// SetupConfig provides a configuration to implmentations. Every implmentation
	// can have its own config type.
	SetupConfig(registerer registerer.Registerer, cfg interface{}) error

	// SetupHandlers sets up handlers for monitors to invoke for various events such as
	// processing unit events and synchronization events. This will be called before Start()
	// by the consumer of the monitor
	SetupHandlers(c *config.ProcessorConfig)

	// Resync should resynchronize PUs. This should be done while starting up.
	Resync(ctx context.Context) error
}

Implementation for a monitor.

type KubernetesMonitorOption

type KubernetesMonitorOption func(*kubernetesmonitor.Config)

KubernetesMonitorOption is provided using functional arguments.

func SubOptionMonitorKubernetesDockerExtractor

func SubOptionMonitorKubernetesDockerExtractor(extractor extractors.DockerMetadataExtractor) KubernetesMonitorOption

SubOptionMonitorKubernetesDockerExtractor provides a way to specify metadata extractor for docker.

func SubOptionMonitorKubernetesExtractor

func SubOptionMonitorKubernetesExtractor(extractor extractors.KubernetesMetadataExtractorType) KubernetesMonitorOption

SubOptionMonitorKubernetesExtractor provides a way to specify metadata extractor for Kubernetes

func SubOptionMonitorKubernetesHostPod

func SubOptionMonitorKubernetesHostPod(enableHostPods bool) KubernetesMonitorOption

SubOptionMonitorKubernetesHostPod provides a way to specify if we want to activate Pods launched in host mode.

func SubOptionMonitorKubernetesKubeconfig

func SubOptionMonitorKubernetesKubeconfig(kubeconfig string) KubernetesMonitorOption

SubOptionMonitorKubernetesKubeconfig provides a way to specify a kubeconfig to use to connect to Kubernetes. In case of an in-cluter config, leave the kubeconfig field blank

func SubOptionMonitorKubernetesNodename

func SubOptionMonitorKubernetesNodename(nodename string) KubernetesMonitorOption

SubOptionMonitorKubernetesNodename provides a way to specify the kubernetes node name. This is useful for filtering

type LinuxMonitorOption

type LinuxMonitorOption func(*linuxmonitor.Config)

LinuxMonitorOption is provided using functional arguments.

func SubOptionMonitorLinuxExtractor

func SubOptionMonitorLinuxExtractor(extractor extractors.EventMetadataExtractor) LinuxMonitorOption

SubOptionMonitorLinuxExtractor provides a way to specify metadata extractor for linux monitors.

func SubOptionMonitorLinuxRealeaseAgentPath

func SubOptionMonitorLinuxRealeaseAgentPath(releasePath string) LinuxMonitorOption

SubOptionMonitorLinuxRealeaseAgentPath specifies the path to release agent programmed in cgroup

func SubOptionMonitorSSHExtractor

func SubOptionMonitorSSHExtractor(extractor extractors.EventMetadataExtractor) LinuxMonitorOption

SubOptionMonitorSSHExtractor provides a way to specify metadata extractor for SSH monitors.

func SubOptionMonitorSSHRealeaseAgentPath

func SubOptionMonitorSSHRealeaseAgentPath(releasePath string) LinuxMonitorOption

SubOptionMonitorSSHRealeaseAgentPath specifies the path to release agent programmed in cgroup

type Monitor

type Monitor interface {

	// Start starts the monitor.
	Run(ctx context.Context) error

	// UpdateConfiguration updates the configuration of the monitor
	UpdateConfiguration(ctx context.Context, config *config.MonitorConfig) error

	// Resync requests to the monitor to do a resync.
	Resync(ctx context.Context) error
}

A Monitor is an interface implmented to start/stop monitors.

func NewMonitors

func NewMonitors(opts ...Options) (Monitor, error)

NewMonitors instantiates all/any combination of monitors supported.

type Options

type Options func(*config.MonitorConfig)

Options is provided using functional arguments.

func OptionCollector

func OptionCollector(c collector.EventCollector) Options

OptionCollector provide a way to add to the docker monitor the collector instance

func OptionMergeTags

func OptionMergeTags(tags []string) Options

OptionMergeTags provides a way to add merge tags to be used with New().

func OptionMonitorCNI

func OptionMonitorCNI(
	opts ...CNIMonitorOption,
) Options

OptionMonitorCNI provides a way to add a cni monitor and related configuration to be used with New().

func OptionMonitorDocker

func OptionMonitorDocker(opts ...DockerMonitorOption) Options

OptionMonitorDocker provides a way to add a docker monitor and related configuration to be used with New().

func OptionMonitorKubernetes

func OptionMonitorKubernetes(opts ...KubernetesMonitorOption) Options

OptionMonitorKubernetes provides a way to add a docker monitor and related configuration to be used with New().

func OptionMonitorLinuxHost

func OptionMonitorLinuxHost(
	opts ...LinuxMonitorOption,
) Options

OptionMonitorLinuxHost provides a way to add a linux host monitor and related configuration to be used with New().

func OptionMonitorLinuxProcess

func OptionMonitorLinuxProcess(
	opts ...LinuxMonitorOption,
) Options

OptionMonitorLinuxProcess provides a way to add a linux process monitor and related configuration to be used with New().

func OptionMonitorPod

func OptionMonitorPod(opts ...PodMonitorOption) Options

OptionMonitorPod provides a way to add a Pod monitor and related configuration to be used with New().

func OptionMonitorSSH

func OptionMonitorSSH(
	opts ...LinuxMonitorOption,
) Options

OptionMonitorSSH provides a way to add a SSH monitor and related configuration to be used with New().

func OptionMonitorUID

func OptionMonitorUID(
	opts ...UIDMonitorOption,
) Options

OptionMonitorUID provides a way to add a UID monitor and related configuration to be used with New().

func OptionPolicyResolver

func OptionPolicyResolver(p policy.Resolver) Options

OptionPolicyResolver provides a way to add to the docker monitor the policy resolver instance

type PodMonitorOption

type PodMonitorOption func(*podmonitor.Config)

PodMonitorOption is provided using functional arguments.

func SubOptionMonitorPodActivateHostPods

func SubOptionMonitorPodActivateHostPods(enableHostPods bool) PodMonitorOption

SubOptionMonitorPodActivateHostPods provides a way to specify if we want to activate Pods launched in host mode.

func SubOptionMonitorPodKubeconfig

func SubOptionMonitorPodKubeconfig(kubeconfig string) PodMonitorOption

SubOptionMonitorPodKubeconfig provides a way to specify a kubeconfig to use to connect to Kubernetes. In case of an in-cluter config, leave the kubeconfig field blank

func SubOptionMonitorPodMetadataExtractor

func SubOptionMonitorPodMetadataExtractor(extractor extractors.PodMetadataExtractor) PodMonitorOption

SubOptionMonitorPodMetadataExtractor provides a way to specify metadata extractor for Kubernetes

func SubOptionMonitorPodNetclsProgrammer

func SubOptionMonitorPodNetclsProgrammer(netclsprogrammer extractors.PodNetclsProgrammer) PodMonitorOption

SubOptionMonitorPodNetclsProgrammer provides a way to program the net_cls cgroup for host network pods in Kubernetes

func SubOptionMonitorPodNodename

func SubOptionMonitorPodNodename(nodename string) PodMonitorOption

SubOptionMonitorPodNodename provides a way to specify the kubernetes node name. This is useful for filtering

func SubOptionMonitorPodPidsSetMaxProcsProgrammer

func SubOptionMonitorPodPidsSetMaxProcsProgrammer(pidsprogrammer extractors.PodPidsSetMaxProcsProgrammer) PodMonitorOption

SubOptionMonitorPodPidsSetMaxProcsProgrammer provides a way to program the pids cgroup for pods in Kubernetes

func SubOptionMonitorPodResetNetcls

func SubOptionMonitorPodResetNetcls(resetnetcls extractors.ResetNetclsKubepods) PodMonitorOption

SubOptionMonitorPodResetNetcls provides a way to reset all net_cls cgroups on resync

func SubOptionMonitorPodWorkers

func SubOptionMonitorPodWorkers(workers int) PodMonitorOption

SubOptionMonitorPodWorkers provides a way to specify the maximum number of workers that are used in the controller.

func SubOptionMonitorSandboxExtractor

func SubOptionMonitorSandboxExtractor(extractor extractors.PodSandboxExtractor) PodMonitorOption

SubOptionMonitorSandboxExtractor provides a way to specify metadata extractor for Kubernetes

type UIDMonitorOption

type UIDMonitorOption func(*uidmonitor.Config)

UIDMonitorOption is provided using functional arguments.

func SubOptionMonitorUIDExtractor

func SubOptionMonitorUIDExtractor(extractor extractors.EventMetadataExtractor) UIDMonitorOption

SubOptionMonitorUIDExtractor provides a way to specify metadata extractor for UID monitors.

func SubOptionMonitorUIDRealeaseAgentPath

func SubOptionMonitorUIDRealeaseAgentPath(releasePath string) UIDMonitorOption

SubOptionMonitorUIDRealeaseAgentPath specifies the path to release agent programmed in cgroup

Directories

Path Synopsis
internal
cni
docker/mockdocker
Package mockdocker is a generated GoMock package.
Package mockdocker is a generated GoMock package.
pod
uid
Package mockmonitor is a generated GoMock package.
Package mockmonitor is a generated GoMock package.
mockprocessor
Package mockprocessor is a generated GoMock package.
Package mockprocessor is a generated GoMock package.
remoteapi
client/mockclient
Package mockclient is a generated GoMock package.
Package mockclient is a generated GoMock package.

Jump to

Keyboard shortcuts

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