Giter Club home page Giter Club logo

azure-marketplace's Introduction

Elastic Stack Azure Marketplace offering

Easily deploy the Elastic Stack of Elasticsearch, Kibana and Logstash to Azure.

IMPORTANT: As a prefered solution, we recommend using our newer Elastic Cloud (Elasticsearch Service) offering in the Azure Marketplace. To learn more, refer to the Native Azure integration documentation.

This readme provides an overview of usage and features. For more comprehensive documentation, please refer to the Azure Marketplace and ARM template documentation

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 the following once

npm install

to pull in all devDependencies. You may edit the build/allowedValues.json file, which the build uses to patch the ARM template and Marketplace UI definition. Then, run

npm run build

which will validate EditorConfig settings, lint JSON files, patch the template using build/allowedValues.json, 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 Elastic Stack offering offers a simplified UI and installation experience over the full power of the ARM template.

It will always bootstrap an Elasticsearch cluster complete with a trial license of the Elastic Stack's platinum features.

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


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 independently, without going through the Marketplace. In fact, there are many features in the ARM template that are not exposed within the Marketplace UI, such as configuring

  • Azure Storage account to use with Azure Repository plugin for Snapshot/Restore
  • Application Gateway to use for SSL/TLS and SSL offload

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

Elastic Stack features (formerly known as X-Pack)

Starting with Elasticsearch, Kibana and Logstash 6.3.0, The template deploys with Elastic Stack features bundled as part of the deployment, and includes the free features under the Basic license level. The xpackPlugins parameter determines whether a self-generated trial license is applied, offering a trial period of 30 days to the Platinum license features. A value of Yes applies a trial license, a value of No applies the Basic license. The license level applied determines the Elastic Stack features activated to use.

For Elasticsearch, Kibana and Logstash prior to 6.3.0, The xpackPlugins parameter determines whether X-Pack plugins are installed and a self-generated trial license is applied. In difference to 6.3.0 however, a value of No for xpackPlugins means that X-Pack plugins are not installed, and therefore does not provide the free features under the Basic license level, offering the Open Source features only. For these versions, you can install X-Pack plugins and register for a free Basic license to apply to the deployment, in order to use the free features available under the Basic license level.

Parameters

The ARM template accepts a lot of parameters, but don't fear! Most of them are optional and only used in conjunction with other parameters. Where a parameter value is not explicitly provided, it will take the default value defined in the template.

. When the Standard load balanacer is selected, and the loadBalancerType is internal, A Network Security Group is also deployed and a public IP address attached to each VM network interface card in the backend pool, to allow outbound internet traffic to install the Elastic Stack and dependencies.
ParameterTypeDescriptionDefault Value
_artifactsLocationstring The base URI where artifacts required by this template are located, including a trailing '/'. Use to target a specific branch or release tagRaw content of the current branch
_artifactsLocationSasTokensecurestring The sasToken required to access _artifactsLocation. When the template is deployed using the accompanying scripts, a sasToken will be automatically generated. Use the defaultValue if the staging location is not secured." ""
locationstring The location where to provision all the items in this template. Defaults to inheriting the location from the resource group. Any other value must be a valid Azure region. [resourceGroup().location]
vmHostNamePrefixstring The prefix to use for hostnames when naming virtual machines in the cluster. Hostnames are used for resolution of master nodes on the network, 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. ""
Elasticsearch related settings
esVersionstring A valid supported Elasticsearch version for the target template version. See this list for supported versions. RequiredLatest version supported by target 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 PKCS#12 archive (.pfx/.p12) containing the certificate and key to be supplied for SSL/TLS 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 Stack Security, in addition to configuring SSL/TLS.

internal
loadBalancerInternalSkustring The internal load balancer SKU. Can be Basic or Standard. Basic
loadBalancerExternalSkustring The external load balancer SKU. Can be Basic or Standard. Only relevant when loadBalancerType is external. When the Standard load balancer SKU is selected, the public IP address SKU attached to the external load balancer will also be Standard. A Network Security Group is also deployed, to allow inbound internet traffic to the load balancer backend pool. Basic
xpackPluginsstring Either Yes or No to install a trial license of the Elastic Stack features (formerly X-Pack) such as Monitoring, Security, Alerting, Graph, Machine Learning (5.5.0+) and SQL. If also installing Kibana, it will have Reporting and Profiler installed.

A value of No for Elasticsearch and Kibana prior to 6.3.0, will include only the Open Source features.

