/azure-marketplace

Elasticsearch Azure Marketplace offering + ARM template

Primary LanguageShellMIT LicenseMIT

Elasticsearch Azure Marketplace offering

This repository consists of:

  • src/mainTemplate.json - The main Azure Resource Management (ARM) template. The template itself is composed of many nested linked templates with the main template acting as the entry point.
  • src/createUiDefinition - UI definition file for our Azure Marketplace offering. This file produces an output JSON that the ARM template can accept as input parameters.

Building

After pulling the source, call npm install once to pull in all devDependencies.

You may edit build/allowedValues.json, which the build will use to patch the ARM template and Marketplace UI definition.

Run npm run build; this will validate EditorConfig settings, JSON files, patch the allowedValues and create a zip in the dist folder.

For more details around developing the template, take a look at the Development README

Azure Marketplace

The Azure Marketplace Elasticsearch offering offers a simplified UI over the full power of the ARM template.

It will always bootstrap a cluster complete with a trial license of Elastic's commercial X-Pack plugins.

Did you know that you can apply for a free basic license? Go check out our subscription options

Deploying through the Marketplace is great and easy way to get your feet wet for a first time with Elasticsearch (on Azure) but in the long run, you'll want to deploy the templates directly though the Azure CLI or PowerShell SDKs. Check out the examples.


VERY IMPORTANT

This template does not configure SSL/TLS for communication with Elasticsearch through an external load balancer. It is strongly recommended that you secure communication before using in production.

You can secure external access to the cluster with TLS by using gateway as the loadBalancerType and supplying a PFX certificate with the appGatewayCertBlob parameter. This sets the cluster up to use Application Gateway for load balancing and SSL offload.

You can secure external access from the browser to Kibana with TLS by supplying a certificate and private key with kibanaCertBlob and kibanaKeyBlob, respectively.


Example UI Flow

You can view the UI in developer mode by clicking here. If you feel something is cached improperly use this client unoptimized link instead

Reporting bugs

Have a look at this screenshot to see how you can navigate to the deployment error status message. Please create an issue with that message and in which resource it occured on our github issues

ARM template

The output from the Azure Marketplace UI is fed directly to the ARM deployment template. You can use the ARM template on its own without going through the MarketPlace. In fact, there are many features in the ARM template that are not exposed within the Marketplace such as configuring

  • Azure Storage account to use for Snapshot/Restore
  • Application Gateway to use for TLS and SSL offload
  • The number and size of disks to attach to each data node VM

Check out our examples repository for examples of common scenarios and also take a look at the following blog posts for further information

Parameters

ParameterTypeDescriptionDefault Value
artifactsBaseUrlstring The base url of the Elastic ARM template. Raw content of the current branch
esVersionstring A valid supported Elasticsearch version. See this list for supported versions The latest version of Elasticsearch supported by the ARM template version
esClusterNamestring The name of the Elasticsearch cluster. Required ""
loadBalancerTypestring The load balancer to set up to access the cluster. Can be internal, external or gateway.
  • By choosing internal, only an internal load balancer is deployed. Useful when connecting to the cluster happens from inside the Virtual Network
  • By choosing external, both internal and external load balancers will be deployed. Kibana communicates with the cluster through the internal load balancer.
  • By choosing gateway, Application Gateway will be deployed for load balancing, allowing a PFX certificate to be supplied for transport layer security to and from Application Gateway, and providing SSL offload. An internal load balancer will also deployed. Application Gateway and Kibana communicate with the cluster through the internal load balancer.

If you are setting up Elasticsearch or Kibana on a publicly available IP address, it is highly recommended to secure access to the cluster with a product like Elastic's Security, in addition to configuring transport layer security.

internal
azureCloudPluginstring Either Yes or No to install the Azure Cloud plugin for snapshot/restore. When set to Yes, both azureCloudeStorageAccountName and azureCloudStorageAccountKey should be specified to configure the plugin correctly. No
azureCloudStorageAccountNamestring The name of an existing storage account to use for snapshots with Azure Cloud plugin. Must be a valid Azure Storage Account name. ""
azureCloudStorageAccountKeysecurestring The access key of an existing storage account to use for snapshots with Azure Cloud plugin. ""
xpackPluginsstring Either Yes or No to install a trial license of the commercial X-Pack plugins: Monitoring, Security, Alerting and Graph (Elasticsearch 2.3.0+). Yes
esAdditionalPluginsstring Additional elasticsearch plugins to install. Each plugin must be separated by a semicolon. e.g. analysis-icu;mapper-attachments ""
esAdditionalYamlstring Additional configuration for Elasticsearch yaml configuration file. Each line must be separated by a newline character \n e.g. "action.auto_create_index: .security\nindices.queries.cache.size: 5%". This is an expert level feature - It is recommended that you run your additional yaml through a linter before starting a deployment. ""
kibanastring Either Yes or No to provision a machine with a public IP that has Kibana installed on it. If you have opted to also install the Elasticsearch plugins using xpackPlugins then a trial license of the commercial X-Pack Kibana plugins as well as Sense Editor are also installed. Yes
vmSizeKibanastring Azure VM size of the Kibana instance. See this list for supported sizes. Check that the size you choose is available in the region you choose. Standard_A1
kibanaCertBlobstring A Base-64 encoded form of the certificate (.crt) to secure HTTPS communication between the browser and Kibana.""
kibanaKeyBlobsecurestring A Base-64 encoded form of the private key (.key) to secure HTTPS communication between the browser and Kibana.""
kibanaKeyPassphrasesecurestring The passphrase to decrypt the private key. Optional as the key may not be encrypted. Supported only in 5.3.0+""
jumpboxstring Either Yes or No to optionally add a virtual machine to the deployment which you can use to connect and manage virtual machines on the internal network. No
vmHostNamePrefixstring The prefix to use for hostnames when naming virtual machines in the cluster. Hostnames are used for resolution of master nodes so if you are deploying a cluster into an existing virtual network containing an existing Elasticsearch cluster, be sure to set this to a unique prefix, to differentiate the hostnames of this cluster from an existing cluster. Can be up to 5 characters in length, must begin with an alphanumeric character and can contain alphanumeric and hyphen characters. ""
vmSizeDataNodesstring Azure VM size of the data nodes. See this list for supported sizes. Check that the size you choose is available in the region you choose. Standard_D1
vmDataDiskCountint Number of disks to attach to each data node in RAID 0 setup. Must be one of 0, 1, 2, 4, 8, 16, 32, 40. If the number of disks selected is more than can be attached to the data node VM size, the maximum number of disks that can be attached for the data node VM size will be used. Equivalent to taking min(vmDataDiskCount, max supported disks for data node VM size)
  • When 1 disk is selected, the disk is not RAIDed.
  • When 0 disks are selected, no disks will be attached to each data node; instead, the temporary disk will be used to store Elasticsearch data. The temporary disk is ephemeral in nature and not persistent. Consult Microsoft Azure documentation on temporary disks to understand the trade-offs in using it for storage.
