azure - 通过 Bicep 模板使用应用程序网关入口加载项创建 AKS 集群

标签 azure azure-aks azure-cli azure-bicep

我正在关注this tutorial使用应用程序网关入口 Controller 设置 AKS。

我想知道使用 Bicep 模板的 Azure CLI 命令的等效项是什么?

az aks create -n myCluster -g myResourceGroup --network-plugin azure --enable-managed-identity -a ingress-appgw --appgw-name myApplicationGateway --appgw-subnet-cidr "10.2.0.0/16" --generate-ssh-keys

特别是节点资源组名称似乎只能使用ARM/Bicep作为FAQ中提到的相应参数来配置。在当前版本的 AKS 扩展中似乎已经消失。

更新:我最不确定的是如何通过模板激活和配置附加组件“ingress-appgw”。

我看到在导出由上述命令配置的 AKS 集群时,我得到了此部分:

 "addonProfiles": {
                "azurepolicy": {
                    "enabled": true
                },
                "ingressApplicationGateway": {
                    "enabled": true,
                    "config": {
                        "applicationGatewayName": "my-agw",
                        "effectiveApplicationGatewayId": "[parameters('applicationGateways_my_agw_externalid')]",
                        "subnetCIDR": "10.2.0.0/16"
                    }
                }
            }

如果这足以实现相同的工作,我很好,但我不确定 Azure CLI 命令是否会在 AKS 中执行一些额外的操作以使其全部正常工作。

最佳答案

您可以使用此模板作为启动器:https://github.com/Azure/azure-quickstart-templates/blob/91da267dce8691485d916f7315a3fe6ffcee21aa/quickstarts/microsoft.network/aks-application-gateway-ingress-controller/azuredeploy.json#L1797

它是 ARM,但您可以轻松地将其转换为 Bicep,例如:

addonProfiles: {
    {
      ingressApplicationGateway: {
        enabled: true
        config: {
          applicationGatewayId: applicationGateway.id
        }
      }
}

添加身份(如果您使用它)。

关于azure - 通过 Bicep 模板使用应用程序网关入口加载项创建 AKS 集群,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71590613/

相关文章:

sql-server - 超时已过。在 Azure sql 上完成操作之前超时时间已过

c# - Azure 上的用户授权

Azure Service Fabric 支持的操作系统

azure - 部署模板架构 api 版本列表在哪里?

azure - 我可以使用 Azure CLI 执行与 Azure Powershell 相同的操作吗? (上传VHD)

Azure 成本管理 API - 想要连接使用 API?

azure - 是否可以使用 azure powershell 在 azure 中查看日志警报?

azure - 将数据从应用服务复制到 azure fileshare

Azure Kubernetes 服务 ARM 模板不是幂等的

kubernetes-ingress - 我们可以将 TLS 证书作为 secret 存储在 Azure Key Vault 中,并在 Azure Kubernetes 服务的 Ingress 中使用它吗