我们可以用代码控制流量路由到 AWS ELB 上的实例吗

Can we control traffic routing to instances on AWS ELB with code

我在一个 Application Loadbalancer 下有两个实例。两个实例都在具有默认路由的同一目标组下。

Can I control traffic routing to the instances at the application level?

我想部署一个新版本的代码到一个实例,只允许少量流量到该实例进行测试。

Route 53 可以实现此 A/B 通过加权路由进行测试。

Weighted routing lets you associate multiple resources with a single domain name (example.com) or subdomain name (acme.example.com) and choose how much traffic is routed to each resource. This can be useful for a variety of purposes, including load balancing and testing new versions of software.

回复:https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html#routing-policy-weighted

该架构将包含两条具有不同权重的路由(https://aws.amazon.com/blogs/devops/introducing-application-load-balancer-unlocking-and-optimizing-architectures/):

上面文章中概述的另一个优化建议是使用应用程序负载平衡器重写 URL,而不是使用 DNS。