Skip to content

Latest commit

 

History

History
57 lines (34 loc) · 3.97 KB

blue-green-in-action.md

File metadata and controls

57 lines (34 loc) · 3.97 KB

Sample Workflow

1. Developer make changes to the application code and make a PR in a separate branch.

image image

2. The PR will go through CI. If CI passed, it can get merged to master.

image

3. Anything committed to master will trigger CI & CD.

image

4. Specifically, a few things will happen in the following jobs:

  • build_app: Code will get build, validated and push to DockerHub.
  • deploy_single_ecs_cluster: "test env" without blue-green setup get updated.
  • deploy_blue_green_ecs_cluster: Only the "blue" part of blue-green infra will get updated.
  • request-flip-dns: A decision need to be done by human operator whether to flip the DNS and upgrade the "blue" infra to "green infra.".

image

5. The state of blue-green deployment are tracked in this dynamodb table. Noticed that currently all traffic should be redirected to only one of the load balancers.

image

6. Route53 records will reflect the states from the dynamodb table.

image

7. As explained, only one of the infra sets will get updated. (Ignore the naming here, but more importantly this is to show that only the ECS cluster corresponds to the correct load balancer get updated. The one currently serving the internet will not get updated.)

image

8. Notice how the actual domain is still being routed to the previous infra.

9. In order to promote "blue" to "green", manual approval need to be done. This step actually call an API to flip the DNS on the Route53. The API call may happen outside of CD for other operational purposes (like reverting the changes).

image

10. If the approval step get approved, then it will make the actual switch:

image

11. DynamoDB table that hold the state will be updated and the changes will be reflected at the relevant Route53 record sets.

image image

12. Eventually, DNS propagation will happen within 60 sec TTL and traffic will be routed to the newly promoted infra.

screen 2018-12-04 at 06 44 09