webhook

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPort = 9443

DefaultPort is the default port that the webhook server serves.

Functions

This section is empty.

Types

type Server added in v0.19.0

type Server struct {
	// Host is the address that the server will listen on.
	// Defaults to "" - all addresses.
	Host string

	// Port is the port number that the server will serve.
	// It will be defaulted to 9443 if unspecified.
	Port int

	// CertDir is the directory that contains the server key and certificate. The
	// server key and certificate.
	CertDir string

	// CertName is the server certificate name. Defaults to tls.crt.
	CertName string

	// KeyName is the server key name. Defaults to tls.key.
	KeyName string

	// ClientCAName is the CA certificate name which server used to verify remote(client)'s certificate.
	// Defaults to "", which means server does not verify client's certificate.
	ClientCAName string

	// TLSVersion is the minimum version of TLS supported. Accepts
	// "", "1.0", "1.1", "1.2" and "1.3" only ("" is equivalent to "1.0" for backwards compatibility)
	TLSMinVersion string

	// CipherSuites is used to specify the cipher algorithms that are negotiated
	// during the TLS handshake, refer to https://pkg.go.dev/crypto/tls#CipherSuites
	CipherSuites []string

	// WebhookMux is the multiplexer that handles different webhooks.
	WebhookMux *http.ServeMux
	// contains filtered or unexported fields
}

Server is an admission webhook server that can serve traffic and generates related k8s resources for deploying.

TLS is required for a webhook to be accessed by kubernetes, so you must provide a CertName and KeyName or have valid cert/key at the default locations (tls.crt and tls.key). If you do not want to configure TLS (i.e for testing purposes) run an admission.StandaloneWebhook in your own server.

NOTE: This has being copied from https://github.com/kubernetes-sigs/controller-runtime/blob/v0.11.1/pkg/webhook/server.go

func (*Server) InjectFunc added in v0.19.0

func (s *Server) InjectFunc(f inject.Func) error

InjectFunc injects the field setter into the server.

func (*Server) NeedLeaderElection added in v0.19.0

func (*Server) NeedLeaderElection() bool

NeedLeaderElection implements the LeaderElectionRunnable interface, which indicates the webhook server doesn't need leader election.

func (*Server) Register added in v0.19.0

func (s *Server) Register(path string, hook http.Handler)

Register marks the given webhook as being served at the given path. It panics if two hooks are registered on the same path.

func (*Server) Start added in v0.19.0

func (s *Server) Start(ctx context.Context) error

Start runs the server. It will install the webhook related resources depend on the server configuration.

func (*Server) StartStandalone added in v0.19.0

func (s *Server) StartStandalone(ctx context.Context, scheme *runtime.Scheme) error

StartStandalone runs a webhook server without a controller manager.

func (*Server) StartedChecker added in v0.19.0

func (s *Server) StartedChecker() healthz.Checker

StartedChecker returns an healthz.Checker which is healthy after the server has been started.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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