canary

package
v0.0.0-...-b7d42a2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// CanaryRouteRotationAnnotation is an annotation on the default ingress controller
	// that specifies whether or not the canary check loop should periodically rotate
	// the endpoints of the canary route. Canary route rotation is disabled by default
	// to prevent router reloads from impacting ingress performance periodically.
	// Canary route rotation is enabled when the canary route rotation annotation has
	// a value of "true" (disabled otherwise).
	CanaryRouteRotationAnnotation = "ingress.operator.openshift.io/rotate-canary-route"

	// CanaryHealthcheckCommand is a parameter to pass to the ingress-operator to call
	// into the handler for the canary daemonset health check
	CanaryHealthcheckCommand = "serve-healthcheck"
	// CanaryHealthcheckResponse is the message that signals a successful health check
	CanaryHealthcheckResponse = "Healthcheck requested"
)

Variables

View Source
var (
	CanaryRequestTime = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "ingress_canary_check_duration",
			Help:    "Canary endpoint request time in ms",
			Buckets: []float64{25, 50, 100, 200, 400, 800, 1600},
		}, []string{"host"})

	CanaryEndpointWrongPortEcho = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: "ingress_canary_endpoint_wrong_port_echo",
			Help: "The ingress canary application received a test request on an incorrect port which may indicate that the router is \"wedged\"",
		})

	CanaryRouteReachable = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "ingress_canary_route_reachable",
			Help: "A gauge set to 0 or 1 to signify whether or not the canary application is reachable via a route",
		}, []string{"host"})

	CanaryRouteDNSError = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "ingress_canary_route_DNS_error",
			Help: "A counter tracking canary route DNS lookup errors",
		}, []string{"host", "dnsServer"})
)

Functions

func New

func New(mgr manager.Manager, config Config) (controller.Controller, error)

New creates the canary controller.

The canary controller will watch the Default IngressController, as well as the canary service, daemonset, and route resources.

func RegisterMetrics

func RegisterMetrics() error

RegisterMetrics calls prometheus.Register on each metric in metricsList, and returns on errors.

func SetCanaryRouteReachableMetric

func SetCanaryRouteReachableMetric(host string, status bool)

SetCanaryRouteMetric is a wrapper function to mark the canary route as either online or offline.

Types

type Config

type Config struct {
	Namespace   string
	CanaryImage string
	Stop        chan struct{}
}

Config holds all the things necessary for the controller to run.

Jump to

Keyboard shortcuts

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