EFK Stack on Kubernetes
2 min readApr 14, 2020
Do you want to manage setup centralized, cluster-level logging stack can help you quickly sort through and analyze the heavy volume of log data produced by your Pods in Kubernetes Cluster?
One popular centralized logging solution is the Elasticsearch, Fluentd, and Kibana (EFK) stack.
Let’s configure EFK stack on Minikube.
Prerequisites
Before you begin with this guide, ensure you have the following available to you:
Step 1 — Change Namespace to kube-system
kubectl config set-context --current --namespace=kube-system
Step 2— Deploy Elasticsearch
kubectl create -f https://raw.githubusercontent.com/jainishshah17/k8s_intro/master/daemonset/elasticsearch.yml
- Check deployment
kubectl get deployment
- Check services
kubectl get services
Step 3— Deploy Kibana
kubectl create -f https://raw.githubusercontent.com/jainishshah17/k8s_intro/master/daemonset/elasticsearch.yml
- Check deployment
kubectl get deployment
- Check services
kubectl get services
- Get Kibana URL
export NODE_PORT=$(kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services kibana)export NODE_IP=$(minikube ip)echo http://$NODE_IP:$NODE_PORT/
Open printed URL in browser to access Kibana Dashboard.
Step 4— Deploy Fluentd DaemonSet
kubectl create -f https://raw.githubusercontent.com/jainishshah17/k8s_intro/master/daemonset/elasticsearch.yml
- Check DaemonSet
kubectl get ds
- Refresh Kibana Dashboard in browser.
echo http://$NODE_IP:$NODE_PORT/
Congratulations!! You have successfully deployed ELK stack in Kubernetes.
Here is the Tutorial video: