kube

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations map[string]string

Annotations stores ose related annotations

type Config

type Config struct {
	Kubeconfig          string `yaml:"kubeconfig"`
	NamespaceBlackRegex string `yaml:"namespace_blacklist_regex"`
	Labels              Labels `yaml:"labels"`
}

Config to create a watcher

type Labels

type Labels map[string]string

Labels stores kubernetes labels

type MultiWatcher

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

MultiWatcher allows to watch multiple clusters in the same channel

func NewMultiWatcher

func NewMultiWatcher(configs []Config) (mw *MultiWatcher, err error)

NewMultiWatcher creates a watcher for multiple configs into one chan

func (*MultiWatcher) List

func (mw *MultiWatcher) List() (routes []*Route)

List availibe Routes

func (*MultiWatcher) Watch

func (mw *MultiWatcher) Watch(ctx context.Context)

Watch nonblocking all Watchers and throw them into a single mw.Sink

type ProbeInfo

type ProbeInfo struct {
	Skip bool

	SSL   bool
	Host  string
	Proto string
	Path  string

	Name      string
	Namespace string

	Method           string
	ValidStatusCodes []string
	BodyRegex        string

	Cluster string
	UID     string
}

ProbeInfo

func (*ProbeInfo) URL

func (pi *ProbeInfo) URL() string

type RequestMetrics

type RequestMetrics struct {
	*ProbeInfo

	Start         time.Time
	Resolved      time.Duration
	Connected     time.Duration
	WroteRequest  time.Duration
	ReadFirstByte time.Duration
	ReadBody      time.Duration
	Expires       time.Time
	Size          int64
	RedirectCount int64

	InvalidRouteErr      bool
	InvalidRequestErr    bool
	ConnectionErr        bool
	BodyDownloadErr      bool
	InvalidStatusCodeErr bool
	InvalidBodyRegexErr  bool
	InvalidBodyErr       bool
}

RequestMetrics

type ResourceEventHandlerFuncs

type ResourceEventHandlerFuncs struct {
	AddFunc    func(obj *Route)
	UpdateFunc func(oldObj, newObj *Route)
	DeleteFunc func(obj *Route)
}

ResourceEventHandlerFuncs is an adaptor to let you easily specify as many or as few of the notification functions as you want while still implementing ResourceEventHandler.

type Route

type Route struct {
	*routev1.Route
	ClusterName string
}

Route is an openshift route

func (*Route) Probe

func (r *Route) Probe(ctx context.Context) (m *RequestMetrics)

Probe gathers the metrics for a route

type Watcher

type Watcher struct {
	Labels              Labels
	NamespaceBlackRegex *regexp.Regexp
	// contains filtered or unexported fields
}

Watcher watcher monitors a cluster for route events

func NewWatcher

func NewWatcher(c Config) (w *Watcher, err error)

NewWatcher crates a Wachter

func (*Watcher) List

func (w *Watcher) List() (routes []*Route)

List availibe Routes

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context)

Watch nonblocking all events from openshift and throw them into c

Jump to

Keyboard shortcuts

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