Skip to main content

ElasticSearch notifier development

The easiest way to develop Botkube with Elasticsearch notifier enabled is to install Elasticsearch on your local Kubernetes cluster.

Steps​

  1. Install Elasticsearch:

    helm repo add elastic https://helm.elastic.co
    helm install elasticsearch elastic/elasticsearch --version 7.17.3 --set replicas=1 --set resources.requests.cpu="100m" --set resources.requests.memory="512M" --wait
  2. Install Botkube with Elasticsearch, according to the Elasticsearch installation instruction, where:

    • ELASTICSEARCH_USERNAME is elastic,
    • ELASTICSEARCH_PASSWORD is changeme,
    • ELASTICSEARCH_ADDRESS is http://elasticsearch-master.default:9200.

    You don't need to set index name, type, shards and replicas.

To review if the events are properly saved in Elasticsearch, follow these steps:

  1. Do port forward:

    kubectl port-forward svc/elasticsearch-master 9200
  2. Fetch Elasticsearch indices:

    curl http://localhost:9200/_cat/indices
  3. Copy the index name with the botkube- prefix and export it as environment variable. For example:

    export INDEX_NAME="botkube-2022-06-06"
  4. See Elasticsearch index details with logged events:

    curl http://localhost:9200/$INDEX_NAME/_search\?pretty