This is a demonstration of monitoring on EKS cluster using EFK stack
git clone https://github.com/haquocdat543/efk.git
cd efk
aws cloudformation deploy --stack-name k8s --template-file k8s.yaml --capabilities CAPABILITY_IAM
aws cloudformation deploy --stack-name pipeline --template-file pipeline.yaml
aws cloudformation describe-stacks --query Stacks[].Outputs[*].[OutputKey,OutputValue] --output text
Replace $region
to your custom
eksctl utils associate-iam-oidc-provider --cluster=EKSCluster --region $region --approve
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
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
kubectl apply -f namespace.yaml
service:
kubectl apply -f elasticsearch-svc.yaml
statefulset
kubectl apply -f elasticsearch.yaml
service:
kubectl apply -f kibana-svc.yaml
statefulset
kubectl apply -f kibana.yaml
kubectl apply -f fluentd.yaml
kubectl config set-context --current --namespace kube-logging
kubectl get svc
copy kibana loadbalancer dns and paste it in your browser: <loadbalancer-dns>:5601
kubectl delete namespace kube-logging
aws cloudformation delete-stack --stack-name k8s
aws cloudformation delete-stack --stack-name eksctl-EKSCluster-addon-iamserviceaccount-kube-system-ebs-csi-controller-sa