Documentation
¶
Index ¶
- type ASG
- type ASGSet
- func (a *ASGSet) GetActualBadCounts() []*ASG
- func (a *ASGSet) GetBestOldInstance() *Instance
- func (a *ASGSet) GetDivergedASGs() []*ASG
- func (a *ASGSet) GetHealthyNewInstances() []*Instance
- func (a *ASGSet) GetHealthyOldInstances() []*Instance
- func (a *ASGSet) GetImmutableInstances() []*Instance
- func (a *ASGSet) GetNewInstances() []*Instance
- func (a *ASGSet) GetOldInstances() []*Instance
- func (a *ASGSet) GetTerminatingInstances() []*Instance
- func (a *ASGSet) GetUnHealthyOldInstances() []*Instance
- func (a *ASGSet) GetUnhealthyNewInstances() []*Instance
- func (a *ASGSet) IsCountMismatch() bool
- func (a *ASGSet) IsImmutableAutoscalingEvent() bool
- func (a *ASGSet) IsNewInstance() bool
- func (a *ASGSet) IsNewUnhealthy() bool
- func (a *ASGSet) IsOldInstance() bool
- func (a *ASGSet) IsTerminating() bool
- func (a *ASGSet) IsTransient() bool
- type BaseRunner
- func (r *BaseRunner) KillInstance(ctx context.Context, inst *Instance, decrement *bool) error
- func (r *BaseRunner) NewASGSet(ctx context.Context) (*ASGSet, error)
- func (r *BaseRunner) NewContext() (context.Context, context.CancelFunc)
- func (r *BaseRunner) SetDesiredCapacity(ctx context.Context, asg *ASG, desiredCapacity *int32) error
- func (r *BaseRunner) Sleep(ctx context.Context)
- type DesiredASG
- type Instance
- type RunnerOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASG ¶
type ASG struct { ASG *at.AutoScalingGroup Instances []*Instance DesiredASG *DesiredASG }
ASG object holds a pointer to an ASG and its Instances
type ASGSet ¶
type ASGSet struct {
ASGs []*ASG
}
ASGSet has a slice of ASG objects and some functions against them This object is recomputed every run of bouncer because it takes actual instance status into account
func (*ASGSet) GetActualBadCounts ¶
GetActualBadCounts returns all ASGs whose desired counts don't match their actual counts
func (*ASGSet) GetBestOldInstance ¶
GetBestOldInstance returns the instance which is the best candidate to be bounced
func (*ASGSet) GetDivergedASGs ¶
GetDivergedASGs returns all ASGs whose desired counts don't match what their desired counts should be
func (*ASGSet) GetHealthyNewInstances ¶ added in v0.16.0
GetHealthyNewInstances returns all instances which are on the latest launch configuration and are Healthy
func (*ASGSet) GetHealthyOldInstances ¶ added in v0.16.0
GetHealthyOldInstances returns all instances which are old and are Healthy
func (*ASGSet) GetImmutableInstances ¶
GetImmutableInstances returns instances which are in autoscaling events that we can't manipulate by completing lifecycle actions
func (*ASGSet) GetNewInstances ¶
GetNewInstances returns all instances which are on an outdated launch configuration
func (*ASGSet) GetOldInstances ¶
GetOldInstances returns all instances which are on an outdated launch configuration
func (*ASGSet) GetTerminatingInstances ¶
GetTerminatingInstances returns all instances which are in the process of terminating
func (*ASGSet) GetUnHealthyOldInstances ¶ added in v0.16.0
GetUnHealthyOldInstances returns all instances which are old and are UnHealthy
func (*ASGSet) GetUnhealthyNewInstances ¶
GetUnhealthyNewInstances returns all instances which are on the latest launch configuration but are unhealthy
func (*ASGSet) IsCountMismatch ¶
IsCountMismatch prints all instances whose desired_capacity doesn't match running instances and returns true/false whether it found any
func (*ASGSet) IsImmutableAutoscalingEvent ¶
IsImmutableAutoscalingEvent prints all instances who are in a state we can't affect and returns true/false whether it found any
func (*ASGSet) IsNewInstance ¶
IsNewInstance prints all new instances and returns true/false whether it found any
func (*ASGSet) IsNewUnhealthy ¶
IsNewUnhealthy prints all instances who are running latest LC but not yet healthy and returns true/false whether it found any
func (*ASGSet) IsOldInstance ¶
IsOldInstance prints all old instances and returns true/false whether it found any
func (*ASGSet) IsTerminating ¶
IsTerminating prints all instances in the process of terminating and returns true/false whether it found any
func (*ASGSet) IsTransient ¶ added in v0.10.0
IsTransient returns true if there are any ASGs in the set that have any instances in flight, or are waiting for their capacity to fill the desired
type BaseRunner ¶
type BaseRunner struct { Opts *RunnerOpts // contains filtered or unexported fields }
BaseRunner is the base struct for any runner
func NewBaseRunner ¶
func NewBaseRunner(ctx context.Context, opts *RunnerOpts) (*BaseRunner, error)
NewBaseRunner instantiates a BaseRunner
func (*BaseRunner) KillInstance ¶
KillInstance calls TerminateInstanceInAutoscalingGroup, or, if the instance is stuck in a lifecycle hook, issues an ABANDON to it, killing it more forcefully
func (*BaseRunner) NewASGSet ¶
func (r *BaseRunner) NewASGSet(ctx context.Context) (*ASGSet, error)
NewASGSet returns an ASGSet pointer
func (*BaseRunner) NewContext ¶ added in v0.14.0
func (r *BaseRunner) NewContext() (context.Context, context.CancelFunc)
NewContext generates a context with the ItemTimeout from the parent context given
func (*BaseRunner) SetDesiredCapacity ¶
func (r *BaseRunner) SetDesiredCapacity(ctx context.Context, asg *ASG, desiredCapacity *int32) error
SetDesiredCapacity Updates desired capacity of ASG This function should only be used to increase desired cap, not decrease, since AWS will _always_ remove instances based on AZ before any other criteria http://docs.aws.amazon.com/autoscaling/latest/userguide/as-instance-termination.html
func (*BaseRunner) Sleep ¶
func (r *BaseRunner) Sleep(ctx context.Context)
Sleep makes us sleep for the constant time - call this when waiting for an AWS change
type DesiredASG ¶
type DesiredASG struct { AsgName string DesiredCapacity int32 // PreTerminateCmd is the external process that needs to be run before terminating an instance in this ASG PreTerminateCmd *string }
DesiredASG contains pieces of the ASG as they _should_ be, but at any given time, since we twiddle the desired capacity, may not _actually_ be.
func ExtractDesiredASG ¶ added in v0.16.0
func ExtractDesiredASG(asgItem string, defaultDesired *int32, preTerminateCmd *string) (*DesiredASG, error)
ExtractDesiredASG takes in a separator-separated string of asgname and desired capacity, and returns a DesiredASG pointer