Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
508 lines (505 sloc) 15.3 KB
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"clusterName": {
"type": "string",
"metadata": {
"description": "The name of the AKS cluster."
}
},
"osDiskSizeGB": {
"type": "int",
"defaultValue": 0,
"metadata": {
"description": "Disk size (in GB) to provision for each of the agent pool nodes. This value ranges from 0 to 1023. Specifying 0 will apply the default disk size for that agentVMSize."
},
"minValue": 0,
"maxValue": 1023
},
"agentCount": {
"type": "int",
"defaultValue": 3,
"metadata": {
"description": "The number of nodes for the AKS cluster."
},
"minValue": 1,
"maxValue": 100
},
"agentVmSize": {
"type": "string",
"defaultValue": "Standard_B2s",
"allowedValues": [
"Standard_A1_v2",
"Standard_A2m_v2",
"Standard_A2_v2",
"Standard_A4m_v2",
"Standard_A4_v2",
"Standard_A8m_v2",
"Standard_A8_v2",
"Standard_B1ms",
"Standard_B1s",
"Standard_B2ms",
"Standard_B2s",
"Standard_B4ms",
"Standard_B8ms",
"Standard_D1_v2",
"Standard_D2_v2",
"Standard_D3_v2",
"Standard_D4_v2",
"Standard_D5_v2",
"Standard_D11_v2",
"Standard_D12_v2",
"Standard_D13_v2",
"Standard_D14_v2",
"Standard_D15_v2",
"Standard_DS1_v2",
"Standard_DS2_v2",
"Standard_DS3_v2",
"Standard_DS4_v2",
"Standard_DS5_v2",
"Standard_DS11_v2",
"Standard_DS12_v2",
"Standard_DS13_v2",
"Standard_DS14_v2",
"Standard_DS15_v2",
"Standard_D2_v3",
"Standard_D4_v3",
"Standard_D8_v3",
"Standard_D16_v3",
"Standard_D32_v3",
"Standard_D64_v3",
"Standard_D2s_v3",
"Standard_D4s_v3",
"Standard_D8s_v3",
"Standard_D16s_v3",
"Standard_D32s_v3",
"Standard_D64s_v3",
"Standard_E2_v3",
"Standard_E4_v3",
"Standard_E8_v3",
"Standard_E16_v3",
"Standard_E32_v3",
"Standard_E64_v3",
"Standard_E2s_v3",
"Standard_E4s_v3",
"Standard_E8s_v3",
"Standard_E16s_v3",
"Standard_E32s_v3",
"Standard_E64s_v3",
"Standard_F1",
"Standard_F2",
"Standard_F4",
"Standard_F8",
"Standard_F16",
"Standard_F1s",
"Standard_F2s",
"Standard_F4s",
"Standard_F8s",
"Standard_F16s",
"Standard_H8",
"Standard_H16",
"Standard_H8m",
"Standard_H16m",
"Standard_H16r",
"Standard_H16mr",
"Standard_G1",
"Standard_G2",
"Standard_G3",
"Standard_G4",
"Standard_G5",
"Standard_GS1",
"Standard_GS2",
"Standard_GS3",
"Standard_GS4",
"Standard_GS5",
"Standard_L4s",
"Standard_L8s",
"Standard_L16s",
"Standard_L32s",
"Standard_M64s",
"Standard_M64ms",
"Standard_M128s",
"Standard_M128ms",
"Standard_NC6",
"Standard_NC12",
"Standard_NC24",
"Standard_NC24r",
"Standard_NV6",
"Standard_NV12",
"Standard_NV24"
],
"metadata": {
"description": "The VM size of the nodes."
}
},
"linuxAdminUsername": {
"type": "string",
"defaultValue": "azureuser",
"metadata": {
"description": "User name for the Linux nodes."
}
},
"sshRsaPublicKey": {
"type": "string",
"metadata": {
"description": "Configure all linux machines with the SSH RSA public key string. Your key should include three parts, for example 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'"
}
},
"servicePrincipalClientId": {
"type": "securestring",
"metadata": {
"description": "The Servive Principal client id."
}
},
"servicePrincipalClientSecret": {
"type": "securestring",
"metadata": {
"description": "The Service Principal client secret."
}
},
"osType": {
"type": "string",
"defaultValue": "Linux",
"allowedValues": [
"Linux"
],
"metadata": {
"description": "The type of operating system."
}
},
"kubernetesVersion": {
"type": "string",
"defaultValue": "1.11.3",
"allowedValues": [
"1.9.10",
"1.9.11",
"1.10.7",
"1.10.8",
"1.11.2",
"1.11.3"
],
"metadata": {
"description": "The version of Kubernetes."
}
},
"aksRegion": {
"type": "string",
"defaultValue": "westeurope",
"allowedValues": [
"westeurope",
"eastus",
"eastus2",
"centralus",
"canadacentral",
"canadaeast",
"northeurope",
"australiaeast",
"uksouth",
"westus",
"westus2",
"japaneast",
"southeastasia"
],
"metadata": {
"description": "Azure region for AKS deployment."
}
},
"numberOfInstances": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "Number of AKS clusters to create"
},
"minValue": 1,
"maxValue": 100
},
"aksClusterNumeration": {
"type": "int",
"defaultValue": 1,
"metadata": {
"description": "Start numeration of AKS clusters. E.g. Set value to 1 for AKS1 and set value to 2 for AKS2 if AKS1 exists!"
}
},
"maxPods": {
"type": "int",
"defaultValue": 30,
"metadata": {
"description": "Maximum number of pods that can run on a node."
},
"maxValue": 110
},
"customVnet": {
"type": "string",
"defaultValue": "no",
"allowedValues": [
"yes",
"no"
],
"metadata": {
"description": "Specify if you want to deploy to a custom VNET."
}
},
"enableAadAuthentication": {
"type": "string",
"defaultValue": "no",
"allowedValues": [
"yes",
"no"
],
"metadata": {
"description": "Specify if you want to use Azure Active Directory for authentication."
}
},
"enableOmsAgent": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "boolean flag to turn on and off of omsagent addon"
}
},
"workspaceName": {
"type": "string",
"metadata": {
"description": "Log Analytics workspace name that has the Container Insights solution enabled"
}
},
"workspaceResourceGroup": {
"type": "string",
"metadata": {
"description": "Log Analytics workspace resource group name"
}
},
"enableHttpApplicationRouting": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "boolean flag to turn on and off of http application routing"
}
},
"networkPlugin": {
"type": "string",
"defaultValue": "kubenet",
"allowedValues": [
"azure",
"kubenet"
],
"metadata": {
"description": "Network plugin used for building Kubernetes network."
}
},
"networkPolicy": {
"type": "string",
"defaultValue": "calico",
"allowedValues": [
"calico",
"none"
],
"metadata": {
"description": "Network policy used for building Kubernetes network."
}
},
"vnetName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Virtual Network name"
}
},
"vnetSubnetName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of virtual network subnet used for nodes and/or pods IP assignment."
}
},
"vnetResourceGroupName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Resource group of the Virtual Network"
}
},
"serviceCidr": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "A CIDR notation IP range from which to assign service cluster IPs."
}
},
"dnsServiceIp": {
"type": "string",
"defaultValue": "10.0.0.10",
"metadata": {
"description": "Containers DNS server IP address."
}
},
"dockerBridgeCidr": {
"type": "string",
"defaultValue": "172.17.0.1/16",
"metadata": {
"description": "A CIDR notation IP for Docker bridge."
}
},
"aadClientAppId": {
"type": "securestring",
"metadata": {
"description": "Application id of the AAD client application"
}
},
"aadServerAppId": {
"type": "securestring",
"metadata": {
"description": "Application id of the AAD server application"
}
},
"aadServerAppSecret": {
"type": "securestring",
"metadata": {
"description": "Secret of the AAD server application"
}
},
"aadTenantId": {
"type": "securestring",
"metadata": {
"description": "Tenant id of the AAD tenant"
}
}
},
"variables": {
"apiVersion": {
"aks": "2018-03-31"
},
"linuxProfile": {
"adminUsername": "[parameters('linuxAdminUsername')]",
"sshRsaPublicKey": "[parameters('sshRsaPublicKey')]"
},
"servicePrincipalProfile": {
"servicePrincipalClientId": "[parameters('servicePrincipalClientId')]",
"servicePrincipalClientSecret": "[parameters('servicePrincipalClientSecret')]"
},
"agentPoolProfiles": {
"maxPods": "[parameters('maxPods')]",
"osDiskSizeGB": "[parameters('osDiskSizeGB')]",
"agentCount": "[parameters('agentCount')]",
"agentVmSize": "[parameters('agentVmSize')]",
"osType": "[parameters('osType')]",
"vnetSubnetId": "[concat(resourceId(parameters('vnetResourceGroupName'),'Microsoft.Network/virtualNetworks',parameters('vnetName')),'/subnets/',parameters('vnetSubnetName'))]"
},
"aksCluster": {
"clusterName": "[parameters('clusterName')]",
"dnsPrefix": "[parameters('clusterName')]",
"location": "[parameters('aksregion')]",
"kubernetesVersion": "[parameters('kubernetesVersion')]",
"enableOmsAgent": "[parameters('enableOmsAgent')]",
"enableHttpApplicationRouting": "[parameters('enableHttpApplicationRouting')]",
"workspaceId": "[resourceId(parameters('workspaceResourceGroup'),'Microsoft.OperationalInsights/workspaces',parameters('workspaceName'))]"
},
"identityConfiguration": {
"aadProfile": {
"clientAppId": "[parameters('aadClientAppId')]",
"serverAppId": "[parameters('aadServerAppId')]",
"serverAppSecret": "[parameters('aadServerAppSecret')]",
"tenantId": "[parameters('aadTenantId')]"
}
},
"networkConfiguration": {
"networkProfile": {
"networkPlugin": "[parameters('networkPlugin')]",
"serviceCidr": "[parameters('serviceCidr')]",
"dnsServiceIp": "[parameters('dnsServiceIp')]",
"dockerBridgeCidr": "[parameters('dockerBridgeCidr')]"
}
},
"networkConfigurationWithPolicy": {
"networkProfile": {
"networkPlugin": "[parameters('networkPlugin')]",
"networkPolicy": "[parameters('networkPolicy')]",
"serviceCidr": "[parameters('serviceCidr')]",
"dnsServiceIp": "[parameters('dnsServiceIp')]",
"dockerBridgeCidr": "[parameters('dockerBridgeCidr')]"
}
},
"deploymentConfiguration": {
"numberOfInstances": "[parameters('numberOfInstances')]",
"aksClusterNumeration": "[parameters('aksClusterNumeration')]",
"customVnet": "[parameters('customVnet')]",
"enableAadAuthentication": "[parameters('enableAadAuthentication')]",
"networkPolicy": "[parameters('networkPolicy')]"
},
"outputArray": {
"copy": [
{
"name": "aksClusterProperties",
"count": "[parameters('numberofInstances')]",
"input": {
"name": "[concat(parameters('clusterName'),copyIndex('aksClusterProperties',parameters('aksClusterNumeration')))]",
"value": "[resourceId('Microsoft.ContainerService/managedClusters/',concat(parameters('clusterName'),copyIndex('aksClusterProperties',parameters('aksClusterNumeration'))))]"
}
}
]
}
},
"resources": [
{
"apiVersion": "[variables('apiVersion').aks]",
"type": "Microsoft.ContainerService/managedClusters",
"name": "[concat(variables('aksCluster').clusterName,copyIndex(variables('deploymentConfiguration').aksClusterNumeration))]",
"location": "[variables('aksCluster').location]",
"copy": {
"name": "aksLoop",
"count": "[variables('deploymentConfiguration').numberOfInstances]"
},
"properties": {
"kubernetesVersion": "[variables('aksCluster').kubernetesVersion]",
"enableRBAC": true,
"dnsPrefix": "[concat(variables('aksCluster').dnsPrefix,copyIndex(variables('deploymentConfiguration').aksClusterNumeration))]",
"addonProfiles": {
"httpApplicationRouting": {
"enabled": "[variables('aksCluster').enableHttpApplicationRouting]"
},
"omsagent": {
"enabled": "[variables('aksCluster').enableOmsAgent]",
"config": {
"logAnalyticsWorkspaceResourceID": "[variables('aksCluster').workspaceId]"
}
}
},
"agentPoolProfiles": [
{
"name": "agentpool",
"maxPods": "[variables('agentPoolProfiles').maxPods]",
"osDiskSizeGB": "[variables('agentPoolProfiles').osDiskSizeGB]",
"count": "[variables('agentPoolProfiles').agentCount]",
"vmSize": "[variables('agentPoolProfiles').agentVmSize]",
"osType": "[variables('agentPoolProfiles').osType]",
"storageProfile": "ManagedDisks",
"vnetSubnetID": "[if(equals(variables('deploymentConfiguration').customVnet,'yes'), variables('agentPoolProfiles').vnetSubnetId, json('null'))]"
}
],
"networkProfile": "[if(equals(variables('deploymentConfiguration').networkPolicy,'none'),if(equals(variables('deploymentConfiguration').customVnet,'yes'), variables('networkConfiguration').networkProfile, json('null')),if(equals(variables('deploymentConfiguration').customVnet,'yes'), variables('networkConfigurationWithPolicy').networkProfile, json('null')))]",
"linuxProfile": {
"adminUsername": "[variables('linuxProfile').adminUsername]",
"ssh": {
"publicKeys": [
{
"keyData": "[variables('linuxProfile').sshRsaPublicKey]"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "[variables('servicePrincipalProfile').servicePrincipalClientId]",
"secret": "[variables('servicePrincipalProfile').servicePrincipalClientSecret]"
},
"aadProfile": "[if(equals(variables('deploymentConfiguration').enableAadAuthentication,'yes'), variables('identityConfiguration').aadProfile, json('null'))]"
}
}
],
"outputs": {
"aksClusterProperties": {
"type": "object",
"value": "[variables('outputArray')]"
}
}
}