aws-samples / aws-samples/aws-codedeploy-samples

Failed deployments using ASGs and elb scripts reduce ASG capacity

未关闭
#70 6 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
bug enhancement
主要语言
Shell
星标
639
派生
778
PR 合并指标
30 天内没有已合并 PR

描述

During the deregister scripts, if the host is a part of an ASG and min size matches desired size, the [ASG min size setting gets decremented](https://github.com/awslabs/aws-codedeploy-samples/blob/master/load-balancing/elb/common_functions.sh#L299) so that ASG does not spin up a new instance, and when the host goes back into service, the [ASG min size gets incremented](https://github.com/awslabs/aws-codedeploy-samples/blob/master/load-balancing/elb/common_functions.sh#L394). However, if the deployment fails, the script will never increase the capacity, leaving the ASG with one less min size. Since putting a host into standby reduces the desired capacity, an ASG could have its min size reduced by multiple hosts during a deployment, and it will never be increased back to where it was.

When the min size gets decremented, a [flag gets set in a temporary file](https://github.com/awslabs/aws-codedeploy-samples/blob/master/load-balancing/elb/common_functions.sh#L311) that's around for the life of the deployment, but will not be viewed by any subsequent deployments. One option might be to set the flag in a permanent location to track the state mutations.

Issue #57 is an example of this.

### Supported Solution

If CodeDeploy customers are not aware, [CodeDeploy has direct support for some ELB situations](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-aws-elastic-load-balancing.html). As of 5/1/17, [CodeDeploy started supporting classic ELB](https://aws.amazon.com/about-aws/whats-new/2017/05/aws-codedeploy-now-integrates-with-elastic-load-balancing/) via the service, which handles all of the registering and deregistering from the load balancer and allows additional lifecycle events, and it solves many of the limitations in these scripts. If your use case is not currently supported (i.e. you use application ELB), check in occasionally [here](http://docs.aws.amazon.com/codedeploy/latest/userguide/integrations-aws-elastic-load-balancing.html) to see if CodeDeploy has added support.

If you onboard with CodeDeploy ELB support, you should no longer need to use these load balancer scripts.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。