40
i.e. the max supported disks for data node VM size
vmDataDiskSizestring The disk size of each attached disk. Choose Large (1024Gb), Medium (512Gb) or Small (128Gb). For Premium Storage, disk sizes equate to P30, P20 and P10 storage disk types, respectively. Large
vmDataNodeCountint The number of data nodes you wish to deploy. Must be greater than 0. 3
storageAccountTypestring The storage account type of the attached disks. Choose either Default or Standard. The Default storage account type will be Premium Storage for VMs that support Premium Storage and Standard Storage for those that do not. Default
dataNodesAreMasterEligiblestring Either Yes or No to make all data nodes master eligible. This can be useful for small Elasticsearch clusters however, for larger clusters it is recommended to have dedicated master nodes. When Yes no dedicated master nodes will be provisioned. No
vmSizeMasterNodesstring Azure VM size of dedicated master nodes. See this list for supported sizes. By default the template deploys 3 dedicated master nodes, unless dataNodesAreMasterEligible is set to Yes. Check that the size you choose is available in the region you choose. Standard_D1
vmClientNodeCountint The number of client nodes to provision. Must be a positive integer. By default, the data nodes are added to the backendpool of the loadbalancer but if you provision client nodes, these will be added to the loadbalancer instead. Client nodes can be useful in offloading the gather process from data nodes and are necessary to scale an Elasticsearch cluster deployed with this template beyond 100 data nodes (the maximum number of VMs that can be added to a load balancer backendpool). 0
vmSizeClientNodesstring Azure VM size of the client nodes see this list for supported sizes. Check that the size you choose is available in the region you choose. Standard_D1
adminUsernamestring Admin username used when provisioning virtual machines. Must be a valid Linux username i.e. avoid any of the following usernames for Ubuntu ""
authenticationTypestring The authentication type for the Admin user. Either password or sshPublicKey password
adminPasswordsecurestring When authenticationType is password this sets the OS level user's password ""
sshPublicKeysecurestring When authenticationType is sshPublicKey this sets the OS level sshKey that can be used to login. ""
securityAdminPasswordsecurestring The password for 5.x's superuser elastic or, in 2.x the es_admin user, with admin role. ""
securityReadPasswordsecurestring Security password for the es_read user with user (read-only) role, must be > 6 characters ""
securityKibanaPasswordsecurestring Security password for the es_kibana user with kibana4 role, must be > 6 characters ""
locationstring The location where to provision all the items in this template. Defaults to the special ResourceGroup value which means it will inherit the location from the resource group. Any other value must be a valid Azure region. ResourceGroup
vNetNewOrExistingstring Whether the Virtual Network is new or existing. An existing Virtual Network in another Resource Group in the same Location can be used. new
vNetNamestring The name of the Virtual Network. es-net
vNetExistingResourceGroupstring The name of the Resource Group in which the Virtual Network resides when using an existing Virtual Network. Required when using an existing Virtual Network ""
vNetNewAddressPrefixstring The address prefix when creating a new Virtual Network. Required when creating a new Virtual Network 10.0.0.0/24
vNetLoadBalancerIpstring The internal static IP address to use when configuring the internal load balancer. Must be an available IP address on the provided vNetClusterSubnetName. 10.0.0.4
vNetClusterSubnetNamestring The name of the subnet to which Elasticsearch nodes will be attached. es-subnet
vNetNewClusterSubnetAddressPrefixstring The address space of the subnet. Required when creating a new Virtual Network 10.0.0.0/25
vNetAppGatewaySubnetNamestring Subnet name to use for the Application Gateway. Required when selecting gateway for load balancing. es-gateway-subnet
vNetNewAppGatewaySubnetAddressPrefixstring The address space of the Application Gateway subnet. Required when creating a new Virtual Network and selecting gateway for load balancing. 10.0.0.128/28
appGatewayTierstring The tier of the Application Gateway, either Standard or WAF. Required when selecting gateway for load balancing. Standard
appGatewaySkustring The size of the Application Gateway. Choose Small, Medium or Large. When choosing appGatewayTier WAF, the size must be at least Medium. Required when selecting gateway for load balancing. Medium
appGatewayCountint The number instances of the Application Gateway. Can be a value between 1 and 10. A minimum of 2 is recommended for production. Required when selecting gateway for load balancing. 2
appGatewayCertBlobstring A Base-64 encoded form of the PFX certificate for the Application Gateway. This certificate is used to secure HTTPS connections to and from the Application Gateway. Required when selecting gateway for load balancing. ""
appGatewayCertPasswordsecurestring The password for the PFX certificate for the Application Gateway. Defaults to "". Required when selecting gateway for load balancing. ""
appGatewayWafStatusstring The firewall status of the Application Gateway, either Enabled or Disabled. Required when selecting gateway for load balancing and using appGatewayTier WAF. Enabled
appGatewayWafModestring The firewall mode of the Application Gateway, either Detection or Prevention. Required when selecting gateway for load balancing and using appGatewayTier WAF. Detection
userCompanystring The name of your company. ""
userEmailstring Your email address ""
userFirstNamestring Your first name ""
userLastNamestring Your last name ""
userJobTitlestring Your job title. Pick the nearest one that matches from the list of job titles Other
userCountrystring The country in which you are based. ""

Command line deploy

You can deploy using the template directly from Github using the Azure CLI or Azure PowerShell

Azure CLI

  1. Log into Azure
azure login
  1. Ensure you are in arm mode
azure config mode arm
  1. Create a resource group <name> in a <location> (e.g westeurope) where we can deploy too
azure group create <name> <location>
  1. Use our published template directly using --template-uri
azure group deployment create --template-uri https://raw.githubusercontent.com/elastic/azure-marketplace/master/src/mainTemplate.json --parameters-file parameters/password.parameters.json -g name

or if your are executing commands from a clone of this repo using --template-file

azure group deployment create --template-file src/mainTemplate.json --parameters-file parameters/password.parameters.json -g <name>

where <name> refers to the resource group you just created.

NOTE

The --parameters-file can specify a different location for the items that get provisioned inside of the resource group. Make sure these are the same prior to deploying if you need them to be. Omitting location from the parameters file is another way to make sure the resources get deployed in the same location as the resource group.

Azure PowerShell

  1. Log into Azure
Login-AzureRmAccount
  1. Select a Subscription Id
Select-AzureRmSubscription -SubscriptionId "<subscriptionId>"
  1. Define the parameters object for your deployment
$clusterParameters = @{
    "artifactsBaseUrl"="https://raw.githubusercontent.com/elastic/azure-marketplace/master/src"
    "esVersion" = "5.1.2"
    "esClusterName" = "elasticsearch"
    "location" = "ResourceGroup"
    "loadBalancerType" = "internal"
    "vmDataDiskCount" = 1
    "adminUsername" = "russ"
    "adminPassword" = "Password1234"
    "securityAdminPassword" = "Password123"
    "securityReadPassword" = "Password123"
    "securityKibanaPassword" = "Password123"
}
  1. Create a resource group <name> in a <location> (e.g westeurope) where we can deploy too
New-AzureRmResourceGroup -Name "<name>" -Location "<location>"
  1. Use our template directly from Github
New-AzureRmResourceGroupDeployment -Name "<deployment name>" -ResourceGroupName "<name>" -TemplateUri "https://raw.githubusercontent.com/elastic/azure-marketplace/master/src/mainTemplate.json" -TemplateParameterObject $clusterParameters

Targeting a specific template version

You can target a specific version of the template by modifying the URI of the template and the artifactsBaseUrl parameter of the template.

For example, to target the 5.0.1 tag release with PowerShell

$templateVersion = "5.0.1"
$templateBaseUrl = "https://raw.githubusercontent.com/elastic/azure-marketplace/$templateVersion/src"

$clusterParameters = @{
    "artifactsBaseUrl"= $templateBaseUrl
    "esVersion" = "5.0.0"
    "adminUsername" = "russ"
    "adminPassword" = "Password1234"
    "securityAdminPassword" = "Password123"
    "securityReadPassword" = "Password123"
    "securityKibanaPassword" = "Password123"
}

New-AzureRmResourceGroup -Name "<name>" -Location "<location>"
New-AzureRmResourceGroupDeployment -Name "<deployment name>" -ResourceGroupName "<name>" -TemplateUri "$templateBaseUrl/mainTemplate.json" -TemplateParameterObject $clusterParameters

Web based deploy

Deploy to Azure

The above button will take you to the autogenerated web based UI based on the parameters from the ARM template.

License

This project is MIT Licensed and is based heavily on the Elasticsearch azure quick start arm template