How to do container rollbacks using a multi docker configuration on elasticbeanstalk

261 views Asked by At

I'm using EB to run multiple Docker containers using there multi docker configuration which makes use of ECS.

I want to find out how I can manage container rollbacks? At the moment if I push something to GitHub, my code-pipeline initiates a code-build, my code-build then push the built container to our ECS registry with the latest tag.

I have setup my image inside the container definition which points to the latest container. Now I believe EB automatically pulls the new containers - This can cause problem as I don't have a way to fallback to the previous version if something fails inside of it.

Our flow looks like this:

  1. Push to git
  2. Codebuild -> Push built container to ECS registry
  3. EB points to the latest image

What our flow needs to look like:

  1. Push to git
  2. Codebuild -> Push built container to ECS registry
  3. EB points to the latest image
  4. Does the node app fail? Is there an error? If so: roll back to the previous container version
1

There are 1 answers

0
ALex_hha On

Latest tag is evil, especially with autoscaling group.

As I can see you have 2 options

  1. You can use blue/green deployment
  2. You can use immutable environment updates