Documentation
¶
Index ¶
- func CheckCanaryVersion(tgs []*string, region string) int
- func CheckRegionExist(target string, regions []schemas.RegionConfig) bool
- func IfEmptyAutoscalingGroup(desired int64, instances []*autoscaling.Instance) bool
- func IsFinishedRollingUpdate(current schemas.Capacity, target schemas.Capacity) bool
- func MakeCapacity(min, max, desired int64) (*schemas.Capacity, error)
- func NeedToInitializeCapacity(mode string, completeCanary bool) bool
- func RetrieveNextCapacity(capacity *schemas.Capacity, targetCapacity schemas.Capacity, ...) error
- type APIAttacker
- type BlueGreen
- func (b *BlueGreen) CheckPreviousResources(config schemas.Config) error
- func (b *BlueGreen) CleanChecking(config schemas.Config) error
- func (b *BlueGreen) CleanPreviousVersion(config schemas.Config) error
- func (b *BlueGreen) Deploy(config schemas.Config) error
- func (b *BlueGreen) FinishAdditionalWork(config schemas.Config) error
- func (b *BlueGreen) GatherMetrics(config schemas.Config) error
- func (b *BlueGreen) GetDeployer() *Deployer
- func (b *BlueGreen) HealthChecking(config schemas.Config) error
- func (b *BlueGreen) RunAPITest(config schemas.Config) error
- func (b *BlueGreen) TriggerLifecycleCallbacks(config schemas.Config) error
- type Canary
- func (c *Canary) AttachCanaryTargetGroup(lbArn, tgArn string, region schemas.RegionConfig) error
- func (c *Canary) AttachToOriginalTargetGroups(config schemas.Config) error
- func (c *Canary) ChangeLaunchTemplateVersion(asg string, lt *autoscaling.LaunchTemplateSpecification, ...) error
- func (c *Canary) ChangeTargetGroupInfo(newTgName string, region schemas.RegionConfig) schemas.RegionConfig
- func (c *Canary) CheckPreviousResources(config schemas.Config) error
- func (c *Canary) CheckValidCanaryLB(app, lb string) bool
- func (c *Canary) CleanChecking(config schemas.Config) error
- func (c *Canary) CleanPreviousCanaryResources(region schemas.RegionConfig, completeCanary bool) error
- func (c *Canary) CleanPreviousVersion(config schemas.Config) error
- func (c *Canary) CompleteCanaryDeployment(config schemas.Config, region schemas.RegionConfig, latestASG string) error
- func (c *Canary) CopyTargetGroups(tg *elbv2.TargetGroup, canaryTgName, region string) (*elbv2.TargetGroup, error)
- func (c *Canary) CreateCanaryLBSecurityGroup(tg *elbv2.TargetGroup, region schemas.RegionConfig) (*string, error)
- func (c *Canary) CreateCanaryLoadBalancer(region schemas.RegionConfig, groupID *string) (*elbv2.LoadBalancer, error)
- func (c *Canary) DeleteEC2IngressRules(region schemas.RegionConfig) error
- func (c *Canary) DeleteEC2SecurityGroup(region schemas.RegionConfig) error
- func (c *Canary) DeleteLBSecurityGroup(region schemas.RegionConfig) error
- func (c *Canary) DeleteLoadBalancer(region schemas.RegionConfig) error
- func (c *Canary) Deploy(config schemas.Config) error
- func (c *Canary) DetachCanaryTargetGroup(asg string, region schemas.RegionConfig, tgs []*string) error
- func (c *Canary) DetachSecurityGroup(nis []*ec2.InstanceNetworkInterface, region schemas.RegionConfig, ...) error
- func (c *Canary) FindCanaryLoadBalancer(region schemas.RegionConfig) (*elbv2.LoadBalancer, error)
- func (c *Canary) FinishAdditionalWork(config schemas.Config) error
- func (c *Canary) GatherMetrics(config schemas.Config) error
- func (c *Canary) GenerateCanaryLBSecurityGroupName(region string) string
- func (c *Canary) GenerateCanaryLoadBalancerName(region string) string
- func (c *Canary) GenerateCanarySecurityGroupName(region string) string
- func (c *Canary) GenerateCanaryTargetGroupName(canaryVersion int) string
- func (c *Canary) GetAsgTargetGroups(asg, region string) ([]*string, error)
- func (c *Canary) GetCanaryLoadBalancerSecurityGroup(region schemas.RegionConfig) (*string, error)
- func (c *Canary) GetDeployer() *Deployer
- func (c *Canary) GetEC2CanarySecurityGroup(tg *elbv2.TargetGroup, region schemas.RegionConfig, lbSg *string, ...) error
- func (c *Canary) GetLoadBalancerAndSecurityGroupForCanary(region schemas.RegionConfig, tgDetail *elbv2.TargetGroup, completeCanary bool) (*string, *elbv2.LoadBalancer, error)
- func (c *Canary) HealthChecking(config schemas.Config) error
- func (c *Canary) LoadBalancerDeletionChecking(region schemas.RegionConfig) error
- func (c *Canary) ReduceOriginalAutoscalingGroupCount(region schemas.RegionConfig) error
- func (c *Canary) RemoveCanaryTag(asg string, region schemas.RegionConfig) error
- func (c *Canary) RunAPITest(config schemas.Config) error
- func (c *Canary) RunCanaryDeployment(config schemas.Config, region schemas.RegionConfig, ...) (schemas.RegionConfig, error)
- func (c *Canary) SelectTargetGroupForCopy(region schemas.RegionConfig, canaryVersion int) string
- func (c *Canary) TriggerLifecycleCallbacks(config schemas.Config) error
- func (c *Canary) ValidateCanaryDeployment(config schemas.Config, region string) error
- type DeployManager
- type DeployOnly
- func (d *DeployOnly) CheckPreviousResources(config schemas.Config) error
- func (d *DeployOnly) CleanChecking(config schemas.Config) error
- func (d *DeployOnly) CleanPreviousVersion(config schemas.Config) error
- func (d *DeployOnly) Deploy(config schemas.Config) error
- func (d *DeployOnly) FinishAdditionalWork(config schemas.Config) error
- func (d *DeployOnly) GatherMetrics(config schemas.Config) error
- func (d *DeployOnly) GetDeployer() *Deployer
- func (d *DeployOnly) HealthChecking(_ schemas.Config) error
- func (d *DeployOnly) RunAPITest(config schemas.Config) error
- func (d *DeployOnly) TriggerLifecycleCallbacks(config schemas.Config) error
- type Deployer
- func (d *Deployer) CheckAutoscalingInstanceCount(client aws.Client, asg string, desired int) (bool, error)
- func (d *Deployer) CheckPrevious(config schemas.Config) error
- func (d *Deployer) CheckTerminating(client aws.Client, target string, disableMetrics bool) bool
- func (d *Deployer) CleanAutoscalingSet(client aws.Client, target string) error
- func (d *Deployer) CleanChecking(config schemas.Config) (bool, error)
- func (d *Deployer) CleanPreviousAutoScalingGroup(config schemas.Config) error
- func (d *Deployer) ClearResources(client aws.Client, target string, disableMetrics bool) bool
- func (d *Deployer) CompareWithCurrentCapacity(forceManifestCapacity bool, region string) schemas.Capacity
- func (d *Deployer) DecideCapacity(forceManifestCapacity, completeCanary bool, region string, prevAsgCount int, ...) (schemas.Capacity, error)
- func (d *Deployer) Deploy(config schemas.Config, region schemas.RegionConfig) error
- func (d *Deployer) DescribeAutoScalingGroup(asg, region string) (*autoscaling.Group, error)
- func (d *Deployer) DescribeInstances(instanceIds []*string, region schemas.RegionConfig) ([]*ec2.Instance, error)
- func (d *Deployer) DescribeTargetGroup(targetGroup string, region string) (*elbv2.TargetGroup, error)
- func (d *Deployer) DoCommonAdditionalWork(config schemas.Config) error
- func (d *Deployer) GatherMetrics(client aws.Client, asg string) error
- func (d *Deployer) GenerateAPIAttacker(template schemas.APITestTemplate) (*APIAttacker, error)
- func (d *Deployer) GenerateTags(asgName, stack string, extraTags, ansibleExtraVars, region string) []*autoscaling.Tag
- func (d *Deployer) GetStackName() string
- func (d *Deployer) GetTargetGroupNames(region schemas.RegionConfig) []string
- func (d *Deployer) GetValidHostCount(targetHosts []aws.HealthcheckHost) int64
- func (d *Deployer) HealthChecking(config schemas.Config) (bool, error)
- func (d *Deployer) Polling(region schemas.RegionConfig, asg *autoscaling.Group, client aws.Client, ...) (bool, error)
- func (d *Deployer) ReducePreviousAutoScalingGroupCapacity(region string, decreaseCnt int64) (bool, error)
- func (d *Deployer) ResizingAutoScalingGroup(asg, region string, capacity schemas.Capacity) error
- func (d *Deployer) ResizingAutoScalingGroupCount(client aws.Client, asg string, count int64) error
- func (d *Deployer) RunAPITest(config schemas.Config) error
- func (d *Deployer) RunLifecycleCallbacks(client aws.Client, region string) bool
- func (d *Deployer) SkipDeployStep()
- func (d *Deployer) StartGatheringMetrics(config schemas.Config) error
- func (d *Deployer) TriggerLifecycleCallbacks(config schemas.Config) error
- type RollingUpdate
- func (r *RollingUpdate) CheckPreviousResources(config schemas.Config) error
- func (r *RollingUpdate) CleanChecking(config schemas.Config) error
- func (r *RollingUpdate) CleanPreviousVersion(config schemas.Config) error
- func (r *RollingUpdate) CompleteRollingUpdate(config schemas.Config, region schemas.RegionConfig) error
- func (r *RollingUpdate) Deploy(config schemas.Config) error
- func (r *RollingUpdate) FinishAdditionalWork(config schemas.Config) error
- func (r *RollingUpdate) GatherMetrics(config schemas.Config) error
- func (r *RollingUpdate) GetDeployer() *Deployer
- func (r *RollingUpdate) HealthChecking(config schemas.Config) error
- func (r *RollingUpdate) RunAPITest(config schemas.Config) error
- func (r *RollingUpdate) TriggerLifecycleCallbacks(config schemas.Config) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCanaryVersion ¶
CheckCanaryVersion checks latest version of canary target group
func CheckRegionExist ¶
func CheckRegionExist(target string, regions []schemas.RegionConfig) bool
CheckRegionExist checks if target region is really in regions described in manifest file
func IfEmptyAutoscalingGroup ¶
func IfEmptyAutoscalingGroup(desired int64, instances []*autoscaling.Instance) bool
IfEmptyAutoscalingGroup
func IsFinishedRollingUpdate ¶
IsFinishedRollingUpdate checks if rolling update is done or not
func MakeCapacity ¶
MakeCapacity makes capacity object with min,max,desired
func NeedToInitializeCapacity ¶
NeedToInitializeCapacity checks if deployment process needs initialized capacity If this value is true, then capacity will be adjusted to min: 1,desired: 1,max: 1
Types ¶
type APIAttacker ¶
type APIAttacker struct { Name string Attacker *vegeta.Attacker Rate vegeta.Rate Duration time.Duration Targets []vegeta.Target }
func (APIAttacker) Print ¶
func (a APIAttacker) Print(metrics []schemas.MetricResult) (string, error)
Print shows results
func (APIAttacker) Run ¶
func (a APIAttacker) Run() ([]schemas.MetricResult, error)
Run calls apis to check
type BlueGreen ¶
type BlueGreen struct {
*Deployer
}
func NewBlueGreen ¶
func NewBlueGreen(h *helper.DeployerHelper) *BlueGreen
NewBlueGreen creates new BlueGreen deployment deployer
func (*BlueGreen) CheckPreviousResources ¶
CheckPreviousResources checks if there is any previous version of autoscaling group
func (*BlueGreen) CleanChecking ¶
CleanChecking checks Termination status
func (*BlueGreen) CleanPreviousVersion ¶
CleanPreviousVersion cleans previous version of autoscaling group
func (*BlueGreen) FinishAdditionalWork ¶
FinishAdditionalWork processes additional work for the new deployment
func (*BlueGreen) GatherMetrics ¶
GatherMetrics gathers the whole metrics from deployer
func (*BlueGreen) GetDeployer ¶
GetDeployer returns Deployer struct
func (*BlueGreen) HealthChecking ¶
HealthChecking does health checking for blue-green deployment
func (*BlueGreen) RunAPITest ¶
RunAPITest tries to run API Test
type Canary ¶
type Canary struct { PrevTargetGroups map[string][]string TargetGroups map[string][]*string PrevHealthCheckTargetGroups map[string]string LoadBalancer map[string]string LBSecurityGroup map[string]*string *Deployer }
func NewCanary ¶
func NewCanary(h *helper.DeployerHelper) *Canary
NewCanary creates new canary deployment deployer
func (*Canary) AttachCanaryTargetGroup ¶
func (c *Canary) AttachCanaryTargetGroup(lbArn, tgArn string, region schemas.RegionConfig) error
AttachCanaryTargetGroup attaches target group to load balancer
func (*Canary) AttachToOriginalTargetGroups ¶
AttachToOriginalTargetGroups attaches the new autoscaling group to original target groups
func (*Canary) ChangeLaunchTemplateVersion ¶
func (c *Canary) ChangeLaunchTemplateVersion(asg string, lt *autoscaling.LaunchTemplateSpecification, region schemas.RegionConfig, excludeSg string) error
ChangeLaunchTemplateVersion changes launch template to the new version
func (*Canary) ChangeTargetGroupInfo ¶
func (c *Canary) ChangeTargetGroupInfo(newTgName string, region schemas.RegionConfig) schemas.RegionConfig
ChangeTargetGroupInfo changes existing target group to the new one for canary deployment
func (*Canary) CheckPreviousResources ¶
CheckPreviousResources checks if there is any previous version of autoscaling group
func (*Canary) CheckValidCanaryLB ¶
CheckValidCanaryLB checks if load balancer is canary-related or not
func (*Canary) CleanChecking ¶
CleanChecking checks Termination status
func (*Canary) CleanPreviousCanaryResources ¶
func (c *Canary) CleanPreviousCanaryResources(region schemas.RegionConfig, completeCanary bool) error
CleanPreviousCanaryResources cleans previous canary resources
func (*Canary) CleanPreviousVersion ¶
CleanPreviousVersion cleans previous version of autoscaling group or canary target group
func (*Canary) CompleteCanaryDeployment ¶
func (c *Canary) CompleteCanaryDeployment(config schemas.Config, region schemas.RegionConfig, latestASG string) error
CompleteCanaryDeployment completes canary deployment
func (*Canary) CopyTargetGroups ¶
func (c *Canary) CopyTargetGroups(tg *elbv2.TargetGroup, canaryTgName, region string) (*elbv2.TargetGroup, error)
CopyTargetGroups creates copy existing target group for canary
func (*Canary) CreateCanaryLBSecurityGroup ¶
func (c *Canary) CreateCanaryLBSecurityGroup(tg *elbv2.TargetGroup, region schemas.RegionConfig) (*string, error)
CreateCanaryLBSecurityGroup creates a new security group for canary
func (*Canary) CreateCanaryLoadBalancer ¶
func (c *Canary) CreateCanaryLoadBalancer(region schemas.RegionConfig, groupID *string) (*elbv2.LoadBalancer, error)
CreateCanaryLoadBalancer creates a new load balancer for canary
func (*Canary) DeleteEC2IngressRules ¶
func (c *Canary) DeleteEC2IngressRules(region schemas.RegionConfig) error
DeleteEC2IngressRules deletes ingress rules for EC2
func (*Canary) DeleteEC2SecurityGroup ¶
func (c *Canary) DeleteEC2SecurityGroup(region schemas.RegionConfig) error
DeleteEC2SecurityGroup deletes EC2 security group for canary
func (*Canary) DeleteLBSecurityGroup ¶
func (c *Canary) DeleteLBSecurityGroup(region schemas.RegionConfig) error
DeleteLBSecurityGroup deletes load balancer security group
func (*Canary) DeleteLoadBalancer ¶
func (c *Canary) DeleteLoadBalancer(region schemas.RegionConfig) error
DeleteLoadBalancer deletes load balancer
func (*Canary) DetachCanaryTargetGroup ¶
func (c *Canary) DetachCanaryTargetGroup(asg string, region schemas.RegionConfig, tgs []*string) error
DetachCanaryTargetGroup detaches canary target group from auto scaling group
func (*Canary) DetachSecurityGroup ¶
func (c *Canary) DetachSecurityGroup(nis []*ec2.InstanceNetworkInterface, region schemas.RegionConfig, excludeSg string) error
DetachSecurityGroup deletes lb security groups from instances
func (*Canary) FindCanaryLoadBalancer ¶
func (c *Canary) FindCanaryLoadBalancer(region schemas.RegionConfig) (*elbv2.LoadBalancer, error)
FindCanaryLoadBalancer finds if there is canary-related load balancer
func (*Canary) FinishAdditionalWork ¶
FinishAdditionalWork processes additional work for the new deployment
func (*Canary) GatherMetrics ¶
GatherMetrics gathers the whole metrics from deployer
func (*Canary) GenerateCanaryLBSecurityGroupName ¶
GenerateCanaryLBSecurityGroupName generates name of canary load balancer for canary
func (*Canary) GenerateCanaryLoadBalancerName ¶
GenerateCanaryLoadBalancerName generates name of canary load balancer for canary
func (*Canary) GenerateCanarySecurityGroupName ¶
GenerateCanarySecurityGroupName generates name of canary load balancer for canary
func (*Canary) GenerateCanaryTargetGroupName ¶
GenerateCanaryTargetGroupName generates name of canary target group for canary
func (*Canary) GetAsgTargetGroups ¶
GetAsgTargetGroups retrieves target group list of autoscaling group
func (*Canary) GetCanaryLoadBalancerSecurityGroup ¶
func (c *Canary) GetCanaryLoadBalancerSecurityGroup(region schemas.RegionConfig) (*string, error)
GetCanaryLoadBalancerSecurityGroup retrieves existing load balancer security group for canary
func (*Canary) GetDeployer ¶
GetDeployer returns canary deployer
func (*Canary) GetEC2CanarySecurityGroup ¶
func (c *Canary) GetEC2CanarySecurityGroup(tg *elbv2.TargetGroup, region schemas.RegionConfig, lbSg *string, completeCanary bool) error
GetEC2CanarySecurityGroup creates a new security group for canary
func (*Canary) GetLoadBalancerAndSecurityGroupForCanary ¶
func (c *Canary) GetLoadBalancerAndSecurityGroupForCanary(region schemas.RegionConfig, tgDetail *elbv2.TargetGroup, completeCanary bool) (*string, *elbv2.LoadBalancer, error)
GetLoadBalancerAndSecurityGroupForCanary gets load balancer and security group for canary deployment
func (*Canary) HealthChecking ¶
HealthChecking does health checking for canary deployment
func (*Canary) LoadBalancerDeletionChecking ¶
func (c *Canary) LoadBalancerDeletionChecking(region schemas.RegionConfig) error
LoadBalancerDeletionChecking checks if load balancer is deleted well or not
func (*Canary) ReduceOriginalAutoscalingGroupCount ¶
func (c *Canary) ReduceOriginalAutoscalingGroupCount(region schemas.RegionConfig) error
ReduceOriginalAutoscalingGroupCount set existing autoscaling group count to -1
func (*Canary) RemoveCanaryTag ¶
func (c *Canary) RemoveCanaryTag(asg string, region schemas.RegionConfig) error
RemoveCanaryTag deletes Canary tag from auto scaling group
func (*Canary) RunAPITest ¶
RunAPITest tries to run API Test
func (*Canary) RunCanaryDeployment ¶
func (c *Canary) RunCanaryDeployment(config schemas.Config, region schemas.RegionConfig, tgDetail *elbv2.TargetGroup, canaryLoadBalancer *elbv2.LoadBalancer, canaryVersion int) (schemas.RegionConfig, error)
RunCanaryDeployment runs canary deployment
func (*Canary) SelectTargetGroupForCopy ¶
func (c *Canary) SelectTargetGroupForCopy(region schemas.RegionConfig, canaryVersion int) string
SelectTargetGroupForCopy select target group for copy
func (*Canary) TriggerLifecycleCallbacks ¶
TriggerLifecycleCallbacks runs lifecycle callbacks before cleaning.
type DeployManager ¶
type DeployManager interface { GetDeployer() *Deployer CheckPreviousResources(config schemas.Config) error Deploy(config schemas.Config) error HealthChecking(config schemas.Config) error FinishAdditionalWork(config schemas.Config) error CleanPreviousVersion(config schemas.Config) error TriggerLifecycleCallbacks(config schemas.Config) error CleanChecking(config schemas.Config) error GatherMetrics(config schemas.Config) error RunAPITest(config schemas.Config) error }
type DeployOnly ¶
type DeployOnly struct {
*Deployer
}
func NewDeployOnly ¶
func NewDeployOnly(h *helper.DeployerHelper) *DeployOnly
NewDeployOnly creates new DeployOnly deployment deployer
func (*DeployOnly) CheckPreviousResources ¶
func (d *DeployOnly) CheckPreviousResources(config schemas.Config) error
CheckPreviousResources checks if there is any previous version of autoscaling group
func (*DeployOnly) CleanChecking ¶
func (d *DeployOnly) CleanChecking(config schemas.Config) error
CleanChecking checks Termination status
func (*DeployOnly) CleanPreviousVersion ¶
func (d *DeployOnly) CleanPreviousVersion(config schemas.Config) error
CleanPreviousVersion cleans previous version of autoscaling group
func (*DeployOnly) Deploy ¶
func (d *DeployOnly) Deploy(config schemas.Config) error
Deploy function
func (*DeployOnly) FinishAdditionalWork ¶
func (d *DeployOnly) FinishAdditionalWork(config schemas.Config) error
FinishAdditionalWork processes additional work for the new deployment
func (*DeployOnly) GatherMetrics ¶
func (d *DeployOnly) GatherMetrics(config schemas.Config) error
GatherMetrics gathers the whole metrics from deployer
func (*DeployOnly) GetDeployer ¶
func (d *DeployOnly) GetDeployer() *Deployer
GetDeployer returns Deployer struct
func (*DeployOnly) HealthChecking ¶
func (d *DeployOnly) HealthChecking(_ schemas.Config) error
HealthChecking does health checking for d.ue-green deployment
func (*DeployOnly) RunAPITest ¶
func (d *DeployOnly) RunAPITest(config schemas.Config) error
RunAPITest tries to run API Test
func (*DeployOnly) TriggerLifecycleCallbacks ¶
func (d *DeployOnly) TriggerLifecycleCallbacks(config schemas.Config) error
TriggerLifecycleCallbacks.cks runs lifecycle callbacks d.fore cleaning.
type Deployer ¶
type Deployer struct { Mode string AsgNames map[string]string PrevAsgs map[string][]string PrevInstances map[string][]string PrevVersions map[string][]int PrevInstanceCount map[string]schemas.Capacity SecurityGroup map[string]*string LatestAsg map[string]string Logger *Logger.Logger Stack schemas.Stack AwsConfig schemas.AWSConfig APITestTemplate *schemas.APITestTemplate AWSClients []aws.Client LocalProvider builder.UserdataProvider Slack slack.Slack AppliedCapacity *schemas.Capacity Collector collector.Collector StepStatus map[int64]bool DeploymentFlag map[string]string }
Deployer per stack
func InitDeploymentConfiguration ¶
func InitDeploymentConfiguration(h *helper.DeployerHelper, awsClients []aws.Client) Deployer
InitDeploymentConfiguration returns initialized configurations for Deployer
func (*Deployer) CheckAutoscalingInstanceCount ¶
func (d *Deployer) CheckAutoscalingInstanceCount(client aws.Client, asg string, desired int) (bool, error)
CheckAutoscalingInstanceCount checks instance count in the autoscaling group with desired value
func (*Deployer) CheckPrevious ¶
CheckPrevious checks if there is any previous version of autoscaling group
func (*Deployer) CheckTerminating ¶
CheckTerminating checks if all of instances are terminated well
func (*Deployer) CleanAutoscalingSet ¶
CleanAutoscalingSet cleans autoscaling group itself
func (*Deployer) CleanChecking ¶
CleanChecking checks if instances in previous autoscaling groups are terminated or not
func (*Deployer) CleanPreviousAutoScalingGroup ¶
CleanPreviousAutoScalingGroup cleans previous version of autoscaling group
func (*Deployer) ClearResources ¶
ClearResources removes all resources of deployment and record metrics
func (*Deployer) CompareWithCurrentCapacity ¶
func (d *Deployer) CompareWithCurrentCapacity(forceManifestCapacity bool, region string) schemas.Capacity
CompareWithCurrentCapacity compares capacity of manifest with the one in current deployment to adjust capacity in order to prevent sudden decrease of capacity which could impact current environment
func (*Deployer) DecideCapacity ¶
func (d *Deployer) DecideCapacity(forceManifestCapacity, completeCanary bool, region string, prevAsgCount int, rollingUpdateInstanceCount int64) (schemas.Capacity, error)
DecideCapacity returns Applied Capacity for deployment
func (*Deployer) DescribeAutoScalingGroup ¶
func (d *Deployer) DescribeAutoScalingGroup(asg, region string) (*autoscaling.Group, error)
DescribeAutoScalingGroup describes autoscaling group
func (*Deployer) DescribeInstances ¶
func (d *Deployer) DescribeInstances(instanceIds []*string, region schemas.RegionConfig) ([]*ec2.Instance, error)
DescribeInstances describes instances
func (*Deployer) DescribeTargetGroup ¶
func (d *Deployer) DescribeTargetGroup(targetGroup string, region string) (*elbv2.TargetGroup, error)
DescribeTargetGroups retrieves target group details
func (*Deployer) DoCommonAdditionalWork ¶
DoCommonAdditionalWork does the common work regardless of replacement type
func (*Deployer) GatherMetrics ¶
GatherMetrics gathers metrics of autoscaling group
func (*Deployer) GenerateAPIAttacker ¶
func (d *Deployer) GenerateAPIAttacker(template schemas.APITestTemplate) (*APIAttacker, error)
GenerateAPIAttacker create API Attacker
func (*Deployer) GenerateTags ¶
func (d *Deployer) GenerateTags(asgName, stack string, extraTags, ansibleExtraVars, region string) []*autoscaling.Tag
GenerateTags creates tag list for autoscaling group
func (*Deployer) GetStackName ¶
GetStackName returns name of stack
func (*Deployer) GetTargetGroupNames ¶
func (d *Deployer) GetTargetGroupNames(region schemas.RegionConfig) []string
GetTargetGroupNames retrieves slice of target group name string
func (*Deployer) GetValidHostCount ¶
func (d *Deployer) GetValidHostCount(targetHosts []aws.HealthcheckHost) int64
GetValidHostCount return the number of health host
func (*Deployer) HealthChecking ¶
HealthChecking does health check
func (*Deployer) Polling ¶
func (d *Deployer) Polling(region schemas.RegionConfig, asg *autoscaling.Group, client aws.Client, forceManifestCapacity, isUpdate, downsizingUpdate bool) (bool, error)
Polling is polling healthy information from instance/target group
func (*Deployer) ReducePreviousAutoScalingGroupCapacity ¶
func (d *Deployer) ReducePreviousAutoScalingGroupCapacity(region string, decreaseCnt int64) (bool, error)
ReducePreviousAutoScalingGroupCapacity cleans previous version of autoscaling group
func (*Deployer) ResizingAutoScalingGroup ¶
ResizingAutoScalingGroup sets autoscaling group instance count to desired value
func (*Deployer) ResizingAutoScalingGroupCount ¶
ResizingAutoScalingGroupCount set autoscaling group instance count to 0
func (*Deployer) RunAPITest ¶
RunAPITest tries to run API Test
func (*Deployer) RunLifecycleCallbacks ¶
RunLifecycleCallbacks runs commands before terminating.
func (*Deployer) SkipDeployStep ¶
func (d *Deployer) SkipDeployStep()
SkipDeployStep skips deployment processes
func (*Deployer) StartGatheringMetrics ¶
StartGatheringMetrics starts to gather the whole metrics from deployer
type RollingUpdate ¶
type RollingUpdate struct { PrevTargetGroups map[string][]string TargetGroups map[string][]*string PrevHealthCheckTargetGroups map[string]string LoadBalancer map[string]string LBSecurityGroup map[string]*string *Deployer }
func NewRollingUpdate ¶
func NewRollingUpdate(h *helper.DeployerHelper) *RollingUpdate
NewRollingUpdate creates new rolling-update deployment deployer
func (*RollingUpdate) CheckPreviousResources ¶
func (r *RollingUpdate) CheckPreviousResources(config schemas.Config) error
CheckPreviousResources checks if there is any previous version of autoscaling group
func (*RollingUpdate) CleanChecking ¶
func (r *RollingUpdate) CleanChecking(config schemas.Config) error
CleanChecking checks Termination status
func (*RollingUpdate) CleanPreviousVersion ¶
func (r *RollingUpdate) CleanPreviousVersion(config schemas.Config) error
CleanPreviousVersion cleans previous version of autoscaling group or canary target group
func (*RollingUpdate) CompleteRollingUpdate ¶
func (r *RollingUpdate) CompleteRollingUpdate(config schemas.Config, region schemas.RegionConfig) error
CompleteRollingUpdate processes the whole process of rolling update
func (*RollingUpdate) Deploy ¶
func (r *RollingUpdate) Deploy(config schemas.Config) error
Deploy runs deployments with rolling update approach
func (*RollingUpdate) FinishAdditionalWork ¶
func (r *RollingUpdate) FinishAdditionalWork(config schemas.Config) error
FinishAdditionalWork processes additional work for the new deployment
func (*RollingUpdate) GatherMetrics ¶
func (r *RollingUpdate) GatherMetrics(config schemas.Config) error
GatherMetrics gathers the whole metrics from deployer
func (*RollingUpdate) GetDeployer ¶
func (r *RollingUpdate) GetDeployer() *Deployer
GetDeployer returns canary deployer
func (*RollingUpdate) HealthChecking ¶
func (r *RollingUpdate) HealthChecking(config schemas.Config) error
HealthChecking does health checking for canary deployment
func (*RollingUpdate) RunAPITest ¶
func (r *RollingUpdate) RunAPITest(config schemas.Config) error
RunAPITest tries to run API Test
func (*RollingUpdate) TriggerLifecycleCallbacks ¶
func (r *RollingUpdate) TriggerLifecycleCallbacks(config schemas.Config) error
TriggerLifecycleCallbacks runs lifecycle callbacks before cleaning.