Step-by-Step Deployment of the ELK Stack (Elasticsearch, Logstash, Kibana, Filebeat) on Kubernetes Using Docker and Helm
This guide details how to deploy Elasticsearch, Logstash, Kibana, and Filebeat on a Kubernetes cluster by pulling Docker images, customizing Helm chart values, installing the charts, and verifying pod status, providing a complete end‑to‑end ELK stack setup procedure.
1. Deploy Elasticsearch
Pull the required Docker images:
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.2 docker pull docker.elastic.co/kibana/kibana:7.17.2 docker pull docker.elastic.co/logstash/logstash:7.17.2 docker pull docker.elastic.co/beats/filebeat:7.17.2Create a namespace for the ELK stack:
kubectl create namespace elkDownload the Elasticsearch Helm chart and inspect its files:
helm fetch elastic/elasticsearch cd elasticsearch/Modify values.yaml to reduce resource requirements (set master node count to 1 and disable high‑availability settings).
Install the chart:
helm install elasticsearch -f values.yaml elastic/elasticsearch --namespace elkVerify the deployment:
kubectl describe pod elasticsearch-master-0 -n elk kubectl get pods -n elk -l app=elasticsearch-master2. Deploy Logstash
Download the Logstash chart and extract it:
helm fetch elastic/logstash tar -zxvf logstash-7.17.3.tgzAdjust values.yaml as needed, then install:
helm install logstash -f values.yaml elastic/logstash --namespace elkPull the Logstash Docker image and watch the pods:
docker pull docker.elastic.co/logstash/logstash:7.17.2 kubectl get pods --namespace=elk -l app=logstash-logstash -w3. Deploy Filebeat
Fetch the Filebeat chart, extract it, and install:
helm fetch elastic/filebeat tar -zxf filebeat-7.17.3.tgz helm install filebeat elastic/filebeat --namespace elkPull the Filebeat Docker image and verify the pods:
docker pull docker.elastic.co/beats/filebeat:7.17.2 kubectl get pods --namespace=elk -l app=filebeat-filebeat4. Deploy Kibana
Pull the Kibana image and download its Helm chart:
docker pull docker.elastic.co/kibana/kibana:7.17.2 helm fetch elastic/kibanaEdit values.yaml to change the service type to NodePort , then install:
helm install kibana01 -f values.yaml elastic/kibana --namespace elkCheck the Kibana pod status:
kubectl get pods --namespace=elk -o wideAfter all components are running, the ELK stack is ready for log collection, processing, and visualization.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.