options

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintFlags

func PrintFlags(flags *pflag.FlagSet)

PrintFlags logs the flags in the flagset

Types

type Options

type Options struct {
	// BindAddress is the IP address on which to listen for the --secure-port port.
	// Default is "0.0.0.0".
	BindAddress string
	// SecurePort is the port that the webhook server serves at.
	// Default is 8443.
	SecurePort int
	// MetricsBindAddress is the IP:Port address on which to listen for the webhook metrics.
	// Default is ":8080".
	MetricsBindAddress string
	// CertDir is the directory that contains the server key and certificate.
	// if not set, webhook server would look up the server key and certificate in {TempDir}/k8s-webhook-server/serving-certs.
	// The server key and certificate must be named `tls.key` and `tls.crt`, respectively.
	CertDir string
	// TLSMinVersion is the minimum version of TLS supported. Possible values: 1.0, 1.1, 1.2, 1.3.
	// Some environments have automated security scans that trigger on TLS versions or insecure cipher suites, and
	// setting TLS to 1.3 would solve both problems.
	// Defaults to 1.3.
	TLSMinVersion string
	// KubeAPIQPS is the QPS to use while talking with kube-apiserver.
	KubeAPIQPS float32
	// KubeAPIBurst is the burst to allow while talking with kube-apiserver.
	KubeAPIBurst int
	// PreCacheResources is a list of resources name to pre-cache when start up.
	PreCacheResources *ResourceSlice
	// EnablePProf is switch to enable/disable net/http/pprof. Default value as false.
	EnablePProf bool
}

Options contains everything necessary to create and run webhook server.

func NewOptions

func NewOptions() *Options

NewOptions builds an empty options.

func (*Options) AddFlags

func (o *Options) AddFlags(flags *pflag.FlagSet)

AddFlags adds flags to the specified FlagSet.

func (*Options) PreCacheResourcesToGVKList added in v0.2.3

func (o *Options) PreCacheResourcesToGVKList() []schema.GroupVersionKind

func (*Options) Validate

func (o *Options) Validate() field.ErrorList

Validate checks Options and return a slice of found errs.

type ResourceSlice added in v0.2.4

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

func NewPreCacheResources added in v0.2.4

func NewPreCacheResources(slice []string) *ResourceSlice

func (*ResourceSlice) Append added in v0.2.4

func (s *ResourceSlice) Append(val string) error

func (*ResourceSlice) GetSlice added in v0.2.4

func (s *ResourceSlice) GetSlice() []string

func (*ResourceSlice) Replace added in v0.2.4

func (s *ResourceSlice) Replace(slice []string) error

func (*ResourceSlice) Set added in v0.2.4

func (s *ResourceSlice) Set(val string) error

func (*ResourceSlice) String added in v0.2.4

func (s *ResourceSlice) String() string

func (*ResourceSlice) Type added in v0.2.4

func (s *ResourceSlice) Type() string

Jump to

Keyboard shortcuts

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