简体   繁体   English

在Azure中使用vnet创建负载均衡器

[英]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.

相关问题 Azure 内部负载均衡器能否拥有属于 VNET 中不同子网的后端? - Can Azure Internal Loadbalancer have backends belonging to different subnets in the VNET? Kubernetes无法在Azure上创建负载均衡器 - Kubernetes fails to create loadbalancer on azure 在经典的Azure vnet中创建一个新子网 - Creating a new subnet inside a classic azure vnet 使用 PowerShell 和现有 VNET 创建 Azure VM - Create an Azure VM using PowerShell with an existing VNET 在vNet性能内与在vNet外具有Azure SQL连接的Azure Web App PaaS(应用服务计划) - Azure Web App PaaS (App Service Plan) with Azure SQL connection inside vNet performance vs outside vNet Azure 创建 ARM 模板以在现有 Vnet 和子网中创建 Vm - Azure Create ARM Template To Create Vm In An Existing Vnet and Subnet Azure ARM模板:如何使用模板创建vnet并将其对等到现有vnet? - Azure ARM Templates: How to use template to create a vnet and peer it to an existing vnet? 公开 vnet 内的 Azure 容器实例的正确方法是什么? - What is the proper way to expose an Azure Container Instance that is inside a vnet? 如何从 Azure Linux Web 应用程序访问 VNET 内的 VM? - How to access VM inside VNET from a Azure Linux Web App? Model 部署到 Azure 机器学习中 VNet 内的托管在线端点 - Model deployment to managed online endpoints inside VNet in Azure Machine Learning
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM