Azure Templates Support For AKS Node Pools

5/6/2019

AKS has recently released support for node pools https://docs.microsoft.com/en-us/azure/aks/use-multiple-node-pools . Are node pools supported in ARM templates? If so what is the syntax for using them? I was not able to find any documentation about ARM template support online.

-- ilooner
azure
azure-aks
azure-kubernetes
azure-template

2 Answers

5/7/2019

here's a working template example:

{
    "$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"
                }
            }
        }
    ]
}

you'd need to enable vmss preview before running this.

enter image description here

-- 4c74356b41
Source: StackOverflow

5/7/2019

Unfortunately, I'm afraid you cannot use the Azure Template to create AKS with multiple node pools currently. In the document that you provide, you need to enable the VMSS to create AKS with multiple node pools. It's the agent type which you just can enable it in the CLI preview version for AKS. And you cannot find it in the template.

There is no difference in both templates for single node pool and multiple node pools when you create it except the elements in the property 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"
                    }
                ],

I think the multiple node pools will be available in the template when the it really publish, not the preview version. So you just need to wait patiently.

Update

Apologize for the above wrong answer. In the "2019-02-01" "apiVersion", you can already set the agent type as "VirtualMachineScaleSets" in the property "type" in "agentPoolProfiles". The mistake that I test it in "2018-03-31" "apiVersion".

-- Charles Xu
Source: StackOverflow