Coder Social home page Coder Social logo

k8s-logging-efk's Introduction

k8s-fluentd

Kubernetes logging mechanism using EFK (Elastic search, Kibana and Fluentd)

Prerequisites

docker version

kubectl version

minikube version

helm version

minikube start

Implementation

Step 1: Create Namespace

kubectl create namespace efk-monitoring

Step 2: Add Elastic Helm Repository

helm repo add elastic https://helm.elastic.co
helm repo update

Step 3: Install Elasticsearch

helm install elasticsearch elastic/elasticsearch --version 7.17.3 -n efk-monitoring --set replicas=1

Step 4: Install Elasticsearch with Persistence Disabled

If you want to disable persistence for Elasticsearch (Note: This is suitable for testing purposes only):

helm install elasticsearch elastic/elasticsearch --version 7.17.3 -n efk-monitoring --set persistence.enabled=false,replicas=1

Step 5: Check the Installation

helm list -n efk-monitoring
kubectl get pods -n efk-monitoring
kubectl get svc -n efk-monitoring

Step 6: Install Kibana

helm install kibana elastic/kibana --version 7.17.3 -n efk-monitoring

Step 7: Verify Kibana Installation

kubectl get pods -n efk-monitoring

Step 8: Apply Fluentd Configuration

Apply the Fluentd ConfigMap and DaemonSet YAML files:

kubectl apply -f ./fluentd-config-map.yaml
kubectl apply -f ./fluentd-rbac.yaml

Step 9: Monitor Fluentd DaemonSet

Monitor the Fluentd DaemonSet to ensure successful deployment:

kubectl get pods -n kube-system -w

Step 10: Add Dapr Helm Repository (Optional)

helm repo add dapr https://dapr.github.io/helm-charts/
helm repo update

Step 11: Install Dapr (Optional) Install Dapr with JSON formatted logs enabled:

helm install dapr dapr/dapr --namespace efk-monitoring --set global.logAsJson=true

Step 12: Port Forward Kibana

To access Kibana web interface:

kubectl port-forward svc/kibana-kibana 5601 -n efk-monitoring

Step13: Deploy the sample application

kubectl apply -f k8s-app.yml

kubectl get pods

kubectl get svc

kubectl logs <pod-name>

kubectl port-forward svc/myapp 8080

Delete all the resources

kubectl delete -f k8s-app.yml

kubectl delete -f fluentd-config-map.yaml

kubectl delete -f fluentd-rbac.yaml

helm list -n efk-monitoring

helm uninstall elasticsearch -n efk-monitoring

helm uninstall kibana -n efk-monitoring

k8s-logging-efk's People

Contributors

newlinedeveloper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.