A value of No for Elasticsearch and Kibana 6.3.0+ will include the free Basic license features.
Yes
azureCloudPluginstring Either Yes or No to install the Azure Repository plugin for snapshot/restore. When set to Yes, at least azureCloudStorageAccountName must be specified to configure the plugin correctly. No
azureCloudStorageAccountNamestring The name of an existing storage account to use for snapshots with Azure Repository plugin. Must be a valid Azure Storage Account name. ""
azureCloudStorageAccountResourceGroupstring The name of an existing resource group containing the storage account azureCloudStorageAccountName to use for snapshots with Azure Repository plugin. Must be a valid Resource Group name. ""
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: +.*\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.
""
esHeapSizeinteger The size, in megabytes, of memory to allocate on each Elasticsearch node for the JVM heap. If unspecified, 50% of the available memory will be allocated to Elasticsearch heap, up to a maximum of 31744MB (~32GB). Take a look at the Elasticsearch documentation for more information.

This is an expert level feature - setting a heap size too low, or larger than available memory on the Elasticsearch VM SKU will fail the deployment.
0
esHttpCertBlobstring A Base-64 encoded form of the PKCS#12 archive (.p12/.pfx) containing the certificate and key to secure communication for HTTP layer to Elasticsearch. xpackPlugins must be Yes, or esVersion must be 6.8.0 or above (and less than 7.0.0) or 7.1.0 and above. ""
esHttpCertPasswordsecurestring The password for the PKCS#12 archive (.p12/.pfx) containing the certificate and key to secure communication for HTTP layer to Elasticsearch. Optional as the archive may not be protected with a password.

If using esHttpCaCertBlob, this password will be used to protect the generated PKCS#12 archive on each node. xpackPlugins must be Yes, or esVersion must be 6.8.0 or above (and less than 7.0.0) or 7.1.0 and above.
""
esHttpCaCertBlobstring A Base-64 encoded form of a PKCS#12 archive (.p12/.pfx) containing the Certificate Authority (CA) certificate and key to use to generate certificates on each Elasticsearch node, to secure communication for the HTTP layer to Elasticsearch. xpackPlugins must be Yes, or esVersion must be 6.8.0 or above (and less than 7.0.0) or 7.1.0 and above. ""
esHttpCaCertPasswordsecurestring The password for the PKCS#12 archive (.p12/.pfx) containing the Certificate Authority (CA) certificate and key to secure communication for HTTP layer to Elasticsearch. Optional as the archive may not be be protected with a password. xpackPlugins must be Yes, or esVersion must be 6.8.0 or above (and less than 7.0.0) or 7.1.0 and above. ""
esTransportCaCertBlobstring A Base-64 encoded form of a PKCS#12 archive (.p12/.pfx) containing the Certificate Authority (CA) certificate and key to use to generate certificates on each Elasticsearch node, to secure communication for Transport layer to Elasticsearch. xpackPlugins must be Yes, or esVersion must be 6.8.0 or above (and less than 7.0.0) or 7.1.0 and above. ""
esTransportCaCertPasswordsecurestring The password for the PKCS#12 archive (.p12/.pfx) containing the Certificate Authority (CA) certificate and key to secure communication for Transport layer to Elasticsearch. Optional as the archive may not be be protected with a password. xpackPlugins must be Yes, or esVersion must be 6.8.0 or above (and less than 7.0.0) or 7.1.0 and above. ""
esTransportCertPasswordsecurestring The password to protect the generated PKCS#12 archive on each node. xpackPlugins must be Yes, or esVersion must be 6.8.0 or above (and less than 7.0.0) or 7.1.0 and above. ""
samlMetadataUristring The URI from which the metadata file for the Identity Provider can be retrieved to configure SAML Single-Sign-On. For Azure Active Directory, this can be found in the Single-Sign-On settings of the Enterprise Application, and will look something like https://login.microsoftonline.com/<guid>/federationmetadata/2007-06/federationmetadata.xml?appid=<guid>
  • Supported only for Elasticsearch 6.2.0+
  • Kibana must be installed
  • X-Pack plugin must be installed with a level of license that enables the SAML realm.
  • SSL/TLS must be configured for HTTP layer of Elasticsearch
""
samlServiceProviderUristring The public URI for the Service Provider to configure SAML Single-Sign-On. If samlMetadataUri is provided but no value is provided for samlServiceProviderUri, the public domain name for the deployed Kibana instance will be used.
  • Supported only for Elasticsearch 6.2.0+
  • Kibana must be installed
  • SSL/TLS must be configured for HTTP layer of Elasticsearch
""
Master node related settings
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_DS1_v2
vmMasterNodeAcceleratedNetworkingstring Whether to enable accelerated networking for Master nodes, which enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. Valid values are
  • Default: enables accelerated networking for VMs known to support it
  • Yes: enables accelerated networking.
  • No: does not enable accelerated networking
Default
Data node related settings
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
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_DS1_v2
vmDataNodeAcceleratedNetworkingstring Whether to enable accelerated networking for Data nodes, which enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. Valid values are
  • Default: enables accelerated networking for VMs known to support it
  • Yes: enables accelerated networking.
  • No: does not enable accelerated networking
Default
vmDataNodeCountint The number of data nodes you wish to deploy. Must be greater than 0. 3
Data node disk related settings
vmDataDiskCountint Number of managed disks to attach to each data node in RAID 0 setup. Must be equal to or greater than 0.

If the number of disks selected is more than can be attached to the data node VM (SKU) size, the maximum number of disks that can be attached for the data node VM (sku) 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.
Maximum number supported disks for data node VM size
vmDataDiskSizestring The disk size of each attached disk. Choose 32TiB, 16TiB, 8TiB, 4TiB, 2TiB, 1TiB, 512GiB, 256GiB, 128GiB, 64GiB or 32GiB. For Premium Storage, disk sizes equate to P80, P70, P60, P50, P40, P30, P20, P15, P10 and P6 storage disk types, respectively. 1TiB
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. Standard will use Standard Storage. Default
Coordinating node related settings
vmClientNodeCountint The number of coordinating nodes to provision. Must be a positive integer. By default, the data nodes are added to the backend pool of the loadbalancer but if you provision coordinating nodes, these will be added to the loadbalancer instead. Coordinating 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 backend pool). 0
vmSizeClientNodesstring Azure VM size of the coordinating nodes see this list for supported sizes. Check that the size you choose is available in the region you choose. Standard_DS1_v2
vmClientNodeAcceleratedNetworkingstring Whether to enable accelerated networking for coordinating nodes, which enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. Valid values are
  • Default: enables accelerated networking for VMs known to support it
  • Yes: enables accelerated networking.
  • No: does not enable accelerated networking
Default
Security related settings
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. ""
securityBootstrapPasswordsecurestring Security password for 6.x bootstrap.password key that is added to the keystore. If no value is supplied, a 13 character password will be generated using the ARM template uniqueString() function. The bootstrap password is used to seed the built-in users. Used only in 6.0.0+ ""
securityAdminPasswordsecurestring Security password Admin user.
This is the built-in elastic user.
should be a minimum of 12 characters, and must be greater than 6 characters.
""
securityKibanaPasswordsecurestring Security password Kibana.
This is the built-in kibana user.
should be a minimum of 12 characters, and must be greater than 6 characters.
""
securityLogstashPasswordsecurestring This is the built-in logstash_system user.
should be a minimum of 12 characters, and must be greater than 6 characters.
""
securityBeatsPasswordsecurestring This is the built-in beats_system user. Valid for Elasticsearch 6.3.0+
should be a minimum of 12 characters, and must be greater than 6 characters.
""
securityApmPasswordsecurestring This is the built-in apm_system user. Valid for Elasticsearch 6.5.0+
should be a minimum of 12 characters, and must be greater than 6 characters.
""
securityRemoteMonitoringPasswordsecurestring This is the built-in remote_monitoring_user user. Valid for Elasticsearch 6.5.0+
should be a minimum of 12 characters, and must be greater than 6 characters.
""
Kibana related settings
kibanastring Either Yes or No to provision a machine with Kibana installed and a public IP address to access it. Yes
vmSizeKibanastring Azure VM size of the Kibana instance. See this list for supported sizes. Check that the size you select is available in the region you choose. Standard_A2_v2
vmKibanaAcceleratedNetworkingstring 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 values are
  • Default: enables accelerated networking for VMs known to support it
  • Yes: enables accelerated networking.
  • No: does not enable accelerated networking
Default
kibanaCertBlobstring A Base-64 encoded form of the certificate (.crt) in PEM format to secure HTTPS communication between the browser and Kibana.""
kibanaKeyBlobsecurestring A Base-64 encoded form of the private key (.key) in PEM format 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.""
kibanaAdditionalYamlstring Additional configuration for Kibana yaml configuration file. Each line must be separated by a \n newline character e.g. "server.name: \"My server\"\nkibana.defaultAppId: home".

This is an expert level feature - It is recommended that you run your additional yaml through a linter before starting a deployment.
""
Logstash related settings
logstashstring Either Yes or No to provision Logstash VMs. No
vmSizeLogstashstring Azure VM size of the Logstash instance. See this list for supported sizes. Check that the size you select is available in the region you choose. Standard_DS1_v2
vmLogstashCountint The number of Logstash instances 1
vmLogstashAcceleratedNetworkingstring Whether to enable accelerated networking for Logstash, which enables single root I/O virtualization (SR-IOV) to a VM, greatly improving its networking performance. Valid values are
  • Default: enables accelerated networking for VMs known to support it
  • Yes: enables accelerated networking.
  • No: does not enable accelerated networking
Default
logstashHeapSizeinteger The size, in megabytes, of memory to allocate for the JVM heap for Logstash. If unspecified, Logstash will be configured with the default heap size for the distribution and version. Take a look at the Logstash documentation on profiling heap size for more information.

This is an expert level feature - setting a heap size too low, or larger than available memory on the Logstash VM SKU will fail the deployment.
0
logstashConfsecurestring A Base-64 encoded form of a Logstash config file to deploy. ""
logstashKeystorePasswordsecurestring The password to protect the Logstash keystore. If no value is supplied, a value will be generated using the ARM template uniqueString() function. Used only in 6.2.0+ ""
logstashAdditionalPluginsstring Additional Logstash plugins to install. Each plugin must be separated by a semicolon. e.g. logstash-input-heartbeat;logstash-input-twitter ""
logstashAdditionalYamlstring Additional configuration for Logstash yaml configuration file. Each line must be separated by a newline character \n e.g. "pipeline.batch.size: 125\npipeline.batch.delay: 50".

This is an expert level feature - It is recommended that you run your additional yaml through a linter before starting a deployment.
""
Jumpbox related settings
jumpboxstring Either Yes or No to optionally add a virtual machine with a public IP to the deployment, which you can use to connect and manage virtual machines on the internal network. NOTE: If you are deploying Kibana, the Kibana VM can act as a jumpbox, so a separate jumpbox VM is not needed. No
Virtual network related settings
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. The Virtual Network must already exist when using an existing 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. The subnet must already exist when using an existing Virtual Network 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.
The subnet must already exist when using an existing Virtual Network
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
Application Gateway related settings
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 PKCS#12 archive (.p12/.pfx) containing the certificate and key for 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 PKCS#12 archive (.p12/.pfx) containing the certificate and key for Application Gateway. Required when selecting gateway for load balancing. ""
appGatewayEsHttpCertBlobsecurestring The Base-64 encoded public certificate (.cer) used to secure the HTTP layer of Elasticsearch. Used by the Application Gateway to whitelist certificates used by the backend pool. Required when using esHttpCertBlob to secure the HTTP layer of Elasticsearch and selecting gateway for load balancing. X-Pack plugin must be installed ""
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

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.

Command line deploy

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

Azure CLI 1.0

Azure CLI 1.0 is no longer supported as the apiVersions of resources are newer than those supported by the last release. It's recommended to update to Azure CLI 2.0.

Azure CLI 2.0

  1. Log into Azure
  az login
  1. Create a resource group <name> in a <location> (e.g westeurope) where we can deploy too
az group create --name <name> --location <location>
  1. Use our template directly from GitHub using --template-uri
az group deployment create \
  --resource-group <name> \
  --template-uri https://raw.githubusercontent.com/elastic/azure-marketplace/master/src/mainTemplate.json \
  --parameters @parameters/password.parameters.json

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

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 as a PowerShell hashtable. The keys correspond the parameters defined in the Parameters section
$branch = "master"
$esVersion = "7.11.1"

$clusterParameters = @{
    "_artifactsLocation" = "https://raw.githubusercontent.com/elastic/azure-marketplace/$branch/src/"
    "esVersion" = $esVersion
    "esClusterName" = "elasticsearch"
    "loadBalancerType" = "internal"
    "vmDataDiskCount" = 1
    "adminUsername" = "russ"
    "adminPassword" = "Password1234"
    "securityBootstrapPassword" = "Password1234"
    "securityAdminPassword" = "Password1234"     
    "securityKibanaPassword" = "Password1234"
    "securityLogstashPassword" = "Password1234"
    "securityBeatsPassword" = "Password1234"
    "securityApmPassword" = "Password1234"
    "securityRemoteMonitoringPassword" = "Password1234"
}
  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 _artifactsLocation parameter of the template to point to a specific tagged release.

Targeting a specific template version is recommended for repeatable production deployments.

For example, to target the 7.11.1 tag release with PowerShell

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

# minimum parameters required to deploy
$clusterParameters = @{
  "_artifactsLocation" = $_artifactsLocation
  "esVersion" = "7.11.1"
  "adminUsername" = "russ"
  "adminPassword" = "Password1234"
  "securityBootstrapPassword" = "Password1234"
  "securityAdminPassword" = "Password1234"
  "securityKibanaPassword" = "Password1234"
  "securityLogstashPassword" = "Password1234"
  "securityBeatsPassword" = "Password1234"
  "securityApmPassword" = "Password1234"
  "securityRemoteMonitoringPassword" = "Password1234"
}

$resourceGroup = "my-azure-cluster"
$location = "Australia Southeast"
$name = "my-azure-cluster"

New-AzureRmResourceGroup -Name $resourceGroup -Location $location
New-AzureRmResourceGroupDeployment -Name $name -ResourceGroupName $resourceGroup -TemplateUri "$_artifactsLocation/mainTemplate.json" -TemplateParameterObject $clusterParameters

Configuring TLS

It is strongly recommended that you secure communication using Transport Layer Security when using the template. The Elastic Stack security features can provide Basic Authentication, Role Based Access control, and Transport Layer Security (TLS) for both Elasticsearch and Kibana. For more details, please refer to the Security documentation.

For Elasticsearch versions 6.8.0+ (and less than 7.0.0), and 7.1.0+, the Elastic Stack security features that allow configuring TLS and role based access control are available in the free basic license tier. For all other versions, the Elastic Stack security features require a license level higher than basic; They can be configured with a trial license, which provides access to the Security features for 30 days.

TLS for Kibana

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

TLS for Elasticsearch Transport layer

You can secure communication between nodes in the cluster with TLS on the Transport layer. Configuring TLS for the Transport layer requires xPackPlugins be set to Yes, or an Elasticsearch version 6.8.0+ (and less than 7.0.0) or 7.1.0+.

You must supply a PKCS#12 archive with the esTransportCaCertBlob parameter (and optional passphrase with esTransportCaCertPassword) containing the CA cert which should be used to generate a certificate for each node within the cluster. An optional passphrase can be passed with esTransportCertPassword to encrypt the generated certificate on each node.

One way to generate a PKCS#12 archive containing a CA certificate and key is using Elastic's elasticsearch-certutil command. The simplest command to generate a CA certificate is

./elasticsearch-certutil ca

and follow the instructions.

TLS for Elasticsearch HTTP layer

You can secure external access to the cluster with TLS with an external loadbalancer or Application Gateway. Configuring TLS for the HTTP layer requires xPackPlugins be set to Yes, or an Elasticsearch version 6.8.0+ (and less than 7.0.0) or 7.1.0+.

External load balancer

If you choose external as the value for loadBalancerType, you must either

  • supply a PKCS#12 archive containing the key and certificate with the esHttpCertBlob parameter (and optional passphrase with esHttpCertPassword) containing the certs and private key to secure the HTTP layer. This certificate will be used by all nodes within the cluster, and

or

  • supply a PKCS#12 archive containing the key and certificate with the esHttpCaCertBlob parameter (and optional passphrase with esHttpCaCertPassword) containing the CA which should be used to generate a certificate for each node within the cluster to secure the HTTP layer. Kibana will be configured to trust the CA and perform hostname verification for presented certificates. One way to generate a PKCS#12 archive is using Elastic's certutil command.

Application Gateway

If you choose gateway as the value for loadBalancerType, you must

  • supply a PKCS#12 archive containing the key and certificate with the appGatewayCertBlob parameter (and optional passphrase with appGatewayCertPassword) to secure communication to Application Gateway. One way to generate a PKCS#12 archive is using Elastic's certutil command

Application Gateway performs SSL offload, so communication from Application Gateway to Elasticsearch is not encrypted with TLS by default. TLS to Application Gateway may be sufficient for your needs, but if you would like end-to-end encryption by also configuring TLS for Elasticsearch HTTP layer, you can

  • supply a PKCS#12 archive containing the key and certificate with the esHttpCertBlob parameter (and optional passphrase with esHttpCertPassword) containing the certs and private key to secure the HTTP layer. This certificate will be used by all nodes within the cluster, and Kibana will be configured to trust the certificate CA (if CA certs are present within the archive). One way to generate a PKCS#12 archive is using Elastic's certutil command, and you must specify a --dns <name> argument with a name that matches that in the --name <name> argument.

and

  • supply the public certificate in PEM format from the PKCS#12 archive passed with esHttpCertBlob parameter, using the appGatewayEsHttpCertBlob parameter. Application Gateway whitelists certificates used by VMs in the backend pool. This can be extracted from the PKCS#12 archive of the esHttpCertBlob parameter using openssl pkcs12

    openssl pkcs12 -in http_cert.p12 -out http_public_cert.cer -nokeys

    and provide the passphrase for the archive when prompted.

IMPORTANT: When configuring end-to-end encryption with Application Gateway, the certificate to secure the HTTP layer must include a x509v3 Subject Alternative Name extension with a DNS entry that matches the Subject CN, to work with Application Gateway's whitelisting mechanism. This can be checked using openssl x509

openssl x509 -in http_public_cert.cer -text -noout

which will output something similar to

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            // omitted for brevity ...
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN=Elastic Certificate Tool Autogenerated CA
        Validity
            Not Before: Jul  5 02:37:40 2018 GMT
            Not After : Jul  4 02:37:40 2021 GMT
        Subject: CN=custom
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    // omitted for brevity ...
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                // omitted for brevity ...
            X509v3 Authority Key Identifier:
                // omitted for brevity ...

            X509v3 Subject Alternative Name:
                DNS:custom
            X509v3 Basic Constraints:
                CA:FALSE
    Signature Algorithm: sha256WithRSAEncryption
         // omitted for brevity ...

Without this, Application Gateway will return 502 Bad Gateway errors, as the health probe for the backend pool will fail when the whitelisted certificate does not contain this certificate extension. You can typically understand if there is a problem with the key format when

  1. TLS has been configured on the HTTP layer
  2. Kibana is able to communicate to the cluster correctly but Application Gateway returns 502 errors.

This may not always be the case, but can be indicative. You should also check the description for Backend Health of the Application Gateway in the Azure portal.

Passing certificate parameters

Parameters such as esHttpCertBlob and kibanaCertBlob must be provided in Base-64 encoded form. A Base-64 encoded value can be obtained using

  1. base64 on Linux, or openssl on Linux and MacOS

    base64

    httpCert=$(base64 http-cert.p12) 

    openssl

    httpCert=$(openssl base64 -in http-cert.p12)

    and including the value assigned to $httpCert in the parameters.json file as the value for certificate parameter passed to the Azure CLI command

  2. PowerShell on Windows

    $httpCert = [Convert]::ToBase64String([IO.File]::ReadAllBytes("c:\http-cert.p12"))

    and then pass this in the template parameters object passed to the Azure PowerShell command

    $clusterParameters = @{
        # Other parameters skipped for brevity
        "esHttpCertBlob"= $httpCert
    }

License

This project is MIT Licensed and was originally forked from the Elasticsearch Azure quick start arm template

azure-marketplace's People

Contributors

ajhewett avatar artfulhacker avatar bmoore-msft avatar codebrain avatar dependabot[bot] avatar gmarz avatar kilfoyle avatar lcawl avatar mpdreamz avatar niemyjski avatar panyang1217 avatar pickypg avatar quimrodri avatar rafaelgodinho avatar ravitejag avatar russcam avatar szabosteve avatar tomconte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-marketplace's Issues

Deployment fails due to monit not being restarted

Deployment of a new cluster leads to the following error message:
monit: Cannot connect to the monit daemon. Did you start it with http support?
and the deployment is considered failed.

It looks like the script elasticsearch-ubuntu-install.sh configures monit to monitor the elasticsearch process and only starts, but does not restart, the monit service. This means that monit does not know about the new configuration and the subsequent call of "sudo monit start all" causes the error message.

Restarting the monit service and then calling "sudo monit start all" does not produce the error message.

Install additional plugins

I want to be able to install additional plugins without having to ssh in to every node. For my specific use case I want the delete-by-query, kopf and azure-cloud plugins to always be installed.

An implementation is available in pull request #65

Feedback from Microsoft team on templates

  • "External Access Control" step, loadBalancerType control's defaultValue should be "Internal" not "internal"
  • parameter vmSizeDataNodes: remove the defaultValue and allowedValues (we have this list on the createUiDefinition.json).
  • parameter vmSizeMasterNodes: remove the defaultValue and allowedValues (we have this list on the createUiDefinition.json).
  • parameter vmSizeClientNodes: remove the defaultValue and allowedValues (we have this list on the createUiDefinition.json).
  • parameter sshPublicKey: change the type from string to securestring
  • parameter shieldAdminPassword: remove the defaultValue for this parameter (do we allow/need a blank password?)
  • parameter shieldReadPassword: remove the defaultValue for this parameter (do we allow/need a blank password?)
  • parameter shieldKibanaPassword: remove the defaultValue for this parameter (do we allow/need a blank password?)
  • parameter location: remove allowedValues and defaultValue
  • When creating storage accounts, change the apiVersion from 2015-05-01-preview to 2015-06-15

No options for number of data disk and disk size brings error

I'm deploying 10 data nodes with DS3_v2 which have 8 premium data disks each by default.
It need totally 80 TB premium storage.

However, Azure's premium storage limit per account is 35 TB. It is not possible to deploy that.

I walk around this by first deploy with smaller vm DS1_v2, remove the disks and then upgrade it to DS3_v2.

Is it possible to provide the option for data disk?
In our case, we only need one 512GB data disk.

Microsoft Feedback 1.3.1

  • Ensure regex validation on Microsoft.Compute.UserNameTextBox works
  • Remove image references for platform images so that prices are displayed in the UI
  • Update API versions

The template variable 'nodesPerStorageAccount' is not valid

Error submitting the deployment request. Additional details from the underlying API that might be helpful: Deployment template validation failed: 'The template variable 'nodesPerStorageAccount' is not valid: Template language expression property 'Standard_A1' doesn't exist, available properties are 'Standard_D1, Standard_D2, Standard_D3, Standard_D4, Standard_DS1, Standard_DS2, Standard_DS3, Standard_DS4, Standard_DS13, Standard_A2, Standard_A3, Standard_A4, Standard_A7'..'.

parameters provided in azure portal:

  • esversion 2.1.0
  • loadbalancertype: internal
  • esclustername: elasticsearch
  • loadbalancertype: internal
  • esplugins: no
  • kibana: no
  • jumpbox: no
  • vmsizedatanodes: Standard_A1
  • vmdatanodecount: 3
  • datanodesaremastereligible: yes
  • vmsizemasternodes: Standard_A1
  • vmclientnodecount: 0
  • vmsizeclientnodes: Standard_A1
  • adminusername: provided
  • authenticationtype: password
  • adminpassword provided
  • sshpublickey:
  • shieldadminpassword:
  • shieldreadpassword:
  • shieldkibanapassword:
  • Location: ResourceGroup
  • VirtualNetworkName: esvnet

rely solely on `resourceGroup().location`

Right now we also allow users to specify a different location on the ARM template then the resource group, from the azure UI this is always set to the resource groups location. We should remove the parameter from the template and rely solely on resourceGroup().location.

iptables port forwarding not persist and disappear after reboot

The deployment template does a iptables port forwarding from 9201 to 9200 in order to make external load balancer and internal load balancer work together.

However, I find the the port forwarding disappear after system reboot. and external load balancer stops forwarding traffic.
I walk around this persist the port forwarding by myself.

Hopefully the deployment template can persist that in the future.

I do think the external will be needed for a long while. It hard to put cloud service, app service and Elasticsearch in the same virtual network because of Azure's two different deployment mode.

Support Windows VMs

It seems that current template does not support deployment to Windows VM. Please add support for Windows based VMs.

user registration

We need to add user registration in the template. It has been described in the doc here.

Add support for ES 2.3.3

The allowed values for esVersion in src/mainTemplate.json does not include 2.3.3
Please update the default and allowed values for esVersion to include the latest released version.

Investigate start time of ARM template

When creating a new cluster using the ARM template, there are two steps that take a long time.

  1. Scripts running to install and start ES (15 minutes for 3 nodes)
  2. Scripts running to install and start Kibana (about 15 more minutes)

The latest deployment I did with 3 data nodes and no dedicated masters took about 45 minutes. A similar deployment, with timing, can be seen in the cjfebresourcegroup under the elastic azure account. This behavior is consistent across different data centers - I tried both West Europe and West US.

Remove imageReference from Microsoft.Compute.SizeSelector controls in UI definition

The presence of imageReference in a Microsoft.Compute.SizeSelector control prevents the pricing information from being displayed in the Azure portal UI. The last template production release kept the imageReference in as there was a bug in the Azure portal UI that prevented the ability to select different VM sizes when the imageReference was not present; this is now fixed so imageReference can be removed.

Install Azure Repo plugin by default

When the template deploys, it should install the Azure repo plugin by default so a user could restore from an Azure blob store without having to install the plugin on each node in the cluster.

Install Kibana Shield plugin as part of template

Today, when the template installs, we do not install the Kibana Shield plugin. Mostly, this is ok, however, the following problems are present:

  1. Graph UI does not work. When you click on the search button, you get an "Unauthorized Operation" at the top, and no apparent errors in any logs.
  2. No logout button is available in Kibana. You have to brute force switching users.

I recall a conversation about choosing not to do this because we were going to need to set up SSL. We could either set up SSL, or possibly allow a flag in the config to not require SSL for the plugin.

I would make this a pretty high priority. We want our marketplace offering to match our product offering. Could we model what we do in cloud?

Support choosing Kibana VMs

In the Azure template, it should be possible to choose the VM template for Kibana. It should default to D1, but the user should be able to modify this as part of deployment. Today, Kibana is deployed into a VM chosen by the template, with no opportunity to change it.

remove support for kibana4 user

The default kibana4 role is gone as per 2.3

2016/05/19 11:53:35 Warning: The following roles [kibana4] are unknown. Make sure to add them to the [/etc/elasticsearch/shield/roles.yml] file. Nonetheless the user will still be associated with all specified roles

Inline os-profiles

From feedback from MS (see also #27)

Remove reference function usage and outputs from template links

  • data-nodes-16disk-resources.json - line 184
  • data-nodes-8disk-resources.json - line 184
  • data-nodes-4disk-resources.json - line 184
  • data-nodes-2disk-resources.json - line 184
  • client-nodes-resources.json - line 155
  • jumpbox-resources.json - line 164
  • kibana-resources.json - line 178
  • master-nodes-resources.json – 152

All the files above are using a reference to osProfile-resources.json. In order to remove the usage of reference function, you need to copy part of osProfile-resources.json code into the files above and remove the osProfile-resources.json file.

I understand this will cause some code repetition among the files and will make the template look β€œugly”, but this will allow the ARM backend to parse the VM resources that will be deployed, and validate the required cores versus the cores available on the subscription. This will improve end customer experience, in the case they don’t have enough cores to deploy the cluster, they will receive an error message before submitting the deploy and creating some resources.

It'd be nice if we could do this as part of the npm run build instead of introducing the repitition through copy paste

Command line deployment fails

Create a new cluster using the azure xplat cli, e.g.

azure group create priv-ajh-es2 westeurope
azure group deployment create priv-ajh-es2 --template-uri https://raw.githubusercontent.com/elastic/azure-marketplace/master/src/mainTemplate.json --parameters-file "C:\password.parameters.json"

where the contents of C:\password.parameters.json is:

{
  "artifactsBaseUrl":{"value":"https://raw.githubusercontent.com/elastic/azure-marketplace/master/src"},
  "esVersion":{"value":"2.4.0"},
  "esClusterName":{"value":"priv-ajh-es2"},
  "loadBalancerType":{"value":"internal"},
  "kibana":{"value":"No"},
  "jumpbox":{"value":"Yes"},
  "vmHostNamePrefix":{"value":""},
  "vmSizeKibana":{"value":"Standard_D1"},
  "vmSizeDataNodes":{"value":"Standard_DS2"},
  "vmDataNodeCount":{"value":3},
  "dataNodesAreMasterEligible":{"value":"Yes"},
  "vmSizeMasterNodes":{"value":"Standard_DS1"},
  "vmClientNodeCount":{"value":0},
  "vmSizeClientNodes":{"value":"Standard_D1"},
  "adminUsername":{"value":"esadmin"},
  "authenticationType":{"value":"password"},
  "sshPublicKey":{"value":"<value-ignored>"},
  "adminPassword":{"value":"Elastic12"},
  "shieldAdminPassword":{"value":""},
  "shieldReadPassword":{"value":""},
  "shieldKibanaPassword":{"value":""},
  "vNetName": {"value": "priv-ajh-es2-vnet"},
  "vNetSubnetName": {"value": "priv-ajh-es2-subnet"},
  "vNetLoadBalancerIp": {"value": "10.0.0.4"},
  "vNetNewOrExisting": {"value":"new"},
  "vNetExistingResourceGroup": {"value": ""},
  "vNetNewAddressPrefix": {"value": "10.0.0.0/16"},   
  "vNetNewSubnetAddressPrefix": {"value": "10.0.0.0/24"},
  "userCompany": { "value": "" },
  "userEmail": { "value": "" },
  "userFirstName": { "value": "" }, 
  "userLastName": { "value": "" },
  "userJobTitle": { "value": "Architect" }
}

Results in a provisioning failure with an error message ending with:

...
dpkg-preconfigure: unable to re-open stdin: No such file or directory
monit: Cannot connect to the monit daemon. Did you start it with http support?
monit: Cannot connect to the monit daemon. Did you start it with http support?
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Failed to open terminal.debconf: whiptail output the above errors, giving up!
dpkg: error processing package iptables-persistent (--configure):
 subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
 iptables-persistent
E: Sub-process /usr/bin/dpkg returned an error code (1)
start: Job is already running: walinuxagent

It looks like iptables-persistent fails to install silently.

Add an additional Data Node

Hi Team,

After creating an Elastic search cluster with ARM template provided. Is it possible to add another VM as a data node.
We have been trying this out and it always crashes the entire elastic search cluster.
Is there any additional template for adding extra nodes to the existing cluster?

Accessing Elasticsearch from deployed template

From email to Azure Marketplace:

I have deployed Kibana and Elastisearch on Microsoft Azure and having problems accessing Elastic Search on port 9200 and also Kibana.

Can you please provide proper documentations on how to go on deploying and setting up Elastic Search and Kibana on Azure?

Using External Load Balancer causes Kibana to be misconfigured

If you set up a cluster using the ARM template, and choose External load balancer at the very end, and also choose to install Kibana, Kibana will end up misconfigured. This is similar to this issue:

#14

And will manifest itself the same way. The workaround is to SSH into the VM and change the Kibana configuration by hand.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.