kubernetes

package
v3.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package kubernetes contains an observer that watches the Kubernetes API for pods that are running on the same node as the agent. It uses the streaming watch API in K8s so that updates are seen immediately without any polling interval.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationConfig

type AnnotationConfig struct {
	AnnotationKey string
	// The type of annotation
	Type string
	// Either the port number or name must be specified
	Port     int32
	PortName string
	// The config key that this will result in when configuring a monitor
	ConfigKey string
	Value     string
}

AnnotationConfig is a generic struct that can describe any of the annotation config values we support.

type AnnotationConfigs

type AnnotationConfigs []*AnnotationConfig

AnnotationConfigs is a slice of AnnotationConfig with some helper methods for filtering.

func (AnnotationConfigs) FilterByPortOrPortName

func (ac AnnotationConfigs) FilterByPortOrPortName(port int32, portName string) (out AnnotationConfigs)

FilterByPortOrPortName returns all AnnotationConfig instances that match either the port number or port name.

type Config

type Config struct {
	config.ObserverConfig
	// Configuration for the K8s API client
	KubernetesAPI *kubernetes.APIConfig `yaml:"kubernetesAPI" default:"{}"`
}

Config for Kubernetes API observer

func (*Config) Validate

func (c *Config) Validate() error

Validate the observer-specific config

type Observer

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

Observer that watches the Kubernetes API for new pods pertaining to this node

func (*Observer) Configure

func (o *Observer) Configure(config *Config) error

Configure configures and starts watching for endpoints

func (*Observer) Shutdown

func (o *Observer) Shutdown()

Shutdown the service differ routine

Jump to

Keyboard shortcuts

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