Reputation: 186
I am trying to build a more dynamic/scalable system in AWS. I have launched 2 instances in an AutoScaling group where the minimum number of instances is 2 and the maximum is 5 with a load balancer in front of them. I have enabled "Termination Protection" on the first two instances since they are going to be the ones that I use for deploying my Rails Application via Capistrano.
The problem is that I am not sure what is the best way to keep all instances in my autoscaling group up-to-date so they run the same version of the application.
I have searched for many techniques, below are the ones I find applicable but still do not know which would be the best.
1- AWS CodeDeploy: Looks pretty cool, using Blue/Green Deployment looks like it would do the job pretty solid with zero downtime. I do not know if there's a rule of thumb for this but in my opinion, the deployment time is a bit long, I am not sure if it would be applicable when I need to release a hotfix.
2- Via Script: I am not sure how to implement this using AWS either but, the idea is when a new code is uploaded to my 2 "master (?)" instances,
The problem with this approach is that it requires some manual operation which I do not want to rely on much.
3- Using User Data: Running new instances with user data that pulls the new version of the code. I do not think this is a good way since probably there will be other instances that are already running the old code.
So these are the solutions I have seen up to now, which one would be the best solution?
Cheers!
Upvotes: 4
Views: 1616
Reputation: 186
I ended up using an extension gem (my app is written in ruby on rails) for deployment. I was already using Capistrano
for deployment, then I found out the gem elbas
which internally does the following:
This is basically the 2nd option (via Script option), and finding a gem that does this for me, removes the challenge of manually handling things.
Hope this helps, cheers!
Upvotes: 5