Categories
Kubernetes

Kubernetes: Install Bitnami Elasticsearch & Kibana using Helm

https://github.com/bitnami/charts/tree/master/bitnami/elasticsearch

What is it?

Elasticsearch

Elasticsearch is a distributed, open source search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured.

Kabana

Kibana is a free and open user interface that lets you visualize your Elasticsearch data and navigate the Elastic Stack.

Repo

Add repo.

helm repo add bitnami https://charts.bitnami.com/bitnami

Update repo.

helm repo update

View version.

helm search repo -l bitnami/elasticsearch | head

Install

The Bitnami Elasticsearch Helm chart can be deployed on any Kubernetes cluster. With the chart, Bitnami provides two configuration files: values.yaml, which initializes the deployment using a set of default values and is intended for development or test environments, and values-production.yaml, which is intended for production environments.

https://engineering.bitnami.com/articles/create-a-fault-tolerant-and-scalable-elasticsearch-cluster-with-bitnami-and-helm.html

values.yaml

The values.yaml file deploys a cluster containing 6 nodes, as follows:

  • 2 master-eligible nodes
  • 2 coordinating-only nodes
  • 2 data nodes

Download values.yaml.

wget https://raw.githubusercontent.com/bitnami/charts/master/bitnami/elasticsearch/values.yaml

Install.

helm install elasticsearch \
  -f values.yaml \
  --set sysctlImage.enabled=true \
  --version 12.3.4 \
  -n itsmetommy \
  bitnami/elasticsearch

Optional.

  --set data.persistence.size=16Gi \
  --set coordinating.service.type=LoadBalancer \
  --set global.kibanaEnabled=true \

View.

kubectl get pod -l app.kubernetes.io/instance=elasticsearch -n itsmetommy
NAME READY STATUS RESTARTS AGE
elasticsearch-elasticsearch-coordinating-only-679fbf7d75-6rdx5 1/1 Running 0 43s
elasticsearch-elasticsearch-coordinating-only-679fbf7d75-xv8k6 1/1 Running 0 43s
elasticsearch-elasticsearch-data-0 1/1 Running 0 43s
elasticsearch-elasticsearch-data-1 1/1 Running 0 43s
elasticsearch-elasticsearch-master-0 1/1 Running 0 43s
elasticsearch-elasticsearch-master-1 1/1 Running 0 43s

values-production.yaml

The values-production.yaml file deploys a cluster containing 12 nodes, as follows:

  • 2 ingest nodes
  • 3 master-eligible nodes
  • 2 coordinating-only nodes
  • 3 data nodes
  • 1 metrics-exporter node
  • 1 kibana node

Download values-production.yaml.

wget https://raw.githubusercontent.com/bitnami/charts/master/bitnami/elasticsearch/values-production.yaml

Install.

helm install elasticsearch \
  -f values-production.yaml \
  --set data.persistence.size=16Gi \
  --set sysctlImage.enabled=true \
  --version 12.3.4 \
  -n itsmetommy \
  bitnami/elasticsearch

Optional.

  --set data.persistence.size=16Gi \
  --set coordinating.service.type=LoadBalancer \

View.

kubectl get pod -l app.kubernetes.io/instance=elasticsearch -n itsmetommy
NAME                                                   READY   STATUS    RESTARTS   AGE
elasticsearch-coordinating-only-86c8c5dbbf-rtf8k       1/1     Running   0          14m
elasticsearch-coordinating-only-86c8c5dbbf-rznr4       1/1     Running   0          14m
elasticsearch-elasticsearch-data-0                     1/1     Running   0          14m
elasticsearch-elasticsearch-data-1                     1/1     Running   0          14m
elasticsearch-elasticsearch-data-2                     1/1     Running   0          14m
elasticsearch-elasticsearch-ingest-78898cd976-mwx7n    1/1     Running   0          14m
elasticsearch-elasticsearch-ingest-78898cd976-qfzlm    1/1     Running   0          14m
elasticsearch-elasticsearch-master-0                   1/1     Running   0          14m
elasticsearch-elasticsearch-master-1                   1/1     Running   0          14m
elasticsearch-elasticsearch-master-2                   1/1     Running   0          14m
elasticsearch-elasticsearch-metrics-677b54879f-2fs5p   1/1     Running   0          14m
elasticsearch-kibana-6b5dc78fff-652xf                  1/1     Running   0          14m

Connect

Elasticsearch

kubectl port-forward svc/elasticsearch-elasticsearch-coordinating-only 9200:9200 -n itsmetommy

# test response
open http://localhost:9200
curl http://localhost:9200

# view nodes
open http://localhost:9200/_cat/nodes
curl http://localhost:9200/_cat/nodes

# cluster health
open http://localhost:9200/_cluster/health?pretty
curl http://localhost:9200/_cluster/health?pretty

Kibana

kubectl port-forward svc/elasticsearch-kibana 5601:5601 -n itsmetommy

# connect
open http://localhost:5601

Dashboard with sample data.

Uninstall

helm uninstall elasticsearch -n itsmetommy && kubectl delete pvc -l app.kubernetes.io/instance=elasticsearch -n itsmetommy
Comments

By Tommy Elmesewdy

DevOps Engineer