openshift3.11中使用ECK安装filebeat+elasticsearch+kibana收集日志初探

部署eck-operator

# 部署eck-operator
kubuectl apply -f https://download.elastic.co/downloads/eck/1.3.1/all-in-one.yaml

部署elasticsaerch

其中quickstart可以修改为自定义的集群名称

elasticsearch.yaml

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 7.10.1
  nodeSets:
  - name: default
    count: 1
    config:
      node.master: true
      node.data: true
      node.ingest: true
    podTemplate:
      spec:
        nodeSelector:
          node-role.kubernetes.io/infra: 'true'

部署kibana

kibana.yaml

查看kibana登录密码

账号 elastic

创建elasticsaerch 过滤pipline

方式一:通过curl 调用es api 设置 pipeline

bfs-api-pipeline.json

方式二:通过 kibana dev-tools console 设置 grok 正则 pipeline

通过 kibana dev tools grokdebugger https://eck-kb.xxx.xxx/app/dev_tools#/grokdebugger 测试正则

打开 kibana 自带的 dev-tools console https://eck-kb.xx.xxx/app/dev_tools#/console 创建pipeline

模拟数据测试pipeline

部署filebeat

filebeat.yaml

参考链接:

https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-eck.html

https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor

https://cloud.tencent.com/developer/article/1643602

https://zhuanlan.zhihu.com/p/105453664

Last updated