Azure 模板支持 AKS 节点池

Azure Templates Support For AKS Node Pools

AKS 最近发布了对节点池的支持 https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools。 ARM 模板是否支持节点池?如果是这样,使用它们的语法是什么?我无法在线找到任何有关 ARM 模板支持的文档。

很遗憾,恐怕您目前无法使用 Azure 模板创建具有多个节点池的 AKS。在你提供的文档中,你需要启用 VMSS 才能创建具有多个节点池的 AKS。这是您可以在 CLI preview version for AKS 中启用它的代理类型。你在模板中找不到它。

除了 属性 agentPoolProfiles:

中的元素外,创建单节点池和多节点池的模板没有区别
"agentPoolProfiles": [
                    {
                        "name": "nodepool1",
                        "count": 1,
                        "vmSize": "Standard_DS2_v2",
                        "osDiskSizeGB": 100,
                        "storageProfile": "ManagedDisks",
                        "maxPods": 110,
                        "osType": "Linux"
                    },
                    {
                        "name": "secnodepool",
                        "count": 1,
                        "vmSize": "Standard_DS2_v2",
                        "osDiskSizeGB": 100,
                        "storageProfile": "ManagedDisks",
                        "maxPods": 110,
                        "osType": "Linux"
                    }
                ],

我认为当它真正发布时,多节点池将在模板中可用,而不是预览版本。所以您只需要耐心等待即可。

更新

对以上错误回答表示歉意。在“2019-02-01”"apiVersion"中,您已经可以在"agentPoolProfiles"属性"type"中设置代理类型为"VirtualMachineScaleSets"。我在“2018-03-31”测试的错误"apiVersion".

这是一个工作模板示例:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "resources": [
        {
            "type": "Microsoft.ContainerService/ManagedClusters",
            "apiVersion": "2019-04-01",
            "name": "aks-test",
            "location": "eastus",
            "properties": {
                "kubernetesVersion": "1.13.5",
                "dnsPrefix": "xxx",
                "agentPoolProfiles": [
                    {
                        "name": "nodepool1",
                        "count": 1,
                        "vmSize": "Standard_DS2_v2",
                        "osDiskSizeGB": 100,
                        "storageProfile": "ManagedDisks",
                        "maxPods": 110,
                        "osType": "Linux",
                        "enable_auto_scaling": true,
                        "min_count": 1,
                        "max_count": 3,
                        "type": "VirtualMachineScaleSets"
                    },
                    {
                        "name": "nodepool2",
                        "count": 1,
                        "vmSize": "Standard_DS2_v2",
                        "osDiskSizeGB": 100,
                        "storageProfile": "ManagedDisks",
                        "maxPods": 110,
                        "osType": "Linux",
                        "enable_auto_scaling": true,
                        "min_count": 1,
                        "max_count": 3,
                        "type": "VirtualMachineScaleSets"
                    }
                ],
                "linuxProfile": {
                    "adminUsername": "azureuser",
                    "ssh": {
                        "publicKeys": [
                            {
                                "keyData": "key"
                            }
                        ]
                    }
                },
                "servicePrincipalProfile": {
                    "clientId": "yyy",
                    "secret": "zzz"
                },
                "enableRBAC": true,
                "networkProfile": {
                    "networkPlugin": "kubenet",
                    "podCidr": "10.244.0.0/16",
                    "serviceCidr": "10.0.0.0/16",
                    "dnsServiceIP": "10.0.0.10",
                    "dockerBridgeCidr": "172.17.0.1/16"
                }
            }
        }
    ]
}

您需要在 运行 之前启用 vmss 预览。