{ "$schema" : "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion" : "1.0.0.0", "parameters" : { "baseName" : { "type" : "string", "minLength" : 1, "metadata" : { "description" : "Base name to be used in resource names (usually the cluster's Infra ID)" } }, "masterIgnition" : { "type" : "string", "metadata" : { "description" : "Ignition content for the master nodes" } }, "sshKeyData" : { "type" : "securestring", "metadata" : { "description" : "SSH RSA public key file as a string" } }, "diagnosticsStorageAccountName": { "type": "string" }, "masterVMSize" : { "type" : "string", "defaultValue" : "Standard_DS4_v2", "metadata" : { "description" : "The size of the Master Virtual Machines" } }, "diskSizeGB" : { "type" : "int", "defaultValue" : 1023, "metadata" : { "description" : "Size of the Master VM OS disk, in GB" } } }, "variables" : { "location" : "[resourceGroup().location]", "virtualNetworkName" : "[concat(parameters('baseName'), '-vnet')]", "virtualNetworkID" : "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]", "masterSubnetName" : "[concat(parameters('baseName'), '-master-subnet')]", "masterSubnetRef" : "[concat(variables('virtualNetworkID'), '/subnets/', variables('masterSubnetName'))]", "masterLoadBalancerName" : "[concat(parameters('baseName'))]", "masterAvailabilitySetName" : "[concat(parameters('baseName'), '-cluster')]", "internalLoadBalancerName" : "[concat(parameters('baseName'), '-internal')]", "sshKeyPath" : "/home/core/.ssh/authorized_keys", "clusterNsgName" : "[concat(parameters('baseName'), '-nsg')]", "imageName" : "[parameters('baseName')]", "numberOfMasters" : 3, "vms" : { "copy" : [ { "name" : "vmNames", "count" : "[variables('numberOfMasters')]", "input" : { "name" : "[concat(parameters('baseName'), string('-master-'), string(copyIndex('vmNames')))]" } } ] } }, "resources" : [ { "name": "[parameters('diagnosticsStorageAccountName')]", "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2017-10-01", "location": "[variables('location')]", "properties": {}, "kind": "Storage", "sku": { "name": "Standard_LRS" } }, { "apiVersion" : "2017-10-01", "type" : "Microsoft.Network/networkInterfaces", "location": "[variables('location')]", "copy" : { "name" : "nicCopy", "count" : "[variables('numberOfMasters')]" }, "name" : "[concat(variables('vms').vmNames[copyIndex()].name, '-nic')]", "properties" : { "ipConfigurations" : [ { "name" : "pipConfig", "properties" : { "privateIPAllocationMethod" : "Dynamic", "subnet" : { "id" : "[variables('masterSubnetRef')]" }, "loadBalancerBackendAddressPools" : [ { "id" : "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('masterLoadBalancerName'), '/backendAddressPools/', variables('masterLoadBalancerName'))]" }, { "id" : "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('internalLoadBalancerName'), '/backendAddressPools/', variables('internalLoadBalancerName'))]" } ] } } ] } }, { "apiVersion" : "2017-12-01", "type" : "Microsoft.Compute/virtualMachines", "location" : "[variables('location')]", "copy" : { "name" : "vmCopy", "count" : "[variables('numberOfMasters')]" }, "name" : "[variables('vms').vmNames[copyIndex()].name]", "dependsOn" : [ "[concat('Microsoft.Network/networkInterfaces/', concat(variables('vms').vmNames[copyIndex()].name, '-nic'))]", "[concat('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))]" ], "properties" : { "availabilitySet": { "id": "[resourceId('Microsoft.Compute/availabilitySets',variables('masterAvailabilitySetName'))]" }, "hardwareProfile" : { "vmSize" : "[parameters('masterVMSize')]" }, "osProfile" : { "computerName" : "[variables('vms').vmNames[copyIndex()].name]", "adminUsername" : "core", "customData" : "[parameters('masterIgnition')]", "linuxConfiguration" : { "disablePasswordAuthentication" : true, "ssh" : { "publicKeys" : [ { "path" : "[variables('sshKeyPath')]", "keyData" : "[parameters('sshKeyData')]" } ] } } }, "storageProfile" : { "imageReference": { "id": "[resourceId('Microsoft.Compute/images', variables('imageName'))]" }, "osDisk" : { "name": "[concat(variables('vms').vmNames[copyIndex()].name, '_OSDisk')]", "osType" : "Linux", "createOption" : "FromImage", "writeAcceleratorEnabled": false, "managedDisk": { "storageAccountType": "Standard_LRS" }, "diskSizeGB" : "[parameters('diskSizeGB')]" } }, "networkProfile" : { "networkInterfaces" : [ { "id" : "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('vms').vmNames[copyIndex()].name, '-nic'))]", "properties": { "primary": false } } ] }, "diagnosticsProfile": { "bootDiagnostics": { "enabled": true, "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('diagnosticsStorageAccountName'))).primaryEndpoints.blob]" } } } } ] }