autospotting

package
v0.0.0-...-5cdb42e Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2016 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OnDemandPercentageLong is the name of a tag that can be defined on a
	// per-group level for overriding maintained on-demand capacity given as a
	// percentage of the group's running instances.
	OnDemandPercentageLong = "autospotting_on_demand_percentage"

	// OnDemandNumberLong is the name of a tag that can be defined on a
	// per-group level for overriding maintained on-demand capacity given as an
	// absolute number.
	OnDemandNumberLong = "autospotting_on_demand_number"

	// DefaultMinOnDemandValue stores the default on-demand capacity to be kept
	// running in a group managed by autospotting.
	DefaultMinOnDemandValue = 0
)

Variables

This section is empty.

Functions

func Run

func Run(cfg Config)

Run starts processing all AWS regions looking for AutoScaling groups enabled and taking action by replacing more pricy on-demand instances with compatible and cheaper spot instances.

Types

type Config

type Config struct {

	// Static data fetched from ec2instances.info
	RawInstanceData RawInstanceData

	// Logging
	LogFile io.Writer
	LogFlag int

	BuildNumber string

	MinOnDemandNumber     int64
	MinOnDemandPercentage float64
	Regions               string
}

Config contains a number of flags and static data storing the EC2 instance information.

type RawInstanceData

type RawInstanceData []jsonInstance

RawInstanceData is a large data structure containing pricing and hardware information about all the EC2 instance types from all AWS regions.

func (*RawInstanceData) LoadFromAssetContent

func (ii *RawInstanceData) LoadFromAssetContent(contents []byte) error

LoadFromAssetContent loads the RawInstanceData object based on a JSON-encoded contents, injected at build time by go-bindata.

Jump to

Keyboard shortcuts

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