- 최신
- 최다 투표
- 가장 많은 댓글
This blue-green deployment would be easier to do with a single ALB if that is possible.
See Target Group Stickiness
There are situations when you want the clients to experience the same version of the application for a specified duration. Or you want clients currently using the app to not switch to the newly deployed (green) version during their session. For these use cases, we also introduce target group stickiness. When target group stickiness is enabled, the requests from a client are all sent to the same target group for the specified time duration. At the expiry of the duration, the requests are distributed to a target group according to the weight. ALB issues a cookie to maintain target group stickiness.
Alternatively, you could use Route53 routing policy to split your traffic to different load balancers and base the decission on things like geo locatation or client IP (or anything else than weighted) that is not going to change between requests. This wouldn't get you 50/50 distribution thought.
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html
If you enable ALB logging you can search Athena after the case to see who’s hitting what.
If you looking for real time information so your app knows another option could be to have 2 different WAF Acls. One tied to each ALB. Set a custom header as the request passes through the WAF to the alb so your application can detect its route.
https://docs.aws.amazon.com/waf/latest/developerguide/customizing-the-incoming-request.html