elastabot

by joaquinito2051

Helm chartv1.2.0App 1.1.0

A Helm chart for Elastabot - a Slack bot companion for Elasticsearch and ElastAlert

About this chart

Elastabot Helm Chart

Elastabot: A Slack bot companion to Elasticsearch and ElastAlert. Current support includes searching for data, checking the cluster health, acknowledging (and silencing) alerts, and also triggering triage events, which are currently initiated via an smtp email. The emails by default will contain the alert details, but arbitrary triage requests can also be created. The triage email is best used with a ticketing system that is monitoring for such emails, such as Jira.

Usage

More detailed information can be found at the Elastabot project (GitHub) website. However, to get started without reading the details, Send the message !help to the bot, after deploying this chart.

Installing the Chart

To install the chart with the release name my-release:

helm install --name my-release <helm-repo>/elastabot

helm install --name my-release stable/elastabot The command deploys Elastabot on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation. The secrets section lists the required Kubernetes secrets.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release --purge

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

settingdescriptiondefault
image.repositoryDocker image repositoryjertel/elastabot
image.tagTag, typically the version, of the Docker image1.1.0
image.pullPolicyKubernetes image pull policyIfNotPresent
commandPrefixSpecial character or phrase to trigger the bot, typically an exclamation point, !. Ex: !ack!
elasticsearch.hostHostname for the Elasticsearch server
elasticsearch.portPort for the Elasticsearch server9200
elasticsearch.sslEnabledIf true, uses SSL/TLS to connect to Elasticsearchfalse
elasticsearch.sslStrictEnabledIf true, the SSL/TLS certificates will be validated against known certificate authoritiesfalse
elasticsearch.timeoutSecondsNumber of seconds to wait for an Elasticsearch response10
elasticsearch.urlPrefixURL prefix for Elasticsearch, typically an empty string
elastalert.indexThe index prefix used by Elastalert within Elasticsearch, typically elastalertelastalert
elastalert.silenceMinutesNumber of minutes to silence an acknowledge alert if a silence duration is not explicitly given with the ack command.240
elastalert.recentMinutesNumber of minutes to look back through Elasticsearch indices for a matching triggered alert4320
smtp.hostHostname for the SMTP server
smtp.portPort for the SMTP server25
smtp.secureIf true, will connect to the SMTP host over SSL/TLSfalse
smtp.starttlsIf true, will send the starttls command (typically not used with smtp.secure=true)false
smtp.timeoutSecondsNumber of seconds to wait for the SMTP server to respond10
smtp.toEmail address that will receive the triage email
smtp.fromSender email address
smtp.subjectPrefixIf non-empty string, will be prepended to each email subject. Ex: [prod] , [test] , etc
smtp.debugIf true, the SMTP connectivity details will be logged to stdoutfalse
triageTargetHow to initiate the triage process, currently only smtp is supported.smtp
searchEnabledAllow all Slack users to search the Elasticsearch cluster for any data. Disable in public communities with sensitive datatrue

Secrets

variablerequireddescription
slackBotTokentrueThe Slack-generated bot token, provided by slack.com
elasticsearchUsernametrueElasticsearch username, provided by your ES admin
elasticsearchPasswordtrueElasticsearch password, provided by your ES admin
smtpUsernamefalseOptional SMTP username, provided by your SMTP admin (used with SMTP triage target)
smtpPasswordfalseOptional SMTP password, provided by your SMTP admin (used with SMTP triage target)

Below is a sample secrets.yaml file that can be used as a template. Remember that all secrets must be base64-encoded.

apiVersion: v1
kind: Secret
metadata:
  name: elastabot-secrets
type: Opaque
data:
  slackBotToken: ""
  elasticsearchUsername: ""
  elasticsearchPassword: ""
  smtpUsername: ""
  smtpPassword: ""

Once you have provided the base64-encoded secret values, apply the file to your Kubernetes cluster as follows:

kubectl apply -f secrets.yaml

Deploy elastabot with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has elastabot on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartelastabot is pinned at v1.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply