Fix JSON files linter issues in deployment
[integration.git] / deployment / Azure_ARM_Template / arm_cluster_deploy_beijing.json
1 {
2   "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3   "contentVersion": "1.0.0.0",
4   "parameters": {
5     "centosOSVersion": {
6       "type": "string",
7       "defaultValue": "16.04.0-LTS",
8       "allowedValues": [
9         "12.04.5-LTS",
10         "14.04.5-LTS",
11         "15.10",
12         "16.04.0-LTS"
13       ],
14       "metadata": {
15         "description": "The OS"
16       }
17     },
18     "numberOfVms": {
19       "type": "int",
20       "defaultValue": 5,
21       "minValue": 1,
22       "maxValue": 15,
23       "metadata": {
24         "description": "Number of VMs to provision"
25       }
26     },
27     "privateIPAddress": {
28       "type": "string",
29       "defaultValue": "10.0.0.2",
30       "metadata": {
31         "description": "Static Private IP will be assigned to the machine"
32       }
33     },
34     "masterScriptName": {
35       "type": "string",
36       "metadata": {
37         "description": "entrypoint script name for k8s master"
38       }
39     },
40     "nodeScriptName": {
41       "type": "string",
42       "metadata": {
43         "description": "entrypoint script name for k8s node"
44       }
45     },
46     "vmSize": {
47       "type": "string",
48       "defaultValue": "Standard_D14_v2",
49       "allowedValues": [
50         "Standard_E8_v3",
51         "Standard_E2_v3",
52         "Standard_D1",
53         "Standard_D16s_v3",
54         "Standard_D4_v2",
55         "Standard_D32s_v3",
56         "Standard_E16_v3",
57         "Standard_D14_v2",
58         "Standard_D13_v2",
59         "Standard_E64_v3"
60       ],
61       "metadata": {
62         "description": "VM size"
63       }
64     },
65     "dnslabel": {
66       "type": "string",
67       "metadata": {
68         "description": "Unique DNS label to assign DNS name"
69       }
70     }
71   },
72   "variables": {
73     "dnsLabelPrefix": "[concat('dns-',uniquestring(resourceGroup().id))]",
74     "customData": [
75       "userdata.txt"
76     ],
77     "vmName": "[concat('k8s-host-', substring(uniquestring(resourceGroup().id),0,4))]",
78     "adminUsername": "[concat('ubuntu')]",
79     "adminPassword": "Qwertyuiop@@1",
80     "sshKeyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD5zrmH1dHgXbNwP2qbNVySScnFVcEP25HBd2VJu2PiJLDhwgHj44Lj9ZvLyRFCetqd8CAKnLV5qy37rwaCtlH/t8Qb36cUGPhegxpF2++uTY0b6K7Zb6hEMBNw3J1z+GU7OoVwZJhsNAw4t8/7WWmJA4Owo99TJkEKvhCYjBCLoC5sIvG/lJsaFIG8A5MjnBlwgSZ3FsUU+aY1KYZUztodkyv7laDMOinwSvJggKrCugsqZdVo5bhmcSFbqrZa/a/wgqeok+79W0/DLh5Tlf7By46ASDKGnFlwDshPu++I3KMU3eRz0rJLOKeIUCz7k80X0WJ6BrSS7l+IrpDXV1M5 ubuntu@aria",
81     "storageAccountName": "[concat('salinuxvm', substring(uniquestring(resourceGroup().id),0,4))]",
82     "imagePublisher": "Canonical",
83     "imageOffer": "UbuntuServer",
84     "nicName": "[concat('VMNic-',variables('vmName'))]",
85     "dnsPrefix": "[concat(variables('dnsLabelPrefix'),'-',substring(uniquestring(resourceGroup().id),0,4))]",
86     "addressPrefix": "10.0.0.0/16",
87     "subnetName": "Subnet",
88     "subnetPrefix": "10.0.0.0/24",
89     "storageAccountType": "Standard_LRS",
90     "publicIPAddressType": "Dynamic",
91     "publicIPAddressName": "nicLoop100",
92     "virtualNetworkName": "[concat('VNET-',variables('vmName'))]",
93     "subnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets/', variables('virtualNetworkName'), variables('subnetName'))]",
94     "networkSecurityGroupName": "[concat(variables('vmName'), '_obrien_local_nsg')]",
95     "sshKeyPathRoot": "[concat('/root/','/.ssh/authorized_keys')]",
96     "sshKeyPath": "[concat('/home/',variables('adminUsername'),'/.ssh/authorized_keys')]",
97     "availabilitySetName": "[concat('availabilitySet-',substring(uniquestring(resourceGroup().id),0,4))]"
98   },
99   "resources": [
100     {
101       "type": "Microsoft.Compute/availabilitySets",
102       "name": "[variables('availabilitySetName')]",
103       "apiVersion": "2016-04-30-preview",
104       "location": "[resourceGroup().location]",
105       "properties": {
106         "managed": true,
107         "platformFaultDomainCount": 3,
108         "platformUpdateDomainCount": 3
109       }
110     },
111     {
112       "type": "Microsoft.Storage/storageAccounts",
113       "name": "[variables('storageAccountName')]",
114       "apiVersion": "2017-06-01",
115       "location": "[resourceGroup().location]",
116       "sku": {
117         "name": "[variables('storageAccountType')]"
118       },
119       "kind": "Storage",
120       "properties": {}
121     },
122     {
123       "apiVersion": "2017-03-01",
124       "type": "Microsoft.Network/networkSecurityGroups",
125       "name": "[variables('networkSecurityGroupName')]",
126       "location": "[resourceGroup().location]",
127       "tags": {
128         "displayName": "NSG"
129       },
130       "properties": {
131         "securityRules": [
132           {
133             "name": "SSHAllowAny",
134             "properties": {
135               "description": "SSHAllowAny",
136               "protocol": "TCP",
137               "sourcePortRange": "*",
138               "destinationPortRange": "22",
139               "sourceAddressPrefix": "*",
140               "destinationAddressPrefix": "*",
141               "access": "Allow",
142               "priority": 100,
143               "direction": "Inbound"
144             }
145           },
146           {
147             "name": "DockerAllowAny",
148             "properties": {
149               "description": "DockerAllowAny",
150               "protocol": "TCP",
151               "sourcePortRange": "*",
152               "destinationPortRange": "2376",
153               "sourceAddressPrefix": "*",
154               "destinationAddressPrefix": "*",
155               "access": "Allow",
156               "priority": 110,
157               "direction": "Inbound"
158             }
159           },
160           {
161             "name": "port500-UdpAllowAny",
162             "properties": {
163               "description": "port500-udpAllowAny",
164               "protocol": "UDP",
165               "sourcePortRange": "*",
166               "destinationPortRange": "500",
167               "sourceAddressPrefix": "*",
168               "destinationAddressPrefix": "*",
169               "access": "Allow",
170               "priority": 120,
171               "direction": "Inbound"
172             }
173           },
174           {
175             "name": "port4500-UdpAllowAny",
176             "properties": {
177               "description": "port4500-udpAllowAny",
178               "protocol": "UDP",
179               "sourcePortRange": "*",
180               "destinationPortRange": "4500",
181               "sourceAddressPrefix": "*",
182               "destinationAddressPrefix": "*",
183               "access": "Allow",
184               "priority": 130,
185               "direction": "Inbound"
186             }
187           },
188           {
189             "name": "port_10249-10255_172",
190             "properties": {
191               "description": "port_10249-10255_172",
192               "protocol": "*",
193               "sourcePortRange": "*",
194               "destinationPortRange": "10249-10255",
195               "sourceAddressPrefix": "*",
196               "destinationAddressPrefix": "*",
197               "access": "Allow",
198               "priority": 140,
199               "direction": "Inbound"
200             }
201           },
202           {
203             "name": "in-rule",
204             "properties": {
205               "description": "All in",
206               "protocol": "Tcp",
207               "sourcePortRange": "*",
208               "destinationPortRange": "*",
209               "sourceAddressPrefix": "Internet",
210               "destinationAddressPrefix": "*",
211               "access": "Allow",
212               "priority": 170,
213               "direction": "Inbound"
214             }
215           },
216           {
217             "name": "block-8080",
218             "properties": {
219               "description": "block-8080",
220               "protocol": "Tcp",
221               "sourcePortRange": "8080",
222               "destinationPortRange": "*",
223               "sourceAddressPrefix": "Internet",
224               "destinationAddressPrefix": "*",
225               "access": "Deny",
226               "priority": 104,
227               "direction": "Outbound"
228             }
229           },
230           {
231             "name": "out-rule",
232             "properties": {
233               "description": "All out",
234               "protocol": "Tcp",
235               "sourcePortRange": "*",
236               "destinationPortRange": "*",
237               "sourceAddressPrefix": "Internet",
238               "destinationAddressPrefix": "*",
239               "access": "Allow",
240               "priority": 110,
241               "direction": "Outbound"
242             }
243           }
244         ]
245       }
246     },
247     {
248       "apiVersion": "2017-04-01",
249       "type": "Microsoft.Network/virtualNetworks",
250       "name": "[variables('virtualNetworkName')]",
251       "location": "[resourceGroup().location]",
252       "dependson": [
253         "[concat('Microsoft.Network/networkSecurityGroups/', variables('networkSecurityGroupName'))]"
254       ],
255       "properties": {
256         "addressSpace": {
257           "addressPrefixes": [
258             "[variables('addressPrefix')]"
259           ]
260         },
261         "subnets": [
262           {
263             "name": "[variables('subnetName')]",
264             "properties": {
265               "addressPrefix": "[variables('subnetPrefix')]",
266               "networkSecurityGroup": {
267                 "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
268               }
269             }
270           }
271         ]
272       }
273     },
274     {
275       "apiVersion": "2017-08-01",
276       "type": "Microsoft.Network/networkInterfaces",
277       "name": "[concat(variables('nicName'), copyindex())]",
278       "location": "[resourceGroup().location]",
279       "copy": {
280         "name": "nicLoop",
281         "count": "[parameters('numberOfVms')]"
282       },
283       "dependsOn": [
284         "[resourceId('Microsoft.Network/publicIPAddresses/', concat('nicLoop',copyIndex(100)))]",
285         "[resourceId('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]"
286       ],
287       "properties": {
288         "ipConfigurations": [
289           {
290             "name": "ipconfig1",
291             "properties": {
292               "privateIPAllocationMethod": "Static",
293               "privateIPAddress": "[concat(parameters('privateIPAddress'),copyindex())]",
294               "publicIPAddress": {
295                 "id": "[resourceId('Microsoft.Network/publicIPAddresses', concat('nicLoop',copyIndex(100)))]"
296               },
297               "subnet": {
298                 "id": "[variables('subnetRef')]"
299               }
300             }
301           }
302         ]
303       }
304     },
305     {
306       "apiVersion": "2017-04-01",
307       "type": "Microsoft.Network/publicIPAddresses",
308       "name": "[concat('nicLoop',copyIndex(100))]",
309       "location": "[resourceGroup().location]",
310       "copy": {
311         "name": "nicLoop",
312         "count": "[parameters('numberOfVms')]"
313       },
314       "properties": {
315         "publicIPAllocationMethod": "Dynamic",
316         "dnsSettings": {
317           "domainNameLabel": "[concat(variables('vmName'),parameters('dnslabel'), copyIndex(1000))]"
318         }
319       }
320     },
321     {
322       "apiVersion": "2017-03-30",
323       "type": "Microsoft.Compute/virtualMachines",
324       "name": "[concat(variables('vmName'), copyindex())]",
325       "copy": {
326         "name": "virtualMachineLoop",
327         "count": "[parameters('numberOfVms')]"
328       },
329       "location": "[resourceGroup().location]",
330       "dependsOn": [
331         "nicLoop",
332         "[concat('Microsoft.Compute/availabilitySets/',variables('availabilitySetName'))]"
333       ],
334       "properties": {
335         "hardwareProfile": {
336           "vmSize": "[parameters('vmSize')]"
337         },
338         "availabilitySet": {
339           "id": "[resourceId('Microsoft.Compute/availabilitySets',variables('availabilitySetName'))]"
340         },
341         "osProfile": {
342           "computerName": "[concat(variables('vmName'), copyindex())]",
343           "adminUsername": "[variables('adminUsername')]",
344           "adminPassword": "[variables('adminPassword')]",
345           "linuxConfiguration": {
346             "disablePasswordAuthentication": false,
347             "ssh": {
348               "publicKeys": [
349                 {
350                   "path": "[variables('sshKeyPath')]",
351                   "keyData": "[variables('sshKeyData')]"
352                 }
353               ]
354             }
355           }
356         },
357         "storageProfile": {
358           "imageReference": {
359             "publisher": "[variables('imagePublisher')]",
360             "offer": "[variables('imageOffer')]",
361             "sku": "[parameters('centosOSVersion')]",
362             "version": "latest"
363           },
364           "osDisk": {
365             "diskSizeGB": 127,
366             "createOption": "FromImage"
367           }
368         },
369         "networkProfile": {
370           "networkInterfaces": [
371             {
372               "id": "[resourceId('Microsoft.Network/networkInterfaces',concat(variables('nicName'),copyindex()))]"
373             }
374           ]
375         },
376         "diagnosticsProfile": {
377           "bootDiagnostics": {
378             "enabled": true,
379             "storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), '2016-01-01').primaryEndpoints.blob)]"
380           }
381         }
382       }
383     },
384     {
385       "apiVersion": "2015-06-15",
386       "type": "Microsoft.Compute/virtualMachines/extensions",
387       "name": "[concat(variables('vmName'), '0','/onap')]",
388       "location": "[resourceGroup().location]",
389       "dependsOn": [
390         "virtualMachineLoop"
391       ],
392       "properties": {
393         "publisher": "Microsoft.Azure.Extensions",
394         "type": "CustomScript",
395         "typeHandlerVersion": "2.0",
396         "autoUpgradeMinorVersion": true,
397         "settings": {
398           "fileUris": [
399             "https://git.onap.org/integration/plain/deployment/Azure_ARM_Template/scripts/azure-rancher-server.sh"
400           ],
401           "commandToExecute": "[concat('./' , parameters('masterScriptName'),' ',reference(variables('publicIPAddressName')).dnsSettings.fqdn,' ',parameters('privateIPAddress'),' ',parameters('numberOfVms'))]"
402         }
403       }
404     },
405     {
406       "apiVersion": "2015-06-15",
407       "type": "Microsoft.Compute/virtualMachines/extensions",
408       "name": "[concat(variables('vmName'), copyindex(1),'/onap')]",
409       "copy": {
410         "name": "virtualMachineExtnLoop",
411         "count": "[sub(parameters('numberOfVms'),1)]"
412       },
413       "location": "[resourceGroup().location]",
414       "dependsOn": [
415         "virtualMachineLoop"
416       ],
417       "properties": {
418         "publisher": "Microsoft.Azure.Extensions",
419         "type": "CustomScript",
420         "typeHandlerVersion": "2.0",
421         "autoUpgradeMinorVersion": true,
422         "settings": {
423           "fileUris": [
424             "https://git.onap.org/integration/plain/deployment/Azure_ARM_Template/scripts/azure-k8s-node.sh"
425           ],
426           "commandToExecute": "[concat('./' , parameters('nodeScriptName'),' ',concat(parameters('privateIPAddress'),'0'))]"
427         }
428       }
429     }
430   ]
431 }