options

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Injectables = []Injectable{&Options{}}
)

Functions

func ToContext

func ToContext(ctx context.Context, opts *Options) context.Context

Types

type FeatureGates

type FeatureGates struct {
	SpotToSpotConsolidation bool
	// contains filtered or unexported fields
}

func ParseFeatureGates

func ParseFeatureGates(gateStr string) (FeatureGates, error)

type FlagSet

type FlagSet struct {
	*flag.FlagSet
}

func (*FlagSet) BoolVarWithEnv

func (fs *FlagSet) BoolVarWithEnv(p *bool, name string, envVar string, val bool, usage string)

BoolVarWithEnv defines a bool flag with a specified name, default value, usage string, and fallback environment variable.

type Injectable

type Injectable interface {
	// AddFlags adds the injectable's flags to karpenter's flag set
	AddFlags(*FlagSet)
	// Parse parses the flag set and handles any required post-processing on
	// the flags
	Parse(*FlagSet, ...string) error
	// ToContext injects the callee into the given context
	ToContext(context.Context) context.Context
}

Injectable defines a set of flag based options to be parsed and injected into Karpenter's contexts

type Options

type Options struct {
	ServiceName           string
	DisableWebhook        bool
	WebhookPort           int
	MetricsPort           int
	WebhookMetricsPort    int
	HealthProbePort       int
	KubeClientQPS         int
	KubeClientBurst       int
	EnableProfiling       bool
	DisableLeaderElection bool
	MemoryLimit           int64
	LogLevel              string
	LogOutputPaths        string
	LogErrorOutputPaths   string
	BatchMaxDuration      time.Duration
	BatchIdleDuration     time.Duration
	FeatureGates          FeatureGates
}

Options contains all CLI flags / env vars for karpenter-core. It adheres to the options.Injectable interface.

func FromContext

func FromContext(ctx context.Context) *Options

func (*Options) AddFlags

func (o *Options) AddFlags(fs *FlagSet)

func (*Options) Parse

func (o *Options) Parse(fs *FlagSet, args ...string) error

func (*Options) ToContext

func (o *Options) ToContext(ctx context.Context) context.Context

Jump to

Keyboard shortcuts

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