0
votes

There are two questions about AWS autoscaling + deployment which I cannot clearly answer:

  1. I'm currently trying to figure out, whats the best strategy to deploy to an EC2 instance behind an ELB which is the only member of an autoscaling group without downtime.

By now the EC2 setup will be done with puppet including the deployment of the application, triggered after an successful build by jenkins.

The best solution I have found is to check per script how many instances are registered at the ELB. If a single one is registered, spawn a new one, which runs puppet on startup (the new node will be up to date) and kill the old node.

  1. How to deploy (autoscaling EC2 behind an ELB) without delivering two different versions of the application?

Possible solution: Check per script how many EC2 instances are registered to the ELB, spawn the same amount of instances, register all new instances and unregister all old ones.

My experiences with AWS teacher me that AWS has a service for everything. So are there any services out there to accomplish my requirements and my solutions are inconvenient?

2
If you are able to use Elastic Beanstalk, which is a Load Balancer + Scaling group as a service. It has a Rolling update feature, that's what you described here. The question is, if you can deploy your system with Beanstalk. Beanstalk now also supports Docker.Adam Ocsvari

2 Answers

0
votes

You can create an entirely new environment with its own ELB and when it's ready and checked, you switch the DNS record to the new ELB.

Anyway for a brief time (60 seconds or so, depending on the TTL of your DNS record) some users will see your old version while some others will see the new version.

0
votes

In the end there were two possible solutions. Both of them would temporarily deliver two versions of the app.

  1. Use AWS CodeDeploy to perform an sequential deployment (one after another). This solution offers the possibility to rollback to a previous state and visual shows the state and results of the deployment.

  2. Create a python script to get the registered nodes (using Boto) and run the appropriate puppet script on them (using Fabric). This solution offers more control of the deployment but requires some time to build these script. Also there can be bugs..

For now I choose AWS CodeDeploy because its already available and - hopefully - well tested.