azure-vm-scale-set - 具有应用程序网关和 Azure LB 的 Azure ScaleSet
解决方案
你当然可以!下面是一些使用 Azure CLI 的示例代码:
# create an Azure Load Balancer that is associated to a virtual network
# instead of a public IP:
$ az network lb create -g multirg -n privatealb --vnet-name vnet --subnet scalesetsubnet
# create an application gateway:
$ az network application-gateway create -g multirg -n appgw --vnet-name vnet --subnet appgwsubnet
# create a scale set associated with the app gateway (note: 'az vmss create'
# does not allow specifying multiple load balancers; we'll just create with
# the app gateway for now and add the Azure Load Balancers afterwards)
$ az vmss create -g multirg -n scaleset --app-gateway appgw --image UbuntuLTS --generate-ssh-keys --vnet-name vnet --subnet scalesetsubnet --upgrade-policy Automatic
# to associate the scale set with the load balancer post-creation,
# we will need to know the resource IDs of the load balancer's backend
# pool; we can get this using the 'az network lb show' command:
$ az network lb show -g multirg -n privatealb
{
"backendAddressPools": [
{
.
.
.
"id": "{private-alb-pool-id}",
.
.
.
}
# we can then use the 'az vmss update' command to associate the Azure
# Load Balancer with the scale set:
az vmss update --resource-group multirg --name scaleset --add virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations[0].LoadBalancerBackendAddressPools '{"id": "{private-alb-pool-id}"}'
我还写了一篇描述规模集 + Azure 负载均衡器 + 应用网关场景的快速博客文章。有关更多信息,请在此处找到:https ://negatblog.wordpress.com/2018/06/21/scale-sets-and-load-balancers/
希望这可以帮助!:) -尼尔
推荐阅读
- php - 中心的引导导航栏徽标和左侧和右侧的项目
- typescript - 用于自定义数组的 Typescript .find
- wpf - Layout Transform 改变控件的布局
- swiftui - SwiftUI 和具有 @Published 的组合 Observable 对象不断发布
- sharepoint - 如何在个人 Web 部件中显示过去 14 天内修改的项目?
- haskell - 使用列表理解的列表中连续数字的总和
- c - 在 Linux 中检查 struct mutex 的所有者字段
- python - 我正在使用 django-extra-views 在 1 页上有 2 个表单。我应该如何处理 form_valid 中的自定义逻辑?
- mongodb - MongoDB:使用 id=null 分组
- python - 重新排序初始迁移操作