k8smonitor

package
v10.311.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Kubeconfig string
	Nodename   string

	CRIRuntimeService criapi.RuntimeService

	MetadataExtractor extractors.PodMetadataExtractor
}

Config is the config for the Kubernetes monitor

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig provides a default configuration

func SetupDefaultConfig

func SetupDefaultConfig(kubernetesConfig *Config) *Config

SetupDefaultConfig adds defaults to a partial configuration

type K8sMonitor

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

K8sMonitor is the monitor for Kubernetes.

func New

func New(ctx context.Context) *K8sMonitor

New returns a new kubernetes monitor.

func (*K8sMonitor) Event

func (m *K8sMonitor) Event(ctx context.Context, ev common.Event, data interface{}) error

Event will receive event `data` for processing a common.Event in the monitor. The sent data is implementation specific - therefore it has no type in the interface. If the sent data is of an unexpected type, its implementor must return an error indicating so.

func (*K8sMonitor) Resync

func (m *K8sMonitor) Resync(ctx context.Context) error

Resync should resynchronize PUs. This should be done while starting up.

func (*K8sMonitor) Run

func (m *K8sMonitor) Run(ctx context.Context) error

Run starts the monitor implementation.

func (*K8sMonitor) SenderReady

func (m *K8sMonitor) SenderReady()

SenderReady will be called by the sender to notify the receiver that the sender is now ready to send events.

func (*K8sMonitor) SetupConfig

func (m *K8sMonitor) SetupConfig(_ registerer.Registerer, cfg interface{}) error

SetupConfig provides a configuration to implmentations. Every implmentation can have its own config type.

func (*K8sMonitor) SetupHandlers

func (m *K8sMonitor) SetupHandlers(c *config.ProcessorConfig)

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

Jump to

Keyboard shortcuts

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