minke

package module
v0.0.0-...-670b9e4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 39 Imported by: 0

README

Not even wrong, yet.

Documentation

Overview

Package minke implmenets a minimalist Kubernetes Ingress Controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrometheusMetrics

func NewPrometheusMetrics(r *prometheus.Registry) *prometheusMetricsProvider

func SetProvider

func SetProvider(p MetricsProvider)

Types

type Controller

type Controller struct {
	http.Handler
	// contains filtered or unexported fields
}

Controller is the main thing

func New

func New(client kubernetes.Interface, opts ...Option) (*Controller, error)

New creates a new one

func (*Controller) GetCertificate

func (c *Controller) GetCertificate(info *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate selects a cert from an ingress if one is available.

func (*Controller) GetClientCertificate

func (c *Controller) GetClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error)

GetClientCertificate selects a cert from an ingress if one is available.

func (*Controller) HasSynced

func (c *Controller) HasSynced() bool

func (*Controller) MarshalJSON

func (c *Controller) MarshalJSON() ([]byte, error)

MarshalJSON lets us report the status of the controller

func (*Controller) Run

func (c *Controller) Run(stopCh <-chan struct{})

func (*Controller) ServeLivezHTTP

func (c *Controller) ServeLivezHTTP(w http.ResponseWriter, r *http.Request)

func (*Controller) ServeReadyzHTTP

func (c *Controller) ServeReadyzHTTP(w http.ResponseWriter, r *http.Request)

func (*Controller) ServeStatusHTTP

func (c *Controller) ServeStatusHTTP(w http.ResponseWriter, r *http.Request)

func (*Controller) Stop

func (c *Controller) Stop()

type CounterMetric

type CounterMetric interface {
	Inc()
}

type GaugeMetric

type GaugeMetric interface {
	Set(float64)
}

type MetricsProvider

type MetricsProvider interface {
	NewListsMetric(name string) cache.CounterMetric
	NewListDurationMetric(name string) cache.SummaryMetric
	NewItemsInListMetric(name string) cache.SummaryMetric

	NewWatchesMetric(name string) cache.CounterMetric
	NewShortWatchesMetric(name string) cache.CounterMetric
	NewWatchDurationMetric(name string) cache.SummaryMetric
	NewItemsInWatchMetric(name string) cache.SummaryMetric

	NewLastResourceVersionMetric(name string) cache.GaugeMetric

	NewDepthMetric(name string) workqueue.GaugeMetric
	NewAddsMetric(name string) workqueue.CounterMetric
	NewLatencyMetric(name string) workqueue.HistogramMetric
	NewLongestRunningProcessorSecondsMetric(name string) workqueue.SettableGaugeMetric
	NewUnfinishedWorkSecondsMetric(name string) workqueue.SettableGaugeMetric
	NewWorkDurationMetric(name string) workqueue.HistogramMetric
	NewRetriesMetric(name string) workqueue.CounterMetric
	NewHTTPTransportMetrics(upstream http.RoundTripper) http.RoundTripper
	NewHTTPServerMetrics(upstream http.Handler) http.Handler
}

type Option

type Option func(*Controller) error

Option for setting controller properties

func WithAccessLogFunc

func WithAccessLogFunc(f func(string, ...interface{})) Option

WithAccessLogFunc is an option for setting a log function

func WithClass

func WithClass(cls string) Option

WithClass is an option for setting the class

func WithClientHTTP2Transport

func WithClientHTTP2Transport(t *http2.Transport) Option

func WithClientHTTPTransport

func WithClientHTTPTransport(t *http.Transport) Option

func WithClientTLSSecret

func WithClientTLSSecret(str string) Option

func WithDefaultBackend

func WithDefaultBackend(str string) Option

WithDefaultBackend sets the backend to be used as defaultBackend when none is specified

func WithDefaultHTTPRedirect

func WithDefaultHTTPRedirect(redir bool) Option

WithDefaultHTTPRedirect is an option for setting whether the default behaviour should be to redirect http requests to https

func WithDefaultTLSSecrets

func WithDefaultTLSSecrets(strs ...string) Option

func WithLogFunc

func WithLogFunc(f func(string, ...interface{})) Option

WithLogFunc is an option for setting a log function

func WithMetricsProvider

func WithMetricsProvider(m MetricsProvider) Option

WithMetricsProvider is an option for setting a provider to register and track metrics

func WithNamespace

func WithNamespace(ns string) Option

WithNamespace is an option for setting the set of namespaces to watch

func WithSelector

func WithSelector(s labels.Selector) Option

WithSelector is an option for setting a selector to filter the set of ingresses we will manage

func WithSetQuicHeaders

func WithSetQuicHeaders(f func(http.Header) error) Option

WithSetQuicHeaders is an option for setting a function the is used to set the Quic altSvc header

func WithTracer

func WithTracer(t trace.Tracer) Option

WithTracer is an option for setting a Tracer

type SummaryMetric

type SummaryMetric interface {
	Observe(float64)
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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