- To allow users to easily and efficiently manage (collect, store and analyze) log data.
- Elasticsearch : Fast and scalable log storage and retrieval
- Fluentbit: Handles log collection and forwarding
- Kibana: Provides a powerful visualization and dashboarding interface
-
Java App -> java-app-efk/ReadMe.MD
-
Node App -> node-app/ReadMe.MD
- minikube start --memory 4096 --cpus 4 --kubernetes-version v1.25.14
Deploy the java application
- Set the following env variables:
- DOCKER_REGISTRY_SERVER=docker.io
- DOCKER_USER=<DOCKER_ID>
- DOCKER_EMAIL=<yor_email>
- DOCKER_PASSWORD=<your_psw>
- Create the secret
kubectl create secret docker-registry myregistrysecret \
--docker-server=$DOCKER_REGISTRY_SERVER \
--docker-username=$DOCKER_USER \
--docker-password=$DOCKER_PASSWORD \
--docker-email=$DOCKER_EMAIL
kubectl apply -f java-app-efk/deployment.yaml
kubectl get pods
NAME READY STATUS RESTARTS AGE
java-app-558bb79ff6-54rcm 1/1 Running 0 52s
-
Check the logs
kubectl logs java-app-558bb79ff6-54rcm
kubectl apply -f node-app/deployment.yaml
kubectl get pods
NAME READY STATUS RESTARTS AGE
java-app-558bb79ff6-54rcm 1/1 Running 0 7m52s
node-app-66c684f4b5-9pssm 1/1 Running 0 60s
-
Check the logs
kubectl logs node-app-66c684f4b5-9pssm
Apply the following command:
kubectl apply -f efk-installation
- Make sure Elasticsearch cluster is working:
-
kubectl port-forward svc/elasticsearch 9200 -n kube-logging
-
curl http://localhost:9200/_cluster/health/?pretty -u elastic
- psw: password
- Verify Kibana Deployment
kubectl port-forward <kibana-pod-name> 5601:5601 -n kube-logging
i.e.
kubectl port-forward kibana-77c8bb6f94-f46zf 5601:5601 -n kube-logging
visit http://localhost:5601/ (user/psw -> elastic/password)
3* https://gitlab.com/nanuchi/efk-course-commands/-/blob/master/commands.md?ref_type=heads
4* Protected EFK Stack Setup for Kubernetes - Priyanshi Chauhan