[英]How to use same application loadbalancer for different elasticbeanstack application environment using cloudformation template?
I am running an application with different services.我正在运行具有不同服务的应用程序。 I have deployed it as a microservice pattern using elastic beanstalk.
我已经使用弹性 beantalk 将它部署为微服务模式。 Each microservice is hosted in a separate elastic beanstalk environment but within the same application.
每个微服务都托管在一个单独的弹性 beanstalk 环境中,但在同一个应用程序中。
I have automated the deployment process with cloud formation template.我已经使用云形成模板自动化了部署过程。 I have created a resource for each application environment through the template.
我已经通过模板为每个应用程序环境创建了一个资源。 It is created.
它被创建。 Beanstalk environment uses default target group and separate application load balancer for each environment, If I add more number of microservices to my application, which requires more number of the application load balancer, But a single application load balancer can be used to route the traffic of the different microservice target groups.
Beanstalk 环境为每个环境使用默认目标组和单独的应用程序负载均衡器,如果我向我的应用程序添加更多数量的微服务,这需要更多数量的应用程序负载均衡器,但是可以使用单个应用程序负载均衡器来路由流量不同的微服务目标群体。
I have checked about the parameters available in the resource.我已经检查了资源中可用的参数。 The main option is available in beanstalk environment resource is a single instance or load-balanced environment.
beanstalk 环境中可用的主要选项资源是单实例或负载均衡环境。 If I choose single instance, then it will not create any load balancer.
如果我选择单实例,那么它不会创建任何负载均衡器。 It just creates a single EC2 server and deploys the application.
它只是创建一个 EC2 服务器并部署应用程序。 Apache/Nginx acts as a reverse proxy server to access the endpoint.
Apache/Nginx 充当反向代理服务器来访问端点。 At the same time, if I use a load balanced environment, I can configure settings related to the application load balancer.
同时,如果我使用负载均衡环境,我可以配置与应用程序负载均衡器相关的设置。 But I do not find any way to reuse a single Application load balancer, Do we have such support in AWS right now, AWS has added some options to control ELB from elastic beanstalk.
但是我没有找到任何方法来重用单个应用程序负载均衡器,我们现在在 AWS 中有这样的支持吗,AWS 已经添加了一些选项来从弹性 beantalk 控制 ELB。
You can extend the Single Application Load Balancer capabilities to rules, targets, and target groups.您可以将单一应用程序负载均衡器功能扩展到规则、目标和目标组。 Where let's Say your Environment 1 has an application name APPLICATION-1 and Environment 2 has an application name APPLICATION-2 .
假设您的环境 1 有一个应用程序名称APPLICATION-1 ,环境 2 有一个应用程序名称APPLICATION-2 。 using ALB through target groups you can define such rules.
通过目标组使用 ALB,您可以定义此类规则。
Unfortunately, it is presently not possible to associate a single Load Balancer with multiple Beanstalk environments.遗憾的是,目前无法将单个负载均衡器与多个 Beanstalk 环境相关联。 The closest you can get to deploying separate services under a single Load Balancer using Beanstalk is to use the Multi-Container Docker platform.
最接近使用 Beanstalk 在单个负载均衡器下部署单独服务的方法是使用多容器 Docker 平台。 However, under this scheme, your services cannot be scaled independently.
但是,在这种方案下,您的服务无法独立扩展。 ie either Beanstalk scales all services together, or none of them.
即要么 Beanstalk 一起扩展所有服务,要么都不扩展。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.