Skip to content

Improvements for ELB functionality #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 17, 2016

Conversation

default50
Copy link
Contributor

After reviewing PRs #40 and #41 from @wjordan I realized that my PR #43 was only fixing issues with ASGs.

I integrated those changes (with some extra tweaks) into this new PR, which is based off a branch of my asg_suspend_processes. So you can consider this superseding all those previous PRs. Adding my previous comments below quoted, for reference.

This are the added changes:

  • Updated README.md with info about ELB_LIST options of _all_ and _any_ as well as a style fix.
  • Improved set_flag/get_flag functions to support storing/getting arbitrary values.
  • Removed dependency on bc by using awk instead.
  • Removed ASG checks from reset_waiter_timeout as it's only considered for ELBs.
  • Further improved the query string on reset_waiter_timeout function (and tested it working on Ubuntu Trusty)

With this patch the AZRebalance, AlarmNotification, ScheduledActions and ReplaceUnhealthy processes on the AutoScaling Group are suspended while doing the deployment.

This is needed because if a scale up/down, a rebalance or any other activity modifies the instances of the ASG it will cause a failed deployment.

This is a more general approach than the PR #37, which I'll be closing after submitting this one.

The state of previously suspended processes in the ASG is preserved. I.e. if AZRebalanced was configured by the user to be suspended previous to the deployment it will still be suspended after it's done.

Scripts will exit with an error if any of the suspension/resuming API calls fail.

In detail:

  • Implemented some functions to handle the state of the processes through a flag file. [This is needed because register and deregister scripts are called at different lifecycle events and environment is not shared as they are invoked by the CodeDeploy agent.]
  • Unified the flag file of "decremented ASG group" into the same file so that we only use one file.
  • Made the flag file have the Deployment Group ID and Deployment ID in it's filename in case potential issues need to be tracked.
  • Updated the README.md file with a notice about the new behaviour and the needed policies on IAM.

default50 and others added 9 commits May 26, 2016 13:12
…althy) are suspended while deploying and resume only the ones suspended by the script.

Also abort if Launch process is disabled as it will not allow to return and instance from StandBy
- Added notice about suspended processes
- Fixed some Markdown style issues
- Fixed missing link to documentation
…itrary values.

- Removed dependency on bc by using awk instead.
- Removed ASG checks from reset_waiter_timeout as it's only considered for ELBs.
- Further improved the query string on reset_waiter_timeout function (and tested it working on Ubuntu Trusty)
default50 added a commit to default50/CodeDeploy_SampleApp_Linux that referenced this pull request Jun 14, 2016
…d deregister_from_elb.sh was not run on ApplicationStop
default50 added a commit to default50/CodeDeploy_SampleApp_Linux that referenced this pull request Jul 7, 2016
@default50
Copy link
Contributor Author

Latest commits:

  • Fixed a failure when deregister was not being run on ApplicationStop because it was the initial deployment to an instance (2da4b75).
  • Made suspension of processes optional by a flag and updated README with useful information as to why it should/should not be used (4e3cf22, 99c91fe).

@nwalke nwalke mentioned this pull request Aug 1, 2016
@Jmcfar Jmcfar merged commit 24a476f into aws-samples:master Aug 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants