You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.5 KiB

  1. {
  2. "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  3. "contentVersion": "1.0.0.0",
  4. "parameters": {
  5. },
  6. "variables": {
  7. "vnetID": "[resourceId('Microsoft.Network/virtualNetworks', '{{virtualNetworkName}}')]",
  8. "kubeMinionsSubnetRef": "[concat(variables('vnetID'),'/subnets/', '{{subnetMinionsName}}')]"
  9. },
  10. "resources": [
  11. {% for i in range(number_of_k8s_nodes) %}
  12. {% if not use_bastion %}
  13. {
  14. "apiVersion": "{{apiVersion}}",
  15. "type": "Microsoft.Network/publicIPAddresses",
  16. "name": "minion-{{i}}-pubip",
  17. "location": "[resourceGroup().location]",
  18. "properties": {
  19. "publicIPAllocationMethod": "Static"
  20. }
  21. },
  22. {% endif %}
  23. {
  24. "apiVersion": "{{apiVersion}}",
  25. "type": "Microsoft.Network/networkInterfaces",
  26. "name": "minion-{{i}}-nic",
  27. "location": "[resourceGroup().location]",
  28. "dependsOn": [
  29. {% if not use_bastion %}
  30. "[concat('Microsoft.Network/publicIPAddresses/', 'minion-{{i}}-pubip')]"
  31. {% endif %}
  32. ],
  33. "properties": {
  34. "ipConfigurations": [
  35. {
  36. "name": "MinionsIpConfig",
  37. "properties": {
  38. "privateIPAllocationMethod": "Dynamic",
  39. {% if not use_bastion %}
  40. "publicIPAddress": {
  41. "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'minion-{{i}}-pubip')]"
  42. },
  43. {% endif %}
  44. "subnet": {
  45. "id": "[variables('kubeMinionsSubnetRef')]"
  46. }
  47. }
  48. }
  49. ],
  50. "networkSecurityGroup": {
  51. "id": "[resourceId('Microsoft.Network/networkSecurityGroups', '{{securityGroupName}}')]"
  52. },
  53. "enableIPForwarding": true
  54. }
  55. },
  56. {
  57. "type": "Microsoft.Compute/virtualMachines",
  58. "name": "minion-{{i}}",
  59. "location": "[resourceGroup().location]",
  60. "dependsOn": [
  61. "[concat('Microsoft.Network/networkInterfaces/', 'minion-{{i}}-nic')]"
  62. ],
  63. "tags": {
  64. "roles": "kube-node"
  65. },
  66. "apiVersion": "{{apiVersion}}",
  67. "properties": {
  68. "availabilitySet": {
  69. "id": "[resourceId('Microsoft.Compute/availabilitySets', '{{availabilitySetMinions}}')]"
  70. },
  71. "hardwareProfile": {
  72. "vmSize": "{{minions_vm_size}}"
  73. },
  74. "osProfile": {
  75. "computerName": "minion-{{i}}",
  76. "adminUsername": "{{admin_username}}",
  77. "adminPassword": "{{admin_password}}",
  78. "linuxConfiguration": {
  79. "disablePasswordAuthentication": "{{disablePasswordAuthentication}}",
  80. "ssh": {
  81. "publicKeys": [
  82. {
  83. "path": "{{sshKeyPath}}",
  84. "keyData": "{{ssh_public_key}}"
  85. }
  86. ]
  87. }
  88. }
  89. },
  90. "storageProfile": {
  91. "imageReference": {{imageReferenceJson}},
  92. "osDisk": {
  93. "name": "mi{{nameSuffix}}{{i}}",
  94. "vhd": {
  95. "uri": "[concat('http://','{{storageAccountName}}','.blob.core.windows.net/vhds/minion-{{i}}.vhd')]"
  96. },
  97. "caching": "ReadWrite",
  98. "createOption": "FromImage",
  99. "diskSizeGB": "{{minions_os_disk_size}}"
  100. }
  101. },
  102. "networkProfile": {
  103. "networkInterfaces": [
  104. {
  105. "id": "[resourceId('Microsoft.Network/networkInterfaces', 'minion-{{i}}-nic')]"
  106. }
  107. ]
  108. }
  109. }
  110. } {% if not loop.last %},{% endif %}
  111. {% endfor %}
  112. ]
  113. }