Documentation
¶
Index ¶
- func HandleAdmissionWebhook(webhook controllermanager.Webhook) http.HandlerFunc
- func ListenAndServeHTTP(ctx context.Context, config *configv1alpha1.HTTPSpec, ...) error
- func ListenAndServeWebhooks(ctx context.Context, config *configv1alpha1.WebhookServerSpec, ...) error
- func ServeDebug(mux *http.ServeMux, cfg *configv1alpha1.HTTPDebugSpec, handler DebugHandler)
- func ServeHealth(mux *http.ServeMux, cfg *configv1alpha1.HTTPHealthSpec, handler HealthHandler)
- func ServeMetrics(mux *http.ServeMux, cfg *configv1alpha1.HTTPMetricsSpec, ...)
- func ServePprof(mux *http.ServeMux, cfg *configv1alpha1.HTTPPprofSpec)
- func ServeWebhooks(mux *http.ServeMux, webhooks []controllermanager.Webhook)
- type DebugHandler
- type HealthHandler
- type ListeningServer
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAdmissionWebhook ¶
func HandleAdmissionWebhook(webhook controllermanager.Webhook) http.HandlerFunc
HandleAdmissionWebhook returns a http.HandlerFunc for a Webhook.
func ListenAndServeHTTP ¶ added in v0.3.0
func ListenAndServeHTTP( ctx context.Context, config *configv1alpha1.HTTPSpec, healthHandler HealthHandler, bootstrapConfig runtime.Object, configsGetter controllercontext.Configs, ) error
ListenAndServeHTTP listens on the given TCP address and gracefully stops when the given context is canceled, setting up all HTTP handlers.
func ListenAndServeWebhooks ¶
func ListenAndServeWebhooks( ctx context.Context, config *configv1alpha1.WebhookServerSpec, webhooks []controllermanager.Webhook, ) error
ListenAndServeWebhooks listens on the given TCP address and gracefully stops when the given context is canceled, setting up all webhooks handlers.
func ServeDebug ¶ added in v0.3.0
func ServeDebug(mux *http.ServeMux, cfg *configv1alpha1.HTTPDebugSpec, handler DebugHandler)
ServeDebug adds debug handlers to the given serve mux.
func ServeHealth ¶
func ServeHealth(mux *http.ServeMux, cfg *configv1alpha1.HTTPHealthSpec, handler HealthHandler)
ServeHealth adds health probe handlers to the given serve mux.
func ServeMetrics ¶
func ServeMetrics(mux *http.ServeMux, cfg *configv1alpha1.HTTPMetricsSpec, registry prometheus.Gatherer)
ServeMetrics adds Prometheus metrics handlers to the given serve mux.
func ServePprof ¶ added in v0.3.0
func ServePprof(mux *http.ServeMux, cfg *configv1alpha1.HTTPPprofSpec)
ServePprof adds the pprof debug handler to the given serve mux.
func ServeWebhooks ¶
func ServeWebhooks(mux *http.ServeMux, webhooks []controllermanager.Webhook)
ServeWebhooks prepares admission webhooks to be served. TODO(irvinlim): Handle conversion webhooks here in the future too.
Types ¶
type DebugHandler ¶ added in v0.3.0
type DebugHandler interface { GetBootstrapConfig() runtime.Object GetDynamicConfig() (map[configv1alpha1.ConfigName]runtime.Object, error) }
DebugHandler is a delegate to fetch debug information.
type HealthHandler ¶ added in v0.3.0
type HealthHandler interface { GetReadiness() error GetHealth() []controllermanager.HealthStatus }
HealthHandler is a delegate to get health information.
type ListeningServer ¶ added in v0.3.0
ListeningServer is implemented by both http.Server (HTTP) and tlsServer (HTTPS).
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a thin wrapper around HTTP servers.
func (*Server) Handle ¶ added in v0.3.0
Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics.
func (*Server) ListenAndServe ¶
ListenAndServe will listen and serve incoming HTTP connections until the context is closed.
func (*Server) RegisterCommonHandlers ¶ added in v0.3.0
func (s *Server) RegisterCommonHandlers( cfg *configv1alpha1.HTTPSpec, registry prometheus.Gatherer, healthHandler HealthHandler, debugHandler DebugHandler, )
RegisterCommonHandlers registers common handlers from the given HTTPSpec.