Skip to content

Instantly share code, notes, and snippets.

@NileshGule
Last active January 22, 2018 16:06
Show Gist options
  • Save NileshGule/ef7724804b3a9ff6c300ca88160ec0a9 to your computer and use it in GitHub Desktop.
Save NileshGule/ef7724804b3a9ff6c300ca88160ec0a9 to your computer and use it in GitHub Desktop.
Gist related to Azure ARM blog post
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"agentCount": {
"allowedValues": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"defaultValue": 2,
"metadata": {
"description": "The number of agents for the cluster. This value can be from 1 to 10"
},
"type": "int"
},
"agentEndpointDNSNamePrefix": {
"defaultValue": "swarmagent",
"metadata": {
"description": "Sets the Domain name label for the agent pool IP Address. The concatenation of the domain name label and the regional DNS zone make up the fully qualified domain name associated with the public IP address."
},
"type": "string"
},
"agentSubnet": {
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "Sets the subnet of agent pool 'agent'."
},
"type": "string"
},
"agentVMSize": {
"allowedValues": [
"Basic_A2",
"Basic_A3",
"Basic_A4",
"Standard_A10",
"Standard_A11",
"Standard_A2",
"Standard_A2_v2",
"Standard_A2m_v2",
"Standard_A3",
"Standard_A4",
"Standard_A4_v2",
"Standard_A4m_v2",
"Standard_A5",
"Standard_A6",
"Standard_A7",
"Standard_A8",
"Standard_A8_v2",
"Standard_A8m_v2",
"Standard_A9",
"Standard_D11",
"Standard_D11_v2",
"Standard_D12",
"Standard_D12_v2",
"Standard_D13",
"Standard_D13_v2",
"Standard_D14",
"Standard_D14_v2",
"Standard_D15_v2",
"Standard_D2",
"Standard_D2_v2",
"Standard_D3",
"Standard_D3_v2",
"Standard_D4",
"Standard_D4_v2",
"Standard_D5_v2",
"Standard_DS11",
"Standard_DS11_v2",
"Standard_DS12",
"Standard_DS12_v2",
"Standard_DS13",
"Standard_DS13_v2",
"Standard_DS14",
"Standard_DS14_v2",
"Standard_DS15_v2",
"Standard_DS2",
"Standard_DS2_v2",
"Standard_DS3",
"Standard_DS3_v2",
"Standard_DS4",
"Standard_DS4_v2",
"Standard_DS5_v2",
"Standard_F16",
"Standard_F16s",
"Standard_F2",
"Standard_F2s",
"Standard_F4",
"Standard_F4s",
"Standard_F8",
"Standard_F8s",
"Standard_G1",
"Standard_G2",
"Standard_G3",
"Standard_G4",
"Standard_G5",
"Standard_GS1",
"Standard_GS2",
"Standard_GS3",
"Standard_GS4",
"Standard_GS5",
"Standard_H16",
"Standard_H16m",
"Standard_H16mr",
"Standard_H16r",
"Standard_H8",
"Standard_H8m",
"Standard_NC12",
"Standard_NC24",
"Standard_NC24r",
"Standard_NC6",
"Standard_NV12",
"Standard_NV24",
"Standard_NV6"
],
"defaultValue": "Standard_D2_v2",
"metadata": {
"description": "The size of the Virtual Machine."
},
"type": "string"
},
"firstConsecutiveStaticIP": {
"defaultValue": "172.16.0.5",
"metadata": {
"description": "Sets the static IP of the first master"
},
"type": "string"
},
"linuxAdminUsername": {
"defaultValue": "swarmadmin",
"metadata": {
"description": "User name for the Linux Virtual Machines (SSH or Password)."
},
"type": "string"
},
"location": {
"defaultValue": "Southeast Asia",
"metadata": {
"description": "Sets the location for all resources in the cluster"
},
"type": "string"
},
"masterEndpointDNSNamePrefix": {
"defaultValue": "swarmmaster",
"metadata": {
"description": "Sets the Domain name label for the master IP Address. The concatenation of the domain name label and the regional DNS zone make up the fully qualified domain name associated with the public IP address."
},
"type": "string"
},
"masterSubnet": {
"defaultValue": "172.16.0.0/24",
"metadata": {
"description": "Sets the subnet of the master node(s)."
},
"type": "string"
},
"masterVMSize": {
"allowedValues": [
"Basic_A2",
"Basic_A3",
"Basic_A4",
"Standard_A10",
"Standard_A11",
"Standard_A2",
"Standard_A2_v2",
"Standard_A2m_v2",
"Standard_A3",
"Standard_A4",
"Standard_A4_v2",
"Standard_A4m_v2",
"Standard_A5",
"Standard_A6",
"Standard_A7",
"Standard_A8",
"Standard_A8_v2",
"Standard_A8m_v2",
"Standard_A9",
"Standard_D11",
"Standard_D11_v2",
"Standard_D12",
"Standard_D12_v2",
"Standard_D13",
"Standard_D13_v2",
"Standard_D14",
"Standard_D14_v2",
"Standard_D15_v2",
"Standard_D2",
"Standard_D2_v2",
"Standard_D3",
"Standard_D3_v2",
"Standard_D4",
"Standard_D4_v2",
"Standard_D5_v2",
"Standard_DS11",
"Standard_DS11_v2",
"Standard_DS12",
"Standard_DS12_v2",
"Standard_DS13",
"Standard_DS13_v2",
"Standard_DS14",
"Standard_DS14_v2",
"Standard_DS15_v2",
"Standard_DS2",
"Standard_DS2_v2",
"Standard_DS3",
"Standard_DS3_v2",
"Standard_DS4",
"Standard_DS4_v2",
"Standard_DS5_v2",
"Standard_F16",
"Standard_F16s",
"Standard_F2",
"Standard_F2s",
"Standard_F4",
"Standard_F4s",
"Standard_F8",
"Standard_F8s",
"Standard_G1",
"Standard_G2",
"Standard_G3",
"Standard_G4",
"Standard_G5",
"Standard_GS1",
"Standard_GS2",
"Standard_GS3",
"Standard_GS4",
"Standard_GS5",
"Standard_H16",
"Standard_H16m",
"Standard_H16mr",
"Standard_H16r",
"Standard_H8",
"Standard_H8m",
"Standard_NC12",
"Standard_NC24",
"Standard_NC24r",
"Standard_NC6",
"Standard_NV12",
"Standard_NV24",
"Standard_NV6"
],
"metadata": {
"description": "The size of the Virtual Machine."
},
"type": "string"
},
"nameSuffix": {
"defaultValue": "13957614",
"metadata": {
"description": "A string hash of the master DNS name to uniquely identify the cluster."
},
"type": "string"
},
"sshRSAPublicKey": {
"metadata": {
"description": "SSH public key used for auth to all Linux machines. Not Required. If not set, you must provide a password key."
},
"type": "string"
},
"targetEnvironment": {
"defaultValue": "AzureCloud",
"metadata": {
"description": "The azure deploy environment. Currently support: AzureCloud, AzureChinaCloud"
},
"type": "string"
}
},
"variables": {
"adminUsername": "[parameters('linuxAdminUsername')]",
"agentAccountName": "[concat(variables('storageAccountBaseName'), 'agnt0')]",
"agentCount": "[parameters('agentCount')]",
"agentCustomScript": "[concat('/usr/bin/nohup /bin/bash -c \"/bin/bash /opt/azure/containers/',variables('configureClusterScriptFile'), ' ',variables('clusterInstallParameters'),' >> /var/log/azure/cluster-bootstrap.log 2>&1 &\" &')]",
"agentEndpointDNSNamePrefix": "[tolower(parameters('agentEndpointDNSNamePrefix'))]",
"agentIPAddressName": "[concat(variables('orchestratorName'), '-agent-ip-', variables('agentEndpointDNSNamePrefix'), '-', variables('nameSuffix'))]",
"agentIndex": 0,
"agentLbBackendPoolName": "[concat(variables('orchestratorName'), '-agent-', variables('nameSuffix'))]",
"agentLbID": "[resourceId('Microsoft.Network/loadBalancers',variables('agentLbName'))]",
"agentLbIPConfigID": "[concat(variables('agentLbID'),'/frontendIPConfigurations/', variables('agentLbIPConfigName'))]",
"agentLbIPConfigName": "[concat(variables('orchestratorName'), '-agent-', variables('nameSuffix'))]",
"agentLbName": "[concat(variables('orchestratorName'), '-agent-', variables('nameSuffix'))]",
"agentMaxVMs": 100,
"agentRunCmd": "[concat('runcmd:\n - [ /bin/bash, /opt/azure/containers/install-cluster.sh ]\n\n')]",
"agentRunCmdFile": "[concat(' - content: |\n #!/bin/bash\n ','sudo mkdir -p /var/log/azure\n ',variables('agentCustomScript'),'\n path: /opt/azure/containers/install-cluster.sh\n permissions: \"0744\"\n')]",
"agentStorageAccountOffset": "[mul(variables('maxStorageAccountsPerAgent'),0)]",
"agentStorageAccountsCount": "[variables('maxStorageAccountsPerAgent')]",
"agentSubnet": "[parameters('agentSubnet')]",
"agentSubnetName": "[concat(variables('orchestratorName'), '-agentsubnet')]",
"agentVMNamePrefix": "[concat(variables('orchestratorName'), '-agent-', variables('nameSuffix'))]",
"agentVMSize": "[parameters('agentVMSize')]",
"agentVnetSubnetID": "[concat(variables('vnetID'),'/subnets/',variables('agentSubnetName'))]",
"apiVersionDefault": "2016-03-30",
"apiVersionStorage": "2015-06-15",
"clusterInstallParameters": "[concat(variables('masterCount'), ' ',variables('masterVMNamePrefix'), ' ',variables('masterFirstAddrOctet4'), ' ',variables('adminUsername'),' ',variables('postInstallScriptURI'),' ',variables('masterFirstAddrPrefix'))]",
"configureClusterScriptFile": "configure-swarmmode-cluster.sh",
"dataStorageAccountPrefixSeed": 97,
"location": "[variables('locations')[mod(add(2,length(parameters('location'))),add(1,length(parameters('location'))))]]",
"locations": [
"[resourceGroup().location]",
"[parameters('location')]"
],
"masterAvailabilitySet": "[concat(variables('orchestratorName'), '-master-availabilitySet-', variables('nameSuffix'))]",
"masterCount": 1,
"masterCustomScript": "[concat('/bin/bash -c \"/bin/bash /opt/azure/containers/',variables('configureClusterScriptFile'), ' ',variables('clusterInstallParameters'),' >> /var/log/azure/cluster-bootstrap.log 2>&1\"')]",
"masterEndpointDNSNamePrefix": "[tolower(parameters('masterEndpointDNSNamePrefix'))]",
"masterFirstAddrOctet4": "[variables('masterFirstAddrOctets')[3]]",
"masterFirstAddrOctets": "[split(parameters('firstConsecutiveStaticIP'),'.')]",
"masterFirstAddrPrefix": "[concat(variables('masterFirstAddrOctets')[0],'.',variables('masterFirstAddrOctets')[1],'.',variables('masterFirstAddrOctets')[2],'.')]",
"masterLbBackendPoolName": "[concat(variables('orchestratorName'), '-master-pool-', variables('nameSuffix'))]",
"masterLbID": "[resourceId('Microsoft.Network/loadBalancers',variables('masterLbName'))]",
"masterLbIPConfigID": "[concat(variables('masterLbID'),'/frontendIPConfigurations/', variables('masterLbIPConfigName'))]",
"masterLbIPConfigName": "[concat(variables('orchestratorName'), '-master-lbFrontEnd-', variables('nameSuffix'))]",
"masterLbInboundNatRules": [
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'0')]"
},
{
"id": "[concat(variables('masterSshPort22InboundNatRuleIdPrefix'),'0')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'1')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'2')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'3')]"
}
],
[
{
"id": "[concat(variables('masterSshInboundNatRuleIdPrefix'),'4')]"
}
]
],
"masterLbName": "[concat(variables('orchestratorName'), '-master-lb-', variables('nameSuffix'))]",
"masterPublicIPAddressName": "[concat(variables('orchestratorName'), '-master-ip-', variables('masterEndpointDNSNamePrefix'), '-', variables('nameSuffix'))]",
"masterSshInboundNatRuleIdPrefix": "[concat(variables('masterLbID'),'/inboundNatRules/SSH-',variables('masterVMNamePrefix'))]",
"masterSshPort22InboundNatRuleIdPrefix": "[concat(variables('masterLbID'),'/inboundNatRules/SSHPort22-',variables('masterVMNamePrefix'))]",
"masterSshPort22InboundNatRuleNamePrefix": "[concat(variables('masterLbName'),'/SSHPort22-',variables('masterVMNamePrefix'))]",
"masterStorageAccountName": "[concat(variables('storageAccountBaseName'), '0')]",
"masterSubnet": "[parameters('masterSubnet')]",
"masterSubnetName": "[concat(variables('orchestratorName'), '-masterSubnet')]",
"masterVMNamePrefix": "[concat(variables('orchestratorName'), '-master-', variables('nameSuffix'), '-')]",
"masterVMSize": "[parameters('masterVMSize')]",
"masterVnetSubnetID": "[concat(variables('vnetID'),'/subnets/',variables('masterSubnetName'))]",
"maxStorageAccountsPerAgent": "[div(variables('maxVMsPerPool'),variables('maxVMsPerStorageAccount'))]",
"maxVMsPerPool": 100,
"maxVMsPerStorageAccount": 20,
"nameSuffix": "[parameters('nameSuffix')]",
"orchestratorName": "swarmm",
"osImageOffer": "UbuntuServer",
"osImagePublisher": "Canonical",
"osImageSKU": "16.04-LTS",
"osImageVersion": "16.04.201703070",
"postInstallScriptURI": "disabled",
"sshKeyPath": "[concat('/home/', variables('adminUsername'), '/.ssh/authorized_keys')]",
"sshRSAPublicKey": "[parameters('sshRSAPublicKey')]",
"storageAccountBaseName": "[uniqueString(concat(variables('masterEndpointDNSNamePrefix'),variables('location')))]",
"storageAccountPrefixes": [
"0",
"6",
"c",
"i",
"o",
"u",
"1",
"7",
"d",
"j",
"p",
"v",
"2",
"8",
"e",
"k",
"q",
"w",
"3",
"9",
"f",
"l",
"r",
"x",
"4",
"a",
"g",
"m",
"s",
"y",
"5",
"b",
"h",
"n",
"t",
"z"
],
"storageAccountPrefixesCount": "[length(variables('storageAccountPrefixes'))]",
"virtualNetworkName": "[concat(variables('orchestratorName'), '-vnet-', variables('nameSuffix'))]",
"vmSizesMap": {
"Basic_A2": {
"storageAccountType": "Standard_LRS"
},
"Basic_A3": {
"storageAccountType": "Standard_LRS"
},
"Basic_A4": {
"storageAccountType": "Standard_LRS"
},
"Standard_A10": {
"storageAccountType": "Standard_LRS"
},
"Standard_A11": {
"storageAccountType": "Standard_LRS"
},
"Standard_A2": {
"storageAccountType": "Standard_LRS"
},
"Standard_A2_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_A2m_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_A3": {
"storageAccountType": "Standard_LRS"
},
"Standard_A4": {
"storageAccountType": "Standard_LRS"
},
"Standard_A4_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_A4m_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_A5": {
"storageAccountType": "Standard_LRS"
},
"Standard_A6": {
"storageAccountType": "Standard_LRS"
},
"Standard_A7": {
"storageAccountType": "Standard_LRS"
},
"Standard_A8": {
"storageAccountType": "Standard_LRS"
},
"Standard_A8_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_A8m_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_A9": {
"storageAccountType": "Standard_LRS"
},
"Standard_D11": {
"storageAccountType": "Standard_LRS"
},
"Standard_D11_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D12": {
"storageAccountType": "Standard_LRS"
},
"Standard_D12_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D13": {
"storageAccountType": "Standard_LRS"
},
"Standard_D13_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D14": {
"storageAccountType": "Standard_LRS"
},
"Standard_D14_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D15_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D2_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D3": {
"storageAccountType": "Standard_LRS"
},
"Standard_D3_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D4": {
"storageAccountType": "Standard_LRS"
},
"Standard_D4_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_D5_v2": {
"storageAccountType": "Standard_LRS"
},
"Standard_DS11": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS11_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS12": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS12_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS13": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS13_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS14": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS14_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS15_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS2_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS3": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS3_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS4": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS4_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_DS5_v2": {
"storageAccountType": "Premium_LRS"
},
"Standard_F16": {
"storageAccountType": "Standard_LRS"
},
"Standard_F16s": {
"storageAccountType": "Premium_LRS"
},
"Standard_F2": {
"storageAccountType": "Standard_LRS"
},
"Standard_F2s": {
"storageAccountType": "Premium_LRS"
},
"Standard_F4": {
"storageAccountType": "Standard_LRS"
},
"Standard_F4s": {
"storageAccountType": "Premium_LRS"
},
"Standard_F8": {
"storageAccountType": "Standard_LRS"
},
"Standard_F8s": {
"storageAccountType": "Premium_LRS"
},
"Standard_G1": {
"storageAccountType": "Standard_LRS"
},
"Standard_G2": {
"storageAccountType": "Standard_LRS"
},
"Standard_G3": {
"storageAccountType": "Standard_LRS"
},
"Standard_G4": {
"storageAccountType": "Standard_LRS"
},
"Standard_G5": {
"storageAccountType": "Standard_LRS"
},
"Standard_GS1": {
"storageAccountType": "Premium_LRS"
},
"Standard_GS2": {
"storageAccountType": "Premium_LRS"
},
"Standard_GS3": {
"storageAccountType": "Premium_LRS"
},
"Standard_GS4": {
"storageAccountType": "Premium_LRS"
},
"Standard_GS5": {
"storageAccountType": "Premium_LRS"
},
"Standard_H16": {
"storageAccountType": "Standard_LRS"
},
"Standard_H16m": {
"storageAccountType": "Standard_LRS"
},
"Standard_H16mr": {
"storageAccountType": "Standard_LRS"
},
"Standard_H16r": {
"storageAccountType": "Standard_LRS"
},
"Standard_H8": {
"storageAccountType": "Standard_LRS"
},
"Standard_H8m": {
"storageAccountType": "Standard_LRS"
},
"Standard_NC12": {
"storageAccountType": "Standard_LRS"
},
"Standard_NC24": {
"storageAccountType": "Standard_LRS"
},
"Standard_NC24r": {
"storageAccountType": "Standard_LRS"
},
"Standard_NC6": {
"storageAccountType": "Standard_LRS"
},
"Standard_NV12": {
"storageAccountType": "Standard_LRS"
},
"Standard_NV24": {
"storageAccountType": "Standard_LRS"
},
"Standard_NV6": {
"storageAccountType": "Standard_LRS"
}
},
"vmsPerStorageAccount": 20,
"vnetID": "[resourceId('Microsoft.Network/virtualNetworks',variables('virtualNetworkName'))]"
},
"resources": [
{
"apiVersion": "2015-06-15",
"copy": {
"count": "[variables('agentStorageAccountsCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('storageAccountPrefixes')[mod(add(copyIndex(),variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(copyIndex(),variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName'))]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('agentVMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{
"apiVersion": "2016-03-30",
"location": "[variables('location')]",
"name": "[variables('agentIPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('agentEndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "2016-03-30",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('agentIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('agentLbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('agentLbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('agentLbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('agentIPAddressName'))]"
}
}
}
],
"inboundNatRules": [],
"loadBalancingRules": [
{
"name": "LBRule9000",
"properties": {
"backendAddressPool": {
"id": "[concat(variables('agentLbID'), '/backendAddressPools/', variables('agentLbBackendPoolName'))]"
},
"backendPort": 9000,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('agentLbIPConfigID')]"
},
"frontendPort": 9000,
"idleTimeoutInMinutes": 5,
"loadDistribution": "Default",
"probe": {
"id": "[concat(variables('agentLbID'),'/probes/tcp9000Probe')]"
},
"protocol": "Tcp"
}
},
{
"name": "LBRule80",
"properties": {
"backendAddressPool": {
"id": "[concat(variables('agentLbID'), '/backendAddressPools/', variables('agentLbBackendPoolName'))]"
},
"backendPort": 80,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('agentLbIPConfigID')]"
},
"frontendPort": 80,
"idleTimeoutInMinutes": 5,
"loadDistribution": "Default",
"probe": {
"id": "[concat(variables('agentLbID'),'/probes/tcp80Probe')]"
},
"protocol": "Tcp"
}
},
{
"name": "LBRule443",
"properties": {
"backendAddressPool": {
"id": "[concat(variables('agentLbID'), '/backendAddressPools/', variables('agentLbBackendPoolName'))]"
},
"backendPort": 443,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('agentLbIPConfigID')]"
},
"frontendPort": 443,
"idleTimeoutInMinutes": 5,
"loadDistribution": "Default",
"probe": {
"id": "[concat(variables('agentLbID'),'/probes/tcp443Probe')]"
},
"protocol": "Tcp"
}
},
{
"name": "LBRule8080",
"properties": {
"backendAddressPool": {
"id": "[concat(variables('agentLbID'), '/backendAddressPools/', variables('agentLbBackendPoolName'))]"
},
"backendPort": 8080,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('agentLbIPConfigID')]"
},
"frontendPort": 8080,
"idleTimeoutInMinutes": 5,
"loadDistribution": "Default",
"probe": {
"id": "[concat(variables('agentLbID'),'/probes/tcp8080Probe')]"
},
"protocol": "Tcp"
}
}
],
"probes": [
{
"name": "tcp9000Probe",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": 9000,
"protocol": "Tcp"
}
},
{
"name": "tcp80Probe",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": 80,
"protocol": "Tcp"
}
},
{
"name": "tcp443Probe",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": 443,
"protocol": "Tcp"
}
},
{
"name": "tcp8080Probe",
"properties": {
"intervalInSeconds": 5,
"numberOfProbes": 2,
"port": 8080,
"protocol": "Tcp"
}
}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{
"apiVersion": "2016-03-30",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(0,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(1,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(2,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(3,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName'))]",
"[concat('Microsoft.Storage/storageAccounts/', variables('storageAccountPrefixes')[mod(add(4,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName'))]",
"[variables('vnetID')]",
"[variables('agentLbID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('agentVMNamePrefix'), '-vmss')]",
"properties": {
"upgradePolicy": {
"mode": "Automatic"
},
"virtualMachineProfile": {
"networkProfile": {
"networkInterfaceConfigurations": [
{
"name": "nic",
"properties": {
"ipConfigurations": [
{
"name": "nicipconfig",
"properties": {
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('agentLbID'), '/backendAddressPools/', variables('agentLbBackendPoolName'))]"
}
],
"subnet": {
"id": "[variables('agentVnetSubnetID')]"
}
}
}
],
"primary": "true"
}
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computerNamePrefix": "[variables('agentVMNamePrefix')]",
"customData": "[base64(concat('#cloud-config\n\nwrite_files:\n - encoding: gzip\n content: !!binary |\n H4sIACkUqlkAA81ZbXPbNhL+zl+xpTW1nYaipDSXOWeUG8dWLp6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Y18Bti88rlFn3s2H5Yec/mhExi22JbJsQ9Q7zQwR9gQlxwJDheOx3CbbN7DLjNwZfhr+dGthHaG+/cTQ7bvu1G5IT+xp/sMe8RSEOuDH3nLEnZKEkTdQdi7BxNZ5sD2LXHiF2NlxXUg5Qe08cf080Ql6vraFF3BlkhWTtKOSiHevjp/NzMzS/y8suc/Ap8pLNylY6PU/FJNKxTsLJrq9QrafdkytXAVINQ8kv7/1FmVVhlsf01NtmdgkZs+ogL32F9inEbjbAvo68JtQ3tGk8E+lwfTm6S6IZQi/EYuUbfm+zpVkZ5MlNkRfk/A3Sa8GvNcaf15O54M9jfkSCTYlbR8eaNOdek4jpk9I0ltJ/Xg5EQSqqczQICanE2UQ46b75vw/fmy4Kxs+wC6JzE0U4krbPIfJLXX+eNMDWTKVcI/PGP+naK6zhM50lcdH5j2R32I1OG1ZuSmRgrXJNOJRu4LSeFoohAQIli4dkKvQPkPmjDFFs+zBu4utNnEs+DoFQXcp74H9DolC7TGQAA\n path: /opt/azure/containers/configure-swarmmode-cluster.sh\n permissions: \"0744\"\n\n',variables('agentRunCmdFile'),variables('agentRunCmd')))]",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "latest"
},
"osDisk": {
"caching": "ReadWrite",
"createOption": "FromImage",
"name": "vmssosdisk",
"vhdContainers": [
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(0,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(0,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName')), variables('apiVersionStorage') ).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(1,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(1,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(2,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(2,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(3,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(3,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]",
"[concat(reference(concat('Microsoft.Storage/storageAccounts/',variables('storageAccountPrefixes')[mod(add(4,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('storageAccountPrefixes')[div(add(4,variables('agentStorageAccountOffset')),variables('storageAccountPrefixesCount'))],variables('agentAccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'osdisk')]"
]
}
}
}
},
"sku": {
"capacity": "[variables('agentCount')]",
"name": "[variables('agentVMSize')]",
"tier": "Standard"
},
"tags": {
"creationSource": "[concat('acsengine-', variables('agentVMNamePrefix'), '-vmss')]"
},
"type": "Microsoft.Compute/virtualMachineScaleSets"
},
{
"apiVersion": "2015-06-15",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterStorageAccountName')]",
"properties": {
"accountType": "[variables('vmSizesMap')[variables('masterVMSize')].storageAccountType]"
},
"type": "Microsoft.Storage/storageAccounts"
},
{
"apiVersion": "2016-03-30",
"location": "[variables('location')]",
"name": "[variables('virtualNetworkName')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('masterSubnet')]",
"[variables('agentSubnet')]"
]
},
"subnets": [
{
"name": "[variables('masterSubnetName')]",
"properties": {
"addressPrefix": "[variables('masterSubnet')]"
}
},
{
"name": "[variables('agentSubnetName')]",
"properties": {
"addressPrefix": "[variables('agentSubnet')]"
}
}
]
},
"type": "Microsoft.Network/virtualNetworks"
},
{
"apiVersion": "2016-03-30",
"location": "[variables('location')]",
"name": "[variables('masterAvailabilitySet')]",
"properties": {},
"type": "Microsoft.Compute/availabilitySets"
},
{
"apiVersion": "2016-03-30",
"location": "[variables('location')]",
"name": "[variables('masterPublicIPAddressName')]",
"properties": {
"dnsSettings": {
"domainNameLabel": "[variables('masterEndpointDNSNamePrefix')]"
},
"publicIPAllocationMethod": "Dynamic"
},
"type": "Microsoft.Network/publicIPAddresses"
},
{
"apiVersion": "2016-03-30",
"dependsOn": [
"[concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))]"
],
"location": "[variables('location')]",
"name": "[variables('masterLbName')]",
"properties": {
"backendAddressPools": [
{
"name": "[variables('masterLbBackendPoolName')]"
}
],
"frontendIPConfigurations": [
{
"name": "[variables('masterLbIPConfigName')]",
"properties": {
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIPAddresses',variables('masterPublicIPAddressName'))]"
}
}
}
]
},
"type": "Microsoft.Network/loadBalancers"
},
{
"apiVersion": "2016-03-30",
"copy": {
"count": "[variables('masterCount')]",
"name": "masterLbLoopNode"
},
"dependsOn": [
"[variables('masterLbID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterLbName'), '/', 'SSH-', variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"backendPort": 22,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": "[copyIndex(2200)]",
"protocol": "tcp"
},
"type": "Microsoft.Network/loadBalancers/inboundNatRules"
},
{
"apiVersion": "2016-03-30",
"dependsOn": [
"[variables('masterLbID')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterSshPort22InboundNatRuleNamePrefix'), '0')]",
"properties": {
"backendPort": 2222,
"enableFloatingIP": false,
"frontendIPConfiguration": {
"id": "[variables('masterLbIPConfigID')]"
},
"frontendPort": "22",
"protocol": "tcp"
},
"type": "Microsoft.Network/loadBalancers/inboundNatRules"
},
{
"apiVersion": "2016-03-30",
"copy": {
"count": "[variables('masterCount')]",
"name": "nicLoopNode"
},
"dependsOn": [
"[variables('vnetID')]",
"[variables('masterLbID')]",
"[concat(variables('masterSshPort22InboundNatRuleIdPrefix'),'0')]",
"[concat(variables('masterSshInboundNatRuleIdPrefix'),copyIndex())]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"properties": {
"ipConfigurations": [
{
"name": "ipConfigNode",
"properties": {
"loadBalancerBackendAddressPools": [
{
"id": "[concat(variables('masterLbID'), '/backendAddressPools/', variables('masterLbBackendPoolName'))]"
}
],
"loadBalancerInboundNatRules": "[variables('masterLbInboundNatRules')[copyIndex()]]",
"privateIPAddress": "[concat(variables('masterFirstAddrPrefix'), copyIndex(int(variables('masterFirstAddrOctet4'))))]",
"privateIPAllocationMethod": "Static",
"subnet": {
"id": "[variables('masterVnetSubnetID')]"
}
}
}
]
},
"type": "Microsoft.Network/networkInterfaces"
},
{
"apiVersion": "2016-03-30",
"copy": {
"count": "[variables('masterCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', variables('masterVMNamePrefix'), 'nic-', copyIndex())]",
"[concat('Microsoft.Compute/availabilitySets/',variables('masterAvailabilitySet'))]",
"[variables('masterStorageAccountName')]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
"properties": {
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets',variables('masterAvailabilitySet'))]"
},
"hardwareProfile": {
"vmSize": "[variables('masterVMSize')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('masterVMNamePrefix'), 'nic-', copyIndex()))]"
}
]
},
"osProfile": {
"adminUsername": "[variables('adminUsername')]",
"computerName": "[concat(variables('masterVMNamePrefix'), copyIndex())]",
"customData": "[base64('#cloud-config\n\nwrite_files:\n - encoding: gzip\n content: !!binary |\n H4sIACkUqlkAA81ZbXPbNhL+zl+xpTW1nYaipDSXOWeUG8dWLp6rLY9kd24uaWOIhCzWFKEQoGSfq/9+u3ihSFmK3TaZOWUSkuAC++wunt0Fs/NdOEqycMTkxPN2/vzP24EjkY2T6yLnMFywfAqnIubQzzi8FbceCVxMEglJJhVLUwlqwmEs0lQskuwaIjGdiYxnSqJgAMciuuF55RZXRwHJ9VBl/SmTiudyfZhdm6X+gkGe5AqCW8/j0USAj6hzRUgrWqK0IO0I3ljOVCIy34uZ4t5MAsPJx/2jf/UGn476p+f9Ye/Tz73B8KR/1vXbzXan2fLrCNGKc5azKTcm1eGcHg4veoOj/uXZRbdx317agfNB793Jv3Gk40benQyGF4fHxwMcfLH0Dv9zOehdDnv0+OPSQxgXJ2co8NNPw6PByfnF5eAE37xcem8Ph73h5duzHq3/t6X38+nZ4WmvezURUmUI6opGLk/f4kpX2icNIwG/g+Qx7Mqw+ezDr63g77983PugLz983H/WCD+2w12aa5Fumftxr5y9/8xOd3NtCE51rHEnFJk6gEbFIX5d4jzn4+S2FDGK12TeJblUcBjHeSlXOs6Jzqdk94ED64adG8wLffscnH16sK5x5Vh8uXpwr8sA4dvy3t/IRs2y6VRk8K7IItptG/c4OiyTSMTD/+I/Z1wtRH6zt+/dewA7YF5p+mXmFdA/El/a5/ecpWpy123j0FjkkCBp4b7dxC27fA2xwGGAxTXRox/GfB5mRZrCRKnZQUjZ5LqJbNZCyRg+Q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uXXhSTD7JgXKXLUxhSoKs9yQTuR/9FTv7e5jyp7Ntc0YL9WdnC2f8Ge7XU1jCtXHKFrdR1i2KIu7DcDLARjfep07dhqlo2O1HLawCBgMWZIlWAWoN4VGnuVFnOfsvErFDI1ZquEiY7r4Fb4hhz9GbP8zmLBqoJEmmnIWHN+E7ivsXHD/leuPnqsAGucyFOuxA3Puv62N4fR5yLJeawJY37bjyxbFm/sWedg6am731Qk4zNCHOgJmJPRqAx7zny/tu4aBx9E7osGtB4IrthTmpbU7dBselmOWUpVwWxWVmGY+T0AuiWIkSjSONtVRJaMR4pCqSO37dRTrufOOQ8MqW1MvS0C6+Y18Bti88rlFn3s2H5Yec/mhExi22JbJsQ9Q7zQwR9gQlxwJDheOx3CbbN7DLjNwZfhr+dGthHaG+/cTQ7bvu1G5IT+xp/sMe8RSEOuDH3nLEnZKEkTdQdi7BxNZ5sD2LXHiF2NlxXUg5Qe08cf080Ql6vraFF3BlkhWTtKOSiHevjp/NzMzS/y8suc/Ap8pLNylY6PU/FJNKxTsLJrq9QrafdkytXAVINQ8kv7/1FmVVhlsf01NtmdgkZs+ogL32F9inEbjbAvo68JtQ3tGk8E+lwfTm6S6IZQi/EYuUbfm+zpVkZ5MlNkRfk/A3Sa8GvNcaf15O54M9jfkSCTYlbR8eaNOdek4jpk9I0ltJ/Xg5EQSqqczQICanE2UQ46b75vw/fmy4Kxs+wC6JzE0U4krbPIfJLXX+eNMDWTKVcI/PGP+naK6zhM50lcdH5j2R32I1OG1ZuSmRgrXJNOJRu4LSeFoohAQIli4dkKvQPkPmjDFFs+zBu4utNnEs+DoFQXcp74H9DolC7TGQAA\n path: /opt/azure/containers/configure-swarmmode-cluster.sh\n permissions: \"0744\"\n\n')]",
"linuxConfiguration": {
"disablePasswordAuthentication": true,
"ssh": {
"publicKeys": [
{
"keyData": "[variables('sshRSAPublicKey')]",
"path": "[variables('sshKeyPath')]"
}
]
}
}
},
"storageProfile": {
"imageReference": {
"offer": "[variables('osImageOffer')]",
"publisher": "[variables('osImagePublisher')]",
"sku": "[variables('osImageSKU')]",
"version": "[variables('osImageVersion')]"
},
"osDisk": {
"caching": "ReadWrite",
"createOption": "FromImage",
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(),'-osdisk')]",
"vhd": {
"uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('masterStorageAccountName')), variables('apiVersionStorage')).primaryEndpoints.blob, 'vhds/', variables('masterVMNamePrefix'), copyIndex(), '-osdisk.vhd')]"
}
}
}
},
"tags": {
"creationSource": "[concat('acsengine-', variables('masterVMNamePrefix'), copyIndex())]"
},
"type": "Microsoft.Compute/virtualMachines"
},
{
"apiVersion": "2016-03-30",
"copy": {
"count": "[variables('masterCount')]",
"name": "vmLoopNode"
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', concat(variables('masterVMNamePrefix'), copyIndex()))]"
],
"location": "[variables('location')]",
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(), '/configuremaster')]",
"properties": {
"publisher": "Microsoft.OSTCExtensions",
"settings": {
"commandToExecute": "[variables('masterCustomScript')]",
"fileUris": []
},
"type": "CustomScriptForLinux",
"typeHandlerVersion": "1.4"
},
"type": "Microsoft.Compute/virtualMachines/extensions"
}
],
"outputs": {
"agentFQDN": {
"type": "string",
"value": "[reference(concat('Microsoft.Network/publicIPAddresses/', variables('agentIPAddressName'))).dnsSettings.fqdn]"
},
"masterFQDN": {
"type": "string",
"value": "[reference(concat('Microsoft.Network/publicIPAddresses/', variables('masterPublicIPAddressName'))).dnsSettings.fqdn]"
}
}
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"agentCount": {
"value": 2
},
"agentEndpointDNSNamePrefix": {
"value": "swarmagent"
},
"agentSubnet": {
"value": "10.0.0.0/16"
},
"agentVMSize": {
"value": "Standard_D2_v2"
},
"firstConsecutiveStaticIP": {
"value": "172.16.0.5"
},
"linuxAdminUsername": {
"value": "swarmadmin"
},
"location": {
"value": "Southeast Asia"
},
"masterEndpointDNSNamePrefix": {
"value": "swarmmaster"
},
"masterSubnet": {
"value": "172.16.0.0/24"
},
"masterVMSize": {
"value": "Standard_D2_v2"
},
"nameSuffix": {
"value": "coredemo"
},
"sshRSAPublicKey": {
"value": "<<YOUR RSA Public key here>>"
},
"targetEnvironment": {
"value": "AzureCloud"
}
}
}
@NileshGule
Copy link
Author

gist creation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment