scalex

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package scalex provides primitives for the scaling logic

Index

Constants

View Source
const (
	ReasonScaleDeployment       = "ScaleSuccess"
	ReasonFailedScaleDeployment = "ScaleFail"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Scaler

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

Scaler hold interval and client for scaling logic

func NewScalex

func NewScalex(mgr manager.Manager, interval time.Duration) *Scaler

NewScalex create a new Scaler object It returns the Scaler

func (Scaler) ExecuteScale

func (s Scaler) ExecuteScale(ctx context.Context, scale *oldmonkv1.QueueAutoScaler) (*appsv1.Deployment, int32, error)

ExecuteScale will check the scaling policy and the scale according to the logic It returns the updated deployment,delta and error

func (Scaler) Run

func (s Scaler) Run(ctx context.Context) error

Run create a ticker with a fixed interval It returns the errors

func (Scaler) Worker

func (s Scaler) Worker(jobs chan oldmonkv1.QueueAutoScaler)

Jump to

Keyboard shortcuts

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