options

package
v0.0.0-...-9632032 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 17 Imported by: 13

Documentation

Index

Constants

View Source
const (
	DefaultAPIQPS     = 5
	APIQPSBurstFactor = 1.5
)
View Source
const (
	DefaultResyncPeriod = 20 * time.Minute
	DefaultWorkers      = 2
)

Variables

This section is empty.

Functions

func BindGenericControllerFlags

func BindGenericControllerFlags(o *GenericControllerOptions, fs ctrl.FlagSet)

func BindGenericNamespacedControllerFlags

func BindGenericNamespacedControllerFlags(o *GenericNamespacedControllerOptions, fs ctrl.FlagSet)

func BindLeaderElectionFlags

func BindLeaderElectionFlags(component string, o *LeaderElectionOptions, fs ctrl.FlagSet)

func BindLoggerFlags

func BindLoggerFlags(o *LoggerOptions, fs ctrl.FlagSet)

func BindRestClientFlags

func BindRestClientFlags(o *RestClientOptions, fs ctrl.FlagSet)

func DoLeaderElection

func DoLeaderElection(ctx context.Context, logger *zap.Logger, component string, config LeaderElectionOptions, configMapsGetter core_v1client.ConfigMapsGetter, recorder record.EventRecorder) (context.Context, error)

DoLeaderElection starts leader election and blocks until it acquires the lease. Returned context is cancelled once the lease is lost or ctx signals done.

func LoadRestClientConfig

func LoadRestClientConfig(userAgent string, options RestClientOptions) (*rest.Config, error)

func Logger

func Logger(level zapcore.Level, encoder func(zapcore.EncoderConfig) zapcore.Encoder) *zap.Logger

func LoggerFromOptions

func LoggerFromOptions(o LoggerOptions) *zap.Logger

Types

type GenericControllerOptions

type GenericControllerOptions struct {
	ResyncPeriod time.Duration
	Workers      uint
}

func (*GenericControllerOptions) DefaultAndValidate

func (o *GenericControllerOptions) DefaultAndValidate() []error

type GenericNamespacedControllerOptions

type GenericNamespacedControllerOptions struct {
	GenericControllerOptions
	Namespace string
}

type LeaderElectionOptions

type LeaderElectionOptions struct {
	LeaderElect        bool
	LeaseDuration      time.Duration
	RenewDeadline      time.Duration
	RetryPeriod        time.Duration
	ConfigMapNamespace string
	ConfigMapName      string
}

See k8s.io/apiserver/pkg/apis/config/types.go LeaderElectionConfiguration for leader election configuration description.

type LoggerOptions

type LoggerOptions struct {
	LogLevel    string
	LogEncoding string
}

type RestClientOptions

type RestClientOptions struct {
	APIQPS               float64
	ClientConfigFileFrom string
	ClientConfigFileName string
	ClientContext        string
}

func (*RestClientOptions) DefaultAndValidate

func (o *RestClientOptions) DefaultAndValidate() []error

Jump to

Keyboard shortcuts

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