scaler

package
v0.2.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeInUse = errors.New("can't remove current node, node is in use")

Functions

This section is empty.

Types

type Metrics

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

Metrics represents metrics associated to a scaler.

func NewMetrics

func NewMetrics() *Metrics

NewMetrics returns a new registered scaler Metrics.

type Options

type Options struct {
	DryRun                                 bool        `config:"dry_run"`
	DisableWorkingHours                    bool        `config:"disable_working_hours"`
	WorkingHoursCronExpressions            string      `config:"working_hours_cron_expressions"`
	ControllerNodeName                     string      `config:"controller_node_name"`
	NodeWithLabel                          string      `config:"nodes_with_label"`
	MaxNodes                               int64       `config:"max_nodes"`
	MinNodesInWorkingHours                 int64       `config:"min_nodes_during_working_hours"`
	ScaleUpThreshold                       int64       `config:"scale_up_threshold"`
	ScaleDownThreshold                     int64       `config:"scale_down_threshold"`
	NodeNumExecutors                       int64       `config:"node_num_executors"`
	ScaleUpGracePeriod                     fs.Duration `config:"scale_up_grace_period"`
	ScaleDownGracePeriod                   fs.Duration `config:"scale_down_grace_period"`
	ScaleDownGracePeriodDuringWorkingHours fs.Duration `config:"scale_down_grace_period_during_working_hours"`
}

func (*Options) Name

func (o *Options) Name() string

type Scaler

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

func New

func New(m configmap.Mapper, bk backend.Backend, l *log.Logger, mtr *Metrics) (*Scaler, error)

New returns a new Scaler.

func (*Scaler) Do

func (s *Scaler) Do(ctx context.Context)

Do run the auto scaler check

func (*Scaler) GC

func (s *Scaler) GC(ctx context.Context)

GC will look for instance that not in jenkins list of nodes aka (zombie) and will try to remove it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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