You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

https://medium.com/avmconsulting-blog/how-to-deploy-an-efk-stack-to-kubernetes-ebc1b539d063

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-elasticsearch-fluentd-and-kibana-efk-logging-stack-on-kubernetes


01. 사전조건

02. 개요

03. 설치

03-01. Namespace 생성

sansae@win10pro-worksp:/workspaces$ kubectl create ns monitor-efk

03-02. StorageClass 확인

sansae@win10pro-worksp:/workspaces$ kubectl get sc
NAME                PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
azurefile           kubernetes.io/azure-file   Delete          Immediate              true                   63d
azurefile-premium   kubernetes.io/azure-file   Delete          Immediate              true                   63d
default (default)   kubernetes.io/azure-disk   Delete          Immediate              true                   63d
managed             kubernetes.io/azure-disk   Delete          WaitForFirstConsumer   true                   28d
managed-premium     kubernetes.io/azure-disk   Delete          Immediate              true                   63d

03-03. Elasticsearch

sansae@win10pro-worksp:/workspaces$ git clone
sansae@win10pro-worksp:/workspaces$ mv helm-charts elastic
sansae@win10pro-worksp:/workspaces$ cd elastic
sansae@win10pro-worksp:/workspaces/elastic$ 
sansae@win10pro-worksp:/workspaces/elastic$ vi elasticsearch/values.yaml
=========================================================
image: "docker.elastic.co/elasticsearch/elasticsearch"
imageTag: "7.12.0"
imagePullPolicy: "IfNotPresent"
----------------------------------------
volumeClaimTemplate:
  storageClassName: managed-premium
  accessModes: [ "ReadWriteOnce" ]
  resources:
    requests:
      storage: 30Gi
=========================================================
sansae@win10pro-worksp:/workspaces/elastic$ helm install elasticsearch/ --generate-name -n monitor-efk
NAME: elasticsearch-1617184828
LAST DEPLOYED: Wed Mar 31 19:00:30 2021
NAMESPACE: monitor-efk
STATUS: deployed
REVISION: 1
NOTES:
1. Watch all cluster members come up.
  $ kubectl get pods --namespace=monitor-efk -l app=elasticsearch-master -w
2. Test cluster health using Helm test.
  $ helm --namespace=monitor-efk test elasticsearch-1617184828

03-03. Fluentd

sansae@win10pro-worksp:/workspaces$ git clone
sansae@win10pro-worksp:/workspaces$ mv helm-charts fluent
sansae@win10pro-worksp:/workspaces$ cd fluent
sansae@win10pro-worksp:/workspaces/fluent$ cd charts
sansae@win10pro-worksp:/workspaces/fluent/charts$ vi fluentd/values.yaml
=========================================================
env:
#- name: "FLUENTD_CONF"
#  value: "../../etc/fluent/fluent.conf"
  - name: FLUENT_ELASTICSEARCH_HOST
    value: "elasticsearch-master"
  - name: FLUENT_ELASTICSEARCH_PORT
    value: "9200"
=========================================================
sansae@win10pro-worksp:/workspaces/fluent/charts$ helm install fluentd --generate-name -n monitor-efk
NAME: fluentd-1617186347
LAST DEPLOYED: Wed Mar 31 19:25:49 2021
NAMESPACE: monitor-efk
STATUS: deployed
REVISION: 1
NOTES:
Get Fluentd build information by running these commands:

export POD_NAME=$(kubectl get pods --namespace monitor-efk -l "app.kubernetes.io/name=fluentd,app.kubernetes.io/instance=fluentd-1617186347" -o jsonpath="{.items[0].metadata.name}")
echo "curl http://127.0.0.1:24231/metrics for Fluentd metrics"
kubectl --namespace monitor-efk port-forward $POD_NAME 24231:24231






  • No labels