Pergunta de entrevista da empresa BigR.io

A DevOps engineer needs to implement a blue/green deployment process for an application on AWS. The DevOps engineer must gradually shift the traffic between the environments. The application runs on Amazon EC2 instances behind an Application Load Balancer (ALB). The instances run in an Amazon EC2 Auto Scaling group. The application stores data on an Amazon RDS Multi-AZ DB instance. Amazon Route 53 provides external DNS. Describe the steps the DevOps engineer should take to meet these requirements?

Resposta da entrevista

Sigiloso

25 de mar. de 2024

○ We will call the application that’s already up and running the “blue” instance. ○ We would then need to create an identical “green” instance running in parallel. This is pretty easy to do if all the infrastructure is managed in Terraform. Can be as simple as changing a few variable names! ○ Once a new version of the application is ready for testing, we could deploy it to the “green” instance and then slowly shift traffic over to the “green” instance using a Route 53 weighted routing policy. ○ Once fully-satisfied with “green’s” performance and stability, we could perform a full cut-over to the “green” instance and stop routing traffic to “blue.” ○ If wanting to save costs, it may be worth it to tear down the “blue” instance as a cleanup step. But it’s always a good idea to keep it up just in case there is a problem with “green” and we can immediately route traffic to the stable “blue” instance.