A DevOps Engineer is implementing a mechanism for canary testing an application on AWS. The application was recently modified and went through security, unit, and functional testing. The application needs to be deployed on an AutoScaling group and must use a Classic Load Balancer.
Which design meets the requirement for canary testing?
A. Create a different Classic Load Balancer and Auto Scaling group for blue/green environments. Use Amazon Route 53 and create weighted A records on Classic Load Balancer.
B. Create a single Classic Load Balancer and an Auto Scaling group for blue/green environments. Use Amazon Route 53 and create A records for Classic Load Balancer IPs. Adjust traffic using A records.
C. Create a single Classic Load Balancer and an Auto Scaling group for blue/green environments. Create an Amazon CloudFront distribution with the Classic Load Balancer as the origin. Adjust traffic using CloudFront.
D. Create a different Classic Load Balancer and Auto Scaling group for blue/green environments. Create an Amazon API Gateway with a separate stage for the Classic Load Balancer. Adjust traffic by giving weights to this stage.
A
技巧:排除明顯錯誤選項,在沒有明顯錯誤的選項中選擇最合理的選項。
金絲雀測試(Canary Testing)允許在不影響大部分用戶的情況下,將一小部分流量定向到新版本的應用程序,以便觀察其性能和穩定性。
A. 正確。為藍綠環境創建不同的 Classic Load Balancer 和 Auto Scaling 組。使用 Amazon Route 53 并創建加權A記錄指向 Classic Load Balancer。這個選項通過創建兩個不同的負載均衡器和Auto Scaling組來區分舊版本(綠色)和新版本(藍色)的應用。使用Route 53的加權A記錄,可以靈活地將一部分流量(如5%)定向到新版本,而其余流量繼續流向舊版本。這完全符合金絲雀測試的需求。
B. 不正確。為藍綠環境創建單個的 Classic Load Balancer 和 Auto Scaling 組。使用 Amazon Route 53 并創建 A 記錄指向Classic Load Balancer的IP地址。通過調整A記錄調整流量。這個選項的問題在于它只使用了一個負載均衡器,這意味著不能直接通過負載均衡器區分新舊版本的流量。即使你嘗試通過IP地址和A記錄來調整流量,這也會變得非常復雜且難以管理,不符合金絲雀測試的簡單性和可控性要求。
C. 不正確。為藍綠環境創建單個Classic Load Balancer和Auto Scaling組。創建一個Amazon CloudFront分發,以Classic Load Balancer為源。通過CloudFront調整流量。這個選項的問題是同樣使用了單個負載均衡器,另外還引入了CloudFront。雖然CloudFront提供了內容分發和緩存功能,但它不是為金絲雀測試設計的流量分割工具。CloudFront分發通常用于加速靜態和動態內容的分發,而不是用于在應用程序版本之間分割流量。
D. 不正確。為藍綠環境創建不同的 Classic Load Balancer 和 Auto Scaling 組。創建一個Amazon API Gateway,為 Classic Load Balancer 設置單獨的階段。通過給這個階段加權來調整流量。這個選項雖然使用了不同的負載均衡器和Auto Scaling組,但API Gateway通常用于構建、發布、維護、監控和保護API。它不是為金絲雀測試設計的流量管理工具,且 API Gateway 與 Classic Load Balancer 之間的集成不如Route 53那樣直接和靈活。