options

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0, BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// ApiQps for rest client
	ApiQps int
	// ApiBurst for rest  client
	ApiBurst int
	// LeaderElection hold the configurations for manager leader election.
	LeaderElection componentbaseconfig.LeaderElectionConfiguration
	// MetricsAddr is The address the metric endpoint binds to.
	MetricsAddr string
	// BindAddr is The address the probe endpoint binds to.
	BindAddr string

	PredictionUpdateFrequency time.Duration
	// DataSource is the datasource of the predictor, such as prometheus, nodelocal, etc.
	DataSource []string
	// DataSourcePromConfig is the prometheus datasource config
	DataSourcePromConfig providers.PromConfig
	// DataSourceMockConfig is the mock data provider
	DataSourceMockConfig providers.MockConfig
	// DataSourceGrpcConfig is the config for grpc provider
	DataSourceGrpcConfig providers.GrpcConfig

	// AlgorithmModelConfig
	AlgorithmModelConfig config.AlgorithmModelConfig

	// WebhookConfig
	WebhookConfig webhooks.WebhookConfig

	// RecommendationConfigFile is the configuration file for resource/HPA recommendations.
	// If unspecified, a default is provided.
	RecommendationConfigFile string

	// QOSConfigFile is the configuration file for QOS.
	QOSConfigFile string

	// ServerOptions hold the craned web server options
	ServerOptions *ServerOptions

	// EhpaControllerConfig is the configuration for Ehpa controller
	EhpaControllerConfig ehpa.EhpaControllerConfig

	// RecommendationConfiguration is configuration file for recommendation framework.
	// If unspecified, a default is provided.
	RecommendationConfiguration string

	// OOMRecordMaxNumber is the max number for oom record
	OOMRecordMaxNumber int

	// TimeSeriesPredictionMaxConcurrentReconciles is the max concurrent reconciles for TimeSeriesPrediction controller
	TimeSeriesPredictionMaxConcurrentReconciles int

	// CacheUnstructured indicates whether to cache Unstructured objects. When enabled, it will speed up reading Unstructured objects, but will increase memory usage.
	CacheUnstructured bool
}

Options hold the command-line options about craned

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) ApplyTo added in v0.2.0

func (o *Options) ApplyTo(cfg *serverconfig.Config) error

func (*Options) Complete

func (o *Options) Complete() error

Complete completes all the required options.

func (*Options) Validate

func (o *Options) Validate() []error

Validate all required options.

type ServerOptions added in v0.2.0

type ServerOptions struct {
	BindAddress string
	BindPort    int

	EnableProfiling bool
	EnableMetrics   bool
	Mode            string

	EnableGrafana     bool
	GrafanaConfigFile string
	dashboard.GrafanaConfig

	StoreType string
}

ServerOptions used for craned web server

func NewServerOptions added in v0.2.0

func NewServerOptions() *ServerOptions

func (*ServerOptions) AddFlags added in v0.2.0

func (o *ServerOptions) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags related to features for a specific server option to the specified FlagSet.

func (*ServerOptions) ApplyTo added in v0.2.0

func (o *ServerOptions) ApplyTo(cfg *serverconfig.Config) error

func (*ServerOptions) Complete added in v0.2.0

func (o *ServerOptions) Complete() error

func (*ServerOptions) Validate added in v0.2.0

func (o *ServerOptions) Validate() []error

Jump to

Keyboard shortcuts

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