1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00
Files
installer/upi/azurestack/06_workers.json
2025-08-19 18:24:43 +08:00

178 lines
5.9 KiB
JSON

{
"$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'))]",
"masterLoadBalancerName" : "[concat(parameters('baseName'))]",
"outboundBackendPoolName" : "[concat(parameters('baseName'), '-outbound')]",
"sshKeyPath" : "/home/core/.ssh/authorized_keys",
"imageName" : "[parameters('baseName')]",
"masterAvailabilitySetName" : "[concat(parameters('baseName'), '-cluster')]",
"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')]"
},
"loadBalancerBackendAddressPools" : [
{
"id" : "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/loadBalancers/', variables('masterLoadBalancerName'), '/backendAddressPools/', variables('outboundBackendPoolName'))]"
}
]
}
}
]
}
},
{
"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]"
}
}
}
}
]
}