[英]Create loadbalancer inside a vnet with azure
I want to create a load balancer for all my agents. 我想为所有代理创建一个负载均衡器。 In the official docs I found a guide for an external load balancer, but I want to connect it with the api management so it has to be only visible in the vnet. 在官方文档中,我找到了外部负载均衡器的指南 ,但我想将其与api管理连接,因此它只能在vnet中可见。
This post works if you only have one agent (you enter the private ip of the agent in your api route). 如果您只有一个代理,则此帖子有效(您在api路由中输入了代理的私有IP)。 But it does not handle the second agent. 但是它不处理第二个代理。 Is it possible to use Azure API Management and Azure ACS (kubernetes) as frontend and backend? 是否可以将Azure API管理和Azure ACS(kubernetes)用作前端和后端?
So in my case I need to create a load balancer that handles all agents for the service and has a private ip in a vnet in that the api management service also is. 因此,在我的情况下,我需要创建一个负载平衡器,以处理该服务的所有代理,并在vnet中拥有一个专用ip,因为api管理服务也是如此。
well, nothing prevents you from connecting api management to an external endpoint, so there's that. 好吧,没有什么可以阻止您将api管理连接到外部端点,就是这样。
and if you really want internal endpoint I doubt that it is possible, since a NIC can only be attached to a single load balancer. 如果您真的想要内部端点,我会怀疑是否可行,因为NIC只能连接到单个负载均衡器。 maybe if you detach agent nics from the external load balancer and attach them to internal load balancer... that might work, but looks like a solid hack. 也许,如果您从外部负载均衡器中分离代理程序nics并将它们附加到内部负载均衡器上……可能会起作用,但看起来像是可靠的黑客。
other way around this might be using ACS engine to generate a template for you and alter the template to deploy internal load balancer. 解决此问题的其他方法可能是使用ACS引擎为您生成模板并更改模板以部署内部负载均衡器。
As 4c74356b41 said, we can't add a VM to two backend pools (if your k8s create via azure portal, the agents in a VMSS.) 正如4c74356b41所说,我们不能将VM添加到两个后端池(如果您的k8是通过azure门户创建的,则是VMSS中的代理。)
In your scenario, I think we can create a VM in ACS resource group, and install load balance software on it, make this VM work as a load balancer. 在您的方案中,我认为我们可以在ACS资源组中创建一个VM,并在其上安装负载平衡软件,使该VM充当负载平衡器。
For example, we can use Haproxy to load balance the network traffic to agents. 例如,我们可以使用Haproxy平衡到代理的网络流量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.