Documentation ¶
Index ¶
- type AutoScalingGroup
- type AutoScalingGroupClient
- type AutoscalingGroupUpdater
- type AwsInstance
- type AwsInstances
- func (a *AwsInstances) AppendInstance(o AwsInstance)
- func (a AwsInstances) Count() int
- func (a AwsInstances) DrainNodes() error
- func (a *AwsInstances) GetInstancesForASG(cfg aws.Config, asgName string, awsRegion string, awsProfile string)
- func (a AwsInstances) PrettyPrint()
- func (a AwsInstances) TaintNodes() error
- type Config
- type ConfigClientInterface
- type ConfigGetter
- type UpdateAutoscalingGroupInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoScalingGroup ¶
type AutoScalingGroup struct { Instances AwsInstances DesiredInstances int MinInstances int MaxInstances int AsgName string }
TODO: Improve the modelling of cluster and awsinstances to be in the appropriate packages.
type AutoScalingGroupClient ¶
type AutoScalingGroupClient struct {
Asg AutoScalingGroup
}
func (*AutoScalingGroupClient) UpdateAutoScalingGroupCount ¶
func (a *AutoScalingGroupClient) UpdateAutoScalingGroupCount(ctx context.Context, cfg aws.Config) (*autoscaling.UpdateAutoScalingGroupOutput, error)
type AutoscalingGroupUpdater ¶
type AutoscalingGroupUpdater struct {
UpdateAutoscalingGroupInterface
}
func (*AutoscalingGroupUpdater) Update ¶
func (a *AutoscalingGroupUpdater) Update(ctx context.Context, awsConfig aws.Config) (*autoscaling.UpdateAutoScalingGroupOutput, error)
Update method updates the current ASG count for max to the current desired count to prevent the ASG being drained and tainted to prevent from getting autoscaled during the upgrade process TODO make this general purpose instead of just updating the Max size to current desired size which it is doing right now
type AwsInstance ¶
TODO: Make the domain modelling cleaner and compose the types together which are created alongside one another
type AwsInstances ¶
type AwsInstances []AwsInstance
func (*AwsInstances) AppendInstance ¶
func (a *AwsInstances) AppendInstance(o AwsInstance)
TODO Add a spec for this
func (AwsInstances) Count ¶
func (a AwsInstances) Count() int
Count returns the number of AWS instances currently running in the ASG, a quick way to gather the desired count from instance map created already
func (*AwsInstances) GetInstancesForASG ¶
func (a *AwsInstances) GetInstancesForASG(cfg aws.Config, asgName string, awsRegion string, awsProfile string)
GetInstancesForASG is a helper function, which interacts with the AWS SDK taking the input of the asgname, awsregion and awsprofile and then calls the DescribeAutoScalingGroups API to get the instances of the ASG and then calling the DescribeInstances API to map the private DNS of the instances and then store it, which will then be used to feed kubectl drain command TODO have this method use the generic config getter helper created in internal/api/aws package to reduce duplication TODO break this method into two helper methods TODO add specs for this
type ConfigClientInterface ¶
type ConfigGetter ¶
type ConfigGetter struct {
ConfigClientInterface
}
type UpdateAutoscalingGroupInterface ¶
type UpdateAutoscalingGroupInterface interface {
UpdateAutoScalingGroupCount(ctx context.Context, cfg aws.Config) (*autoscaling.UpdateAutoScalingGroupOutput, error)
}