Coder Social home page Coder Social logo

efk's Introduction

efk

This is a demonstration of monitoring on EKS cluster using EFK stack

Prerequisites

Start

1. Clone repo

git clone https://github.com/haquocdat543/efk.git
cd efk

2. Initiaize

1. k8s cluster

aws cloudformation deploy --stack-name k8s --template-file k8s.yaml --capabilities CAPABILITY_IAM

2. pipeline

aws cloudformation deploy --stack-name pipeline --template-file pipeline.yaml

4. Get output

aws cloudformation describe-stacks --query Stacks[].Outputs[*].[OutputKey,OutputValue] --output text

3. Install Role and Addon

1. OIDC

Replace $region to your custom

eksctl utils associate-iam-oidc-provider --cluster=EKSCluster --region $region --approve

2. Create EBS CNI Role

Replace $cluster to your custom

eksctl create iamserviceaccount --name ebs-csi-controller-sa --namespace kube-system --cluster EKSCluster --role-name AmazonEKS_EBS_CSI_DriverRole --role-only --attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy --approve 

3. Add addons

Replace and YOUR_AWS_ACCOUNT to your custom

aws eks create-addon --cluster-name EKSCluster --addon-name aws-ebs-csi-driver --service-account-role-arn arn:aws:iam::YOUR_AWS_ACCOUNT_ID:role/AmazonEKS_EBS_CSI_DriverRole

4. Deploy k8s resources

1. Namespace

kubectl apply -f namespace.yaml

2. Elasticseach

service:

kubectl apply -f elasticsearch-svc.yaml

statefulset

kubectl apply -f elasticsearch.yaml

3. Kibana

service:

kubectl apply -f kibana-svc.yaml

statefulset

kubectl apply -f kibana.yaml

4. Fluentd

kubectl apply -f fluentd.yaml

5. Access Kibana

kubectl config set-context --current --namespace kube-logging
kubectl get svc

copy kibana loadbalancer dns and paste it in your browser: <loadbalancer-dns>:5601

5. Destroy

1. Delete k8s resources

kubectl delete namespace kube-logging

2. Delete cloudformation stack

aws cloudformation delete-stack --stack-name k8s
aws cloudformation delete-stack --stack-name eksctl-EKSCluster-addon-iamserviceaccount-kube-system-ebs-csi-controller-sa

efk's People

Contributors

haquocdat543 avatar

Watchers

 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.