operator

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAlertmanagerVersion    = "v0.21.0"
	DefaultAlertmanagerBaseImage  = "quay.io/prometheus/alertmanager"
	DefaultAlertmanagerImage      = DefaultAlertmanagerBaseImage + ":" + DefaultAlertmanagerVersion
	DefaultThanosVersion          = "v0.14.0"
	DefaultThanosBaseImage        = "quay.io/thanos/thanos"
	DefaultThanosImage            = DefaultThanosBaseImage + ":" + DefaultThanosVersion
	DefaultConfigMapReloaderImage = "jimmidyson/configmap-reload:v0.4.0"
)

Variables

View Source
var (
	DefaultPrometheusConfigReloaderImage = "quay.io/coreos/prometheus-config-reloader:v" + version.Version

	PrometheusCompatibilityMatrix = []string{
		"v1.4.0",
		"v1.4.1",
		"v1.5.0",
		"v1.5.1",
		"v1.5.2",
		"v1.5.3",
		"v1.6.0",
		"v1.6.1",
		"v1.6.2",
		"v1.6.3",
		"v1.7.0",
		"v1.7.1",
		"v1.7.2",
		"v1.8.0",
		"v2.0.0",
		"v2.2.1",
		"v2.3.1",
		"v2.3.2",
		"v2.4.0",
		"v2.4.1",
		"v2.4.2",
		"v2.4.3",
		"v2.5.0",
		"v2.6.0",
		"v2.6.1",
		"v2.7.0",
		"v2.7.1",
		"v2.7.2",
		"v2.8.1",
		"v2.9.2",
		"v2.10.0",
		"v2.11.0",
		"v2.14.0",
		"v2.15.2",
		"v2.16.0",
		"v2.17.2",
		"v2.18.0",
		"v2.18.1",
		"v2.18.2",
		"v2.19.0",
		"v2.19.1",
		"v2.19.2",
		"v2.20.0",
	}
	DefaultPrometheusVersion   = PrometheusCompatibilityMatrix[len(PrometheusCompatibilityMatrix)-1]
	DefaultPrometheusBaseImage = "quay.io/prometheus/prometheus"
	DefaultPrometheusImage     = DefaultPrometheusBaseImage + ":" + DefaultPrometheusVersion
)

Functions

func BuildImagePath added in v0.41.0

func BuildImagePath(image, version, tag, sha string) (string, error)

BuildImagePath builds a container image path based on the given parameters. If the image contains tag or digest then image will be returned. Inspired by kubernetes code handling of image building.

func MakeVolumeClaimTemplate added in v0.38.2

func NewStoreCollector added in v0.41.0

func NewStoreCollector(resource string, s cache.Store) prometheus.Collector

NewStoreCollector returns a metrics collector that returns the current number of resources in the store.

func NewTLSConfig added in v0.39.0

func NewTLSConfig(logger log.Logger, certFile, keyFile, clientCAFile, minVersion string, cipherSuites []string) (*tls.Config, error)

NewTLSConfig provides new server TLS configuration.

func SanitizeSTS added in v0.37.0

func SanitizeSTS(sts *appsv1.StatefulSet)

SanitizeSTS removes values for APIVersion and Kind from the VolumeClaimTemplates. This prevents update failures due to these fields changing when applied. See https://github.com/kubernetes/kubernetes/issues/87583

func StringPtrValOrDefault added in v0.41.0

func StringPtrValOrDefault(val *string, defaultVal string) string

StringPtrValOrDefault returns the default val if the given string pointer is nil points to an empty/whitespace string. Otherwise returns the value of the string.

func StringValOrDefault added in v0.41.0

func StringValOrDefault(val, defaultVal string) string

StringValOrDefault returns the default val if the given string is empty/whitespace. Otherwise returns the value of the string..

Types

type Metrics added in v0.35.0

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

Metrics represents metrics associated to an operator.

func NewMetrics added in v0.35.0

func NewMetrics(name string, r prometheus.Registerer) *Metrics

NewMetrics initializes operator metrics and registers them with the given registerer. All metrics have a "controller=<name>" label.

func (*Metrics) MustRegister added in v0.35.0

func (m *Metrics) MustRegister(metrics ...prometheus.Collector)

MustRegister registers metrics with the Metrics registerer.

func (*Metrics) NewInstrumentedListerWatcher added in v0.35.0

func (m *Metrics) NewInstrumentedListerWatcher(lw cache.ListerWatcher) cache.ListerWatcher

NewInstrumentedListerWatcher returns a cache.ListerWatcher with instrumentation.

func (*Metrics) ReconcileErrorsCounter added in v0.35.0

func (m *Metrics) ReconcileErrorsCounter() prometheus.Counter

ReconcileErrorsCounter returns a counter to track reconciliation errors.

func (*Metrics) StsDeleteCreateCounter added in v0.35.0

func (m *Metrics) StsDeleteCreateCounter() prometheus.Counter

StsDeleteCreateCounter returns a counter to track statefulset's recreations.

func (*Metrics) TriggerByCounter added in v0.35.0

func (m *Metrics) TriggerByCounter(triggered_by, action string) prometheus.Counter

TriggerByCounter returns a counter to track operator actions by operation (add/delete/update) and action.

type TLSServerConfig added in v0.39.0

type TLSServerConfig struct {
	CertFile       string
	KeyFile        string
	ClientCAFile   string
	MinVersion     string
	CipherSuites   []string
	ReloadInterval time.Duration
}

TLSServerConfig contains the necessary fields to configure web server TLS

Jump to

Keyboard shortcuts

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