autoscale

package
v0.0.0-...-9f1a7a8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventKind = "autoscale"
)

Variables

This section is empty.

Functions

func DeleteRule

func DeleteRule(metadataFilter string) error

func Initialize

func Initialize() error

func RunOnce

func RunOnce(w io.Writer) error

Types

type Config

type Config struct {
	WaitTimeNewMachine  time.Duration
	RunInterval         time.Duration
	TotalMemoryMetadata string

	Enabled bool
	// contains filtered or unexported fields
}

func CurrentConfig

func CurrentConfig() (*Config, error)

func (*Config) Shutdown

func (a *Config) Shutdown(ctx context.Context) error

func (*Config) String

func (a *Config) String() string

type Event

type Event struct {
	ID            interface{} `bson:"_id"`
	MetadataValue string
	Action        string // scaleActionAdd, scaleActionRemove, scaleActionRebalance
	Reason        string // dependend on scaler
	StartTime     time.Time
	EndTime       time.Time `bson:",omitempty"`
	Successful    bool
	Error         string             `bson:",omitempty"`
	Node          provision.NodeSpec `bson:",omitempty"`
	Log           string             `bson:",omitempty"`
	Nodes         []provision.NodeSpec
}

func ListAutoScaleEvents

func ListAutoScaleEvents(skip, limit int) ([]Event, error)

type EventCustomData

type EventCustomData struct {
	Result *ScalerResult
	Nodes  []provision.NodeSpec
	Rule   *Rule
}

type Rule

type Rule struct {
	MetadataFilter    string `bson:"_id"`
	Error             string `bson:"-"`
	MaxContainerCount int
	ScaleDownRatio    float32
	MaxMemoryRatio    float32
	Enabled           bool
	PreventRebalance  bool
}

func AutoScaleRuleForMetadata

func AutoScaleRuleForMetadata(metadataFilter string) (*Rule, error)

func ListRules

func ListRules() ([]Rule, error)

func (*Rule) Update

func (r *Rule) Update() error

type ScalerResult

type ScalerResult struct {
	ToAdd       int
	ToRemove    []provision.NodeSpec
	ToRebalance bool
	Reason      string
}

func (*ScalerResult) IsRebalanceOnly

func (r *ScalerResult) IsRebalanceOnly() bool

func (*ScalerResult) NoAction

func (r *ScalerResult) NoAction() bool

Jump to

Keyboard shortcuts

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