Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Add option for Private Kibana (no public IP address) #398

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,10 @@ value defined in the template.
<tr><td colspan="4" style="font-size:120%"><strong>Kibana related settings</strong></td></tr>

<tr><td>kibana</td><td>string</td>
<td>Either <code>Yes</code> or <code>No</code> to provision a machine with Kibana installed and a public IP address to access it.
<td><ul>
<li><code>Yes</code>: Provision a machine with Kibana installed and a public IP address to access it</li>
<li><code>No</code>: Does not provision Kibana resources.</li>
<li><code>Private</code>: provision a machine with Kibana installed and only a private IP address to access it</li>
</td><td><code>Yes</code></td></tr>

<tr><td>vmSizeKibana</td><td>string</td>
Expand Down
212 changes: 212 additions & 0 deletions src/machines/kibana-resources-private.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"metadata": {
"description": "Location where resources will be provisioned"
}
},
"namespace": {
"type": "string",
"metadata": {
"description": "The unique namespace for the Kibana VM"
}
},
"networkSettings": {
"type": "object",
"metadata": {
"description": "Network settings"
}
},
"credentials": {
"type": "secureObject",
"metadata": {
"description": "Credentials information block"
}
},
"osSettings": {
"type": "object",
"metadata": {
"description": "Platform and OS settings"
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_A1",
"metadata": {
"description": "Size of the Kibana VM"
}
},
"acceleratedNetworking": {
"type": "string",
"defaultValue": "No",
"allowedValues": [
"Yes",
"No"
],
"metadata": {
"description": "Whether to enable accelerated networking for Kibana, which enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. Valid only for specific VM SKUs"
}
},
"elasticTags": {
"type": "object",
"defaultValue": {
"provider": "648D2193-0CE0-4EFB-8A82-AF9792184FD9"
},
"metadata": {
"description": "Unique identifiers to allow the Azure Infrastructure to understand the origin of resources deployed to Azure. You do not need to supply a value for this."
}
}
},
"variables": {
"namespace": "[parameters('namespace')]",
"subnetId": "[resourceId(parameters('networkSettings').resourceGroup, 'Microsoft.Network/virtualNetworks/subnets', parameters('networkSettings').name, parameters('networkSettings').subnet.name)]",
"securityGroupName": "[concat(variables('namespace'), '-nsg')]",
"nicName": "[concat(variables('namespace'), '-nic')]",
"password_osProfile": {
"computername": "[parameters('namespace')]",
"adminUsername": "[parameters('credentials').adminUsername]",
"adminPassword": "[parameters('credentials').password]"
},
"sshPublicKey_osProfile": {
"computername": "[parameters('namespace')]",
"adminUsername": "[parameters('credentials').adminUsername]",
"linuxConfiguration": {
"disablePasswordAuthentication": "true",
"ssh": {
"publicKeys": [
{
"path": "[concat('/home/', parameters('credentials').adminUsername, '/.ssh/authorized_keys')]",
"keyData": "[parameters('credentials').sshPublicKey]"
}
]
}
}
},
"osProfile": "[variables(concat(parameters('credentials').authenticationType, '_osProfile'))]"
},
"resources": [
{
"apiVersion": "2019-04-01",
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[variables('securityGroupName')]",
"location": "[parameters('location')]",
"tags": {
"provider": "[toUpper(parameters('elasticTags').provider)]"
},
"properties": {
"securityRules": [
{
"name": "SSH",
"properties": {
"description": "Allows inbound SSH traffic from anyone",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "[parameters('osSettings').managementPort]",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 100,
"direction": "Inbound"
}
},
{
"name": "Kibana",
"properties": {
"description": "Allows inbound Kibana traffic from anyone",
"protocol": "Tcp",
"sourcePortRange": "*",
"destinationPortRange": "5601",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 200,
"direction": "Inbound"
}
}
]
}
},
{
"apiVersion": "2019-04-01",
"type": "Microsoft.Network/networkInterfaces",
"name": "[variables('nicName')]",
"location": "[parameters('location')]",
"tags": {
"provider": "[toUpper(parameters('elasticTags').provider)]"
},
"dependsOn": [
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('securityGroupName'))]"
],
"properties": {
"primary": true,
"enableAcceleratedNetworking": "[equals(parameters('acceleratedNetworking'), 'Yes')]",
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[variables('subnetId')]"
}
}
}
],
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('securityGroupName'))]"
}
}
},
{
"apiVersion": "2019-03-01",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('namespace')]",
"location": "[parameters('location')]",
"tags": {
"provider": "[toUpper(parameters('elasticTags').provider)]"
},
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": "[variables('osProfile')]",
"storageProfile": {
"imageReference": "[parameters('osSettings').imageReference]",
"osDisk": {
"name": "[concat(variables('namespace'), '-osdisk')]",
"managedDisk": {
"storageAccountType": "Standard_LRS"
},
"caching": "ReadWrite",
"createOption": "FromImage"
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
}
]
}
},
"resources": [
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('namespace'), '/script')]",
"apiVersion": "2019-03-01",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', parameters('namespace'))]"
],
"properties": "[parameters('osSettings').extensionSettings.kibana]"
}
]
}
],
"outputs": {}
}
6 changes: 4 additions & 2 deletions src/mainTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
"defaultValue": "Yes",
"allowedValues": [
"Yes",
"No"
"No",
"Private"
],
"metadata": {
"description": "Provision a machine with Kibana on it"
Expand Down Expand Up @@ -1964,7 +1965,8 @@
},
"kibanaIpTemplates": {
"No": "empty/empty-kibana-ip-resources.json",
"Yes": "ips/kibana-ip-resources.json"
"Yes": "ips/kibana-ip-resources.json",
"Private": "empty/empty-kibana-ip-resources.json"
},
"kibanaIpTemplateUrl": "[uri(parameters('_artifactsLocation'), concat(variables('kibanaIpTemplates')[variables('topologySettings').kibana], parameters('_artifactsLocationSasToken')))]"
},
Expand Down
3 changes: 2 additions & 1 deletion src/partials/node-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"jumpboxTemplateUrl": "[uri(parameters('_artifactsLocation'), concat(variables('jumpboxTemplates')[parameters('topologySettings').jumpbox], parameters('_artifactsLocationSasToken')))]",
"kibanaTemplates": {
"No": "empty/empty-kibana-resources.json",
"Yes": "machines/kibana-resources.json"
"Yes": "machines/kibana-resources.json",
"Private": "machines/kibana-resources-private.json"
},
"kibanaTemplateUrl": "[uri(parameters('_artifactsLocation'), concat(variables('kibanaTemplates')[parameters('topologySettings').kibana], parameters('_artifactsLocationSasToken')))]",
"dataTemplateUrl": "[uri(parameters('_artifactsLocation'), concat('machines/data-nodes-resources.json', parameters('_artifactsLocationSasToken')))]",
Expand Down