K8S日志系统EFK

2019/12/27 posted in  Kubernetes

elasticsearch

helm install elasticsearch stable/elasticsearch -n share

fluentd

helm repo add kiwigrid https://kiwigrid.github.io
helm repo update
helm install fluentd  kiwigrid/fluentd-elasticsearch --set elasticsearch.bufferChunkLimit="20M",elasticsearch.bufferQueueLimit=20 -n share

bufferChunkLimit 一次发送数据的最大限制
bufferQueueLimit 待发送数据的最大数量限制

bufferChunkLimit * bufferQueueLimit 应小于PC内存

kibana

helm install kibana stable/kibana --set ingress.enabled=true,ingress.hosts[0]=kibana.dev.youxuetong.com -n share

需要手动修改kibana的configmap,修改其中的elasticsearch.hosts

data:
  kibana.yml: |
    elasticsearch.hosts: http://elasticsearch-client:9200
    server.host: "0"
    server.name: kibana

删除正在运行的kibana的pod

kubectl delete pod kibana-557d4dc6b9-7dx5j -n share