2021-08-05 10:56:38 -04:00
|
|
|
{
|
|
|
|
|
"$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)"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"workerIgnition" : {
|
|
|
|
|
"type" : "string",
|
|
|
|
|
"metadata" : {
|
|
|
|
|
"description" : "Ignition content for the worker nodes"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"numberOfNodes" : {
|
|
|
|
|
"type" : "int",
|
|
|
|
|
"defaultValue" : 3,
|
|
|
|
|
"minValue" : 2,
|
|
|
|
|
"maxValue" : 30,
|
|
|
|
|
"metadata" : {
|
|
|
|
|
"description" : "Number of OpenShift compute nodes to deploy"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"sshKeyData" : {
|
|
|
|
|
"type" : "securestring",
|
|
|
|
|
"metadata" : {
|
|
|
|
|
"description" : "SSH RSA public key file as a string"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"diagnosticsStorageAccountName": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"nodeVMSize" : {
|
|
|
|
|
"type" : "string",
|
|
|
|
|
"defaultValue" : "Standard_DS4_v2",
|
|
|
|
|
"metadata" : {
|
|
|
|
|
"description" : "The size of the each Node Virtual Machine"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"variables" : {
|
|
|
|
|
"location" : "[resourceGroup().location]",
|
|
|
|
|
"virtualNetworkName" : "[concat(parameters('baseName'), '-vnet')]",
|
|
|
|
|
"virtualNetworkID" : "[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
|
|
|
|
|
"nodeSubnetName" : "[concat(parameters('baseName'), '-worker-subnet')]",
|
|
|
|
|
"nodeSubnetRef" : "[concat(variables('virtualNetworkID'), '/subnets/', variables('nodeSubnetName'))]",
|
2025-08-19 18:24:43 +08:00
|
|
|
"masterLoadBalancerName" : "[concat(parameters('baseName'))]",
|
|
|
|
|
"outboundBackendPoolName" : "[concat(parameters('baseName'), '-outbound')]",
|
2021-08-05 10:56:38 -04:00
|
|
|
"sshKeyPath" : "/home/core/.ssh/authorized_keys",
|
2023-01-03 16:03:13 +01:00
|
|
|
"imageName" : "[parameters('baseName')]",
|
|
|
|
|
"masterAvailabilitySetName" : "[concat(parameters('baseName'), '-cluster')]",
|
2021-08-05 10:56:38 -04:00
|
|
|
"numberOfNodes" : "[parameters('numberOfNodes')]",
|
|
|
|
|
"vms" : {
|
|
|
|
|
"copy" : [
|
|
|
|
|
{
|
|
|
|
|
"name" : "vmNames",
|
|
|
|
|
"count" : "[parameters('numberOfNodes')]",
|
|
|
|
|
"input" : {
|
|
|
|
|
"name" : "[concat(parameters('baseName'), string('-worker-'), 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('numberOfNodes')]"
|
|
|
|
|
},
|
|
|
|
|
"name" : "[concat(variables('vms').vmNames[copyIndex()].name, '-nic')]",
|
|
|
|
|
"properties" : {
|
|
|
|
|
"ipConfigurations" : [
|
|
|
|
|
{
|
|
|
|
|
"name" : "pipConfig",
|
|
|
|
|
"properties" : {
|
|
|
|
|
"privateIPAllocationMethod" : "Dynamic",
|
|
|
|
|
"subnet" : {
|
|
|
|
|
"id" : "[variables('nodeSubnetRef')]"
|
2025-08-19 18:24:43 +08:00
|
|
|
},
|
|
|
|
|
"loadBalancerBackendAddressPools" : [
|
|
|
|
|
{
|
|
|
|
|
"id" : "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('masterLoadBalancerName'), '/backendAddressPools/', variables('outboundBackendPoolName'))]"
|
|
|
|
|
}
|
|
|
|
|
]
|
2021-08-05 10:56:38 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"apiVersion" : "2017-12-01",
|
|
|
|
|
"type" : "Microsoft.Compute/virtualMachines",
|
|
|
|
|
"location" : "[variables('location')]",
|
|
|
|
|
"copy" : {
|
|
|
|
|
"name" : "vmCopy",
|
|
|
|
|
"count" : "[variables('numberOfNodes')]"
|
|
|
|
|
},
|
|
|
|
|
"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('nodeVMSize')]"
|
|
|
|
|
},
|
|
|
|
|
"osProfile" : {
|
|
|
|
|
"computerName" : "[variables('vms').vmNames[copyIndex()].name]",
|
|
|
|
|
"adminUsername" : "core",
|
|
|
|
|
"customData" : "[parameters('workerIgnition')]",
|
|
|
|
|
"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",
|
|
|
|
|
"managedDisk": {
|
|
|
|
|
"storageAccountType": "Standard_LRS"
|
|
|
|
|
},
|
|
|
|
|
"diskSizeGB": 128
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"networkProfile" : {
|
|
|
|
|
"networkInterfaces" : [
|
|
|
|
|
{
|
|
|
|
|
"id" : "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('vms').vmNames[copyIndex()].name, '-nic'))]",
|
|
|
|
|
"properties": {
|
|
|
|
|
"primary": true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"diagnosticsProfile": {
|
|
|
|
|
"bootDiagnostics": {
|
|
|
|
|
"enabled": true,
|
|
|
|
|
"storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts', parameters('diagnosticsStorageAccountName'))).primaryEndpoints.blob]"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|