Akiraka Akiraka
  • Home
  • Linux
    • ELK
    • PHP
    • Shell
    • Nginx
    • Docker
      • Docker Compose
    • Centos
    • Ubuntu
    • Jenkins
  • Python
  • Mac OS
  • Windows
  • Big Data
    • Hadoop
    • CDH
    • Hive
    • Spark
    • ZooKeeper
  • K8S
    • Kubernetes
    • Helm
  • Other
  • Quark
  • Contribute
  • Home
  • Linux
    • ELK
    • PHP
    • Shell
    • Nginx
    • Docker
      • Docker Compose
    • Centos
    • Ubuntu
    • Jenkins
  • Python
  • Mac OS
  • Windows
  • Big Data
    • Hadoop
    • CDH
    • Hive
    • Spark
    • ZooKeeper
  • K8S
    • Kubernetes
    • Helm
  • Other
  • Quark
  • Contribute
首页 Golang Kubernetes(k8s)Helm 部署 EFK 集群

Kubernetes(k8s)Helm 部署 EFK 集群

Akiraka 2年前

文章目录

  • 一、集群信息
    • 1.1、 主机信息
    • 1.2、版本说明
  • 二、部署 NFS 服务
    • 2.1、 安装 NFS 与 rpcbind 服务
    • 2.2、集群节点安装 nfs
  • 三、部署动态 PV
    • 3.1、 创建名称空间
    • 3.2、创建 EFK 存储目录
    • 3.3、使用 helm 安装 nfs-client-provisioner
    • 3.4、查看运行 nfs-client-provisioner Pod 状态
  • 四、部署 Elasticsearch
    • 4.1、 创建 EFK 集群名称空间
    • 4.2、 添加 Helm Elastic 储存库
    • 4.3、Elasticsearch 节点说明
    • 4.4、开启 Elasticsearch 集群安全
      • 4.4.1、 生成证书脚本
      • 4.4.2、生成集群证书
      • 4.4.3、添加证书到 K8S
    • 4.5、部署 es-master 节点
    • 4.6、部署 es-data 节点
    • 4.7、部署 es-client 节点
  • 五、查看 Elasticsearch 部署状态
    • 5.1、查看 Elasticsearch Pv 状态
    • 5.2、查看 Elasticsearch Pod 状态
    • 5.3、查看 Elasticsearch Svc 状态
  • 六、部署 Filebeat
    • 6.1、 添加 Helm Elastic 储存库
    • 6.2、使用 helm 安装 Filebeat
    • 6.3、查看运行 Filebeat Pod 状态
  • 七、部署 Kibana
    • 7.1、 添加 Helm Elastic 储存库
    • 7.2、使用 helm 安装 Kibana
    • 7.3、查看运行 Kibana Pod 状态
  • 八、访问仪表盘
    • 8.1、 通过 Elasticsearch Head 访问
    • 8.2、访问 Kibana 仪表盘
    • 8.3、创建 Kibana 索引
    • 8.4、通过 Kibana 查看 Filebeat 日志

一、集群信息

  • 方法因人而异,但大同小异,以下是我的部署方法。
  • elasticsearch 与 kibana 必须同一个版本来部署
  • 性能不够还是别跑了。
  • Kubernetes master 节点最小 2 核 2G 内存。
  • Kubernetes node 节点最小 1 核 2G 内存。
  • 性能实在性能不够,副本跑 1 个,2 个节点就是了。
  • 虽然 node 节点看起来能跑,但是随便跑点东西就吃紧,怎么说也要 2G 内存起步。

1.1、 主机信息

主机名 ip地址 描述 核心 内存
node-01 192.168.8.131 master 节点 2核 8G
node-02 192.168.8.132 node 节点 2核 8G
node-03 192.168.8.133 node 节点 2核 8G
node-04 192.168.8.134 node 节点 2核 8G

1.2、版本说明

服务 版本
helm 3.1.1
Kibana 7.9.1
Filebeat 7.9.1
Kubernetes 1.17.3
Elasticsearch 7.9.1
nfs-client-provisioner 1.2.8

二、部署 NFS 服务

2.1、 安装 NFS 与 rpcbind 服务

#   创建 NFS 存储目录
mkdir -p /data/NFS
#   安装nfs服务
yum -y install nfs-utils rpcbind
#   修改配置文件
echo "/data/NFS *(rw,sync,no_root_squash,no_subtree_check)" > /etc/exports
#   启动服务
systemctl start nfs && systemctl start rpcbind
#   设置开机启动
systemctl enable nfs-server && systemctl enable rpcbind

2.2、集群节点安装 nfs

  • 重点全部节点都需要安装 nfs-utils 安装了即可不需要配置,否则节点无法挂载 pv
    #   安装nfs服务
    yum -y install nfs-utils

    三、部署动态 PV

    3.1、 创建名称空间

  • 创建一个 monitoring 名称空间,将 nfs-client-provisioner 放在这个名称空间上
kubectl create ns nfs

3.2、创建 EFK 存储目录

  • 该存储目录专门存放 EFK 数据包括: Elasticsearch Fluentd Kibana 数据
mkdir -p /data/NFS/EFK

3.3、使用 helm 安装 nfs-client-provisioner

  • 项目地址:https://hub.helm.sh/charts/stable/nfs-client-provisioner
  • 安装到 nfs 命名空间
  • 重点:nfs.path 让数据存储到指定目录,这样好区分数据
  • 重点:storageClass.name 这里填写 monitoring 专属名称,用于 PVC 自动绑定专属动态 PV 上。
#   下面代码直接复制黏贴即可
cat > elastic-client.yaml << EOF
# NFS 设置
nfs:
  server: 192.168.8.131
  path: /data/NFS/EFK
storageClass:
  # 此配置用于绑定 PVC 和 PV
  name: elastic-nfs-client
  # 资源回收策略
  reclaimPolicy: Retain
# 使用镜像
image:
  repository: kubesphere/nfs-client-provisioner
# 副本数量
replicaCount: 3
EOF

#   helm 部署 Prometheus 安装指定版本 Prometheus 5.0.4
helm install elastic-nfs-storage -n nfs --values elastic-client.yaml stable/nfs-client-provisioner --version 1.2.8

3.4、查看运行 nfs-client-provisioner Pod 状态

[root@Node-01 ~]# kubectl get pod -n nfs -w
NAME                                                             READY   STATUS    RESTARTS   AGE
efk-nfs-storage-nfs-client-provisioner-57d6c64f6b-hqb9p          1/1     Running   0          4s
efk-nfs-storage-nfs-client-provisioner-57d6c64f6b-jj5vr          1/1     Running   0          4s

四、部署 Elasticsearch

  • 内存低于 2G 可能会崩溃
  • 由于之前创建动态 PV 当节点启动完成会自动挂载目录,无需再次创建 PV
  • 项目地址:https://hub.helm.sh/charts/elastic/elasticsearch

4.1、 创建 EFK 集群名称空间

  • 创建一个 monitoring 名称空间,将 efk 放在这个名称空间上
kubectl create ns efk

4.2、 添加 Helm Elastic 储存库

  • 项目地址:https://hub.helm.sh/charts/elastic/kibana
#   添加 helm elastic 储存库
helm repo add elastic https://helm.elastic.co

4.3、Elasticsearch 节点说明

  • es-master 搭建一个 elasticsearch 至少需要 3 个 Pod 以防止集群脑裂。
  • es-data 数据节点至少需要 2 个 Pod 。数据节点将保留数据、接收查询和索引请求。
  • es-client 做为协调 elasticsearch 集群。至少需要 2 个。用于集群连接,并充当 HTTP 代理。如果不使用 es-clinet 那么 es-data 充当协调,尽量避免在较大的集群上这样做。
集群名称 节点名称 节点角色 副本数量 分配空间 网络模式 备注
es-aka master master: "true" ingest: "false" data: "false" 3 4Gi ClusterIP 主节点
es-aka data master: "false" ingest: "false" data: "true" 3 60Gi ClusterIP 数据节点
es-aka client master: "false" ingest: "false" data: "false" 2 null NodePort 连接节点

4.4、开启 Elasticsearch 集群安全

4.4.1、 生成证书脚本
  • 新建脚本文件,运行成功后,会在目录生成证书
cat <<'EOF'> es-security.sh
#   拷贝下面内容到脚本中
#!/bin/bash
# 指定 elasticsearch 版本
RELEASE=7.9.1
# 运行容器生成证书
docker run --name elastic-charts-certs -i -w /app \
  elasticsearch:${RELEASE} \
  /bin/sh -c " \
    elasticsearch-certutil ca --out /app/elastic-stack-ca.p12 --pass '' && \
    elasticsearch-certutil cert --name security-master --dns security-master --ca /app/elastic-stack-ca.p12 --pass '' --ca-pass '' --out /app/elastic-certificates.p12" && \
# 从容器中将生成的证书拷贝出来
docker cp elastic-charts-certs:/app/elastic-certificates.p12 ./ && \
  # 证书生成成功该容器删除
  docker rm -f elastic-charts-certs && \
  openssl pkcs12 -nodes -passin pass:'' -in elastic-certificates.p12 -out elastic-certificate.pem
EOF
4.4.2、生成集群证书
  • 运行完成会获得 elastic-certificate.pem 与 elastic-certificates.p12
#   赋予脚本运行权限并运行
chmod +x es-security.sh && ./es-security.sh
4.4.3、添加证书到 K8S
  • 添加到集群命名空间 efk 中
  • 添加证书与设置集群密码
#   添加证书
kubectl create secret -n efk generic elastic-certificates --from-file=elastic-certificates.p12
kubectl create secret -n efk generic elastic-certificate-pem --from-file=elastic-certificate.pem
#   设置集群用户名密码,用户名不建议修改
kubectl create secret -n efk generic elastic-credentials  --from-literal=password=akiraka --from-literal=username=elastic

4.5、部署 es-master 节点

  • 副本数量 3
  • 创建配置文件
  • es-master 节点 PVC 创建 4Gi
  • 安装 Elasticsearch 7.9.1 版本
  • 如果数据持久化 master 也要做持久化否则一旦master与data节点断开 uuid就对不上了
#   下面代码直接复制黏贴即可
cat <<'EOF'> es-master.yaml
---
# 使用镜像
image: "elasticsearch"
# es 集群名称
clusterName: "es-aka"
# es 节点名称
nodeGroup: "master"
# es 节点角色
roles:
  master: "true"
  ingest: "false"
  data: "false"
# 副本数量
replicas: 3
# 资源限制
resources:
  requests:
    cpu: "300m"
    memory: "1Gi"
  limits:
    cpu: "1000m"
    memory: "2Gi"
volumeClaimTemplate:
  # 该volume只能被单个节点以读写的方式映射
  accessModes: [ "ReadWriteOnce" ]
  # 自动绑定动态 pv
  storageClassName: "elastic-nfs-client"
  resources:
    requests:
      storage: 4Gi
#   是否启用 PVC
persistence:
  enabled: true
# 是否 SSH 开启改为 https
protocol: http
# 添加配置
esConfig:
  elasticsearch.yml: |
    xpack.security.enabled: true
    xpack.security.transport.ssl.enabled: true
    xpack.security.transport.ssl.verification_mode: certificate
    xpack.security.transport.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    xpack.security.transport.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    # 是否启用 htpps 启用 head 无法连接,开启还需要将 protocol 修改为 https
    # xpack.security.http.ssl.enabled: true
    # xpack.security.http.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    # xpack.security.http.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
# 环境变量
extraEnvs:
  - name: ELASTIC_PASSWORD
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: password
  - name: ELASTIC_USERNAME
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: username
# 证书
secretMounts:
  - name: elastic-certificates
    secretName: elastic-certificates
    path: /usr/share/elasticsearch/config/certs
EOF

#   helm 部署 es-master 节点并安装指定版本 elasticsearch 7.9.1
helm install es-master -n efk --values es-master.yaml elastic/elasticsearch --version 7.9.1

4.6、部署 es-data 节点

  • 副本数量 3
  • 创建配置文件
  • es-data 节点 PVC 创建 60Gi
  • 安装 Elasticsearch 7.9.1 版本
#   下面代码直接复制黏贴即可
cat <<'EOF'> es-data.yaml
---
# 使用镜像
image: "elasticsearch"
# es 集群名称
clusterName: "es-aka"
# es 节点名称
nodeGroup: "data"
# es 节点角色
roles:
  master: "false"
  ingest: "true"
  data: "true"
# 副本数量
replicas: 3
# 资源限制
resources:
  requests:
    cpu: "300m"
    memory: "1Gi"
  limits:
    cpu: "1000m"
    memory: "2Gi"
# PVC
volumeClaimTemplate:
  # 该volume只能被单个节点以读写的方式映射
  accessModes: [ "ReadWriteOnce" ]
  # 自动绑定动态 pv
  storageClassName: "elastic-nfs-client"
  resources:
    requests:
      storage: 60Gi
# 是否 SSH 开启改为 https
protocol: http
# 添加配置
esConfig:
  elasticsearch.yml: |
    xpack.security.enabled: true
    xpack.security.transport.ssl.enabled: true
    xpack.security.transport.ssl.verification_mode: certificate
    xpack.security.transport.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    xpack.security.transport.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    # 是否启用 htpps 启用 head 无法连接,开启还需要将 protocol 修改为 https
    # xpack.security.http.ssl.enabled: true
    # xpack.security.http.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    # xpack.security.http.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
# 环境变量
extraEnvs:
  - name: ELASTIC_PASSWORD
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: password
  - name: ELASTIC_USERNAME
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: username
# 证书
secretMounts:
  - name: elastic-certificates
    secretName: elastic-certificates
    path: /usr/share/elasticsearch/config/certs
EOF

#   helm 部署 es-data 节点并安装指定版本 elasticsearch 7.9.1
helm install es-data -n efk --values es-data.yaml elastic/elasticsearch --version 7.9.1

4.7、部署 es-client 节点

  • 副本数量 2
  • 创建配置文件
  • es-client 无需创建 PV
  • 安装 Elasticsearch 7.9.1 版本
  • 默认为: NodePort 固定端口: 30920
#   下面代码直接复制黏贴即可
cat <<'EOF'> es-client.yaml
---
# 使用镜像
image: "elasticsearch"
# es 集群名称
clusterName: "es-aka"
# es 节点名称
nodeGroup: "client"
# es 节点角色
roles:
  master: "false"
  ingest: "false"
  data: "false"
# 副本数量
replicas: 2
# 资源限制
resources:
  requests:
    cpu: "300m"
    memory: "1Gi"
  limits:
    cpu: "1000m"
    memory: "2Gi"
#   是否启用 PVC
persistence:
  enabled: false
# 设置 es-clinet 默认为 NodePort
service:
  type: NodePort
  # 设置 NodePort 默认端口
  nodePort: 30920
# 是否 SSH 开启改为 https
protocol: http
# 添加配置
esConfig:
  elasticsearch.yml: |
    xpack.security.enabled: true
    xpack.security.transport.ssl.enabled: true
    xpack.security.transport.ssl.verification_mode: certificate
    xpack.security.transport.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    xpack.security.transport.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    # 是否启用 htpps 启用 head 无法连接,开启还需要将 protocol 修改为 https
    # xpack.security.http.ssl.enabled: true
    # xpack.security.http.ssl.truststore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
    # xpack.security.http.ssl.keystore.path: /usr/share/elasticsearch/config/certs/elastic-certificates.p12
# 环境变量
extraEnvs:
  - name: ELASTIC_PASSWORD
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: password
  - name: ELASTIC_USERNAME
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: username
# 证书
secretMounts:
  - name: elastic-certificates
    secretName: elastic-certificates
    path: /usr/share/elasticsearch/config/certs
EOF

#   helm 部署 es-client 节点并安装指定版本 elasticsearch 7.9.1
helm install es-client -n efk --values es-client.yaml elastic/elasticsearch --version 7.9.1

五、查看 Elasticsearch 部署状态

5.1、查看 Elasticsearch Pv 状态

  • 之前创建的动态 PV 就在这里体现了。
  • 可以看到 PVC 与 PV 均已绑定成功。
[root@Node-01 ~]# kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                               STORAGECLASS     REASON   AGE
pvc-b8d12daf-6ea1-431c-a259-230b5a3c3c08   60Gi       RWO            Retain           Bound    efk/es-aka-data-es-aka-data-0       elastic-nfs-client            3m16s
pvc-ec1e34d2-b732-4959-b1de-57afd32d62d4   60Gi       RWO            Retain           Bound    efk/es-aka-data-es-aka-data-1       elastic-nfs-client            3m16s
pvc-0bc003b3-3cea-4816-8dd2-e264729db108   60Gi       RWO            Retain           Bound    efk/es-aka-data-es-aka-data-2       elastic-nfs-client            3m16s
pvc-6a8725fa-e1c8-415d-802f-49a180f60ed1   4Gi        RWO            Retain           Bound    efk/es-aka-master-es-aka-master-0   elastic-nfs-client            4m56s
pvc-d2384c3b-035b-4bde-8749-96c8ffd68f54   4Gi        RWO            Retain           Bound    efk/es-aka-master-es-aka-master-1   elastic-nfs-client            4m56s
pvc-f28c610a-c709-40e3-b937-42b8ed74b001   4Gi        RWO            Retain           Bound    efk/es-aka-master-es-aka-master-2   elastic-nfs-client            4m55s

5.2、查看 Elasticsearch Pod 状态

  • 2 个 es-master 部署完成
  • 3 个 es-data 部署完成
  • 1 个 es-client 部署完成
[root@Node-01 ~]# kubectl get pods --namespace=efk  -w
NAME              READY   STATUS    RESTARTS   AGE
es-aka-data-0     1/1     Running   0          4m29s
es-aka-data-1     1/1     Running   0          4m29s
es-aka-data-2     1/1     Running   0          4m29s
es-aka-client-0   1/1     Running   0          3m41s
es-aka-client-1   1/1     Running   0          3m41s
es-aka-master-0   1/1     Running   0          6m9s
es-aka-master-1   1/1     Running   0          6m9s
es-aka-master-2   1/1     Running   0          6m9s

5.3、查看 Elasticsearch Svc 状态

  • elasticsearch-client 默认为: NodePort 固定端口: 30920
  • 除 elasticsearch-client 使用 NodePort 其余均为 ClusterIP
[root@Node-01 ~]# kubectl get svc -n efk
NAME                     TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                         AGE
es-aka-client            NodePort    10.1.25.120    <none>        9200:30920/TCP,9300:32696/TCP   4m17s
es-aka-client-headless   ClusterIP   None           <none>        9200/TCP,9300/TCP               4m17s
es-aka-data              ClusterIP   10.1.142.169   <none>        9200/TCP,9300/TCP               5m5s
es-aka-data-headless     ClusterIP   None           <none>        9200/TCP,9300/TCP               5m5s
es-aka-master            ClusterIP   10.1.28.147    <none>        9200/TCP,9300/TCP               6m45s
es-aka-master-headless   ClusterIP   None           <none>        9200/TCP,9300/TCP               6m45s

六、部署 Filebeat

6.1、 添加 Helm Elastic 储存库

  • 项目地址:https://hub.helm.sh/charts/elastic/filebeat
#   添加 helm elastic 储存库
helm repo add elastic https://helm.elastic.co

6.2、使用 helm 安装 Filebeat

  • 安装 Filebeat 7.9.1 版本
  • 需要填写集群账号与密码
cat <<'EOF'> es-filebeat.yaml
# 覆盖资源的全名。如果未设置名称,则默认为 ".Release.Name-.Values.nameOverride or .Chart.Name"
fullnameOverride: filebeat
# 使用镜像
image: "elastic/filebeat"
# 添加配置
filebeatConfig:
  filebeat.yml: |
    filebeat.inputs:
    - type: docker
      containers.ids:
      - '*'
      processors:
      - add_kubernetes_metadata:
          in_cluster: true
    output.elasticsearch:
      # elasticsearch 用户
      username: 'elastic'
      # elasticsearch 密码
      password: 'akiraka'
      # elasticsearch 主机
      hosts: ["es-aka-client:9200"]
# 环境变量
extraEnvs:
  - name: 'ELASTICSEARCH_USERNAME'
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: username
  - name: 'ELASTICSEARCH_PASSWORD'
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: password
EOF

#   helm 安装指定版本 filebeat 7.9.1
helm install filebeat -n efk --values es-filebeat.yaml elastic/filebeat  --version 7.9.1

6.3、查看运行 Filebeat Pod 状态

[root@Node-01 ~]# kubectl get pods --namespace=efk -l app=filebeat-filebeat -w
NAME                      READY   STATUS    RESTARTS   AGE
filebeat-filebeat-7dp29   1/1     Running   0          24s
filebeat-filebeat-rp8kg   1/1     Running   0          24s
filebeat-filebeat-z4wcp   1/1     Running   0          24s

七、部署 Kibana

7.1、 添加 Helm Elastic 储存库

  • 项目地址:https://hub.helm.sh/charts/elastic/kibana
#   添加 helm elastic 储存库
helm repo add elastic https://helm.elastic.co

7.2、使用 helm 安装 Kibana

  • 安装 Kibana 7.9.1 版本
  • 设置 kibana 默认简体中文
  • Kibana 无需填写集群账号与密码
  • service.type 设置为: NodePort
  • service.nodePort 固定端口: 32323
  • elasticsearchHosts 填写集群地址,格式为: http://es-aka-client:9200
cat <<'EOF'> es-kibana.yaml
# 使用镜像
image: "kibana"
# 集群地址
elasticsearchHosts: "http://es-aka-client:9200"
# 添加配置
kibanaConfig:
  kibana.yml: |
    #  设置 kibana 简体中文
    i18n.locale: "zh-CN"
# 否 SSH 开启改为 https 确保集群也是 https
protocol: http
# 服务设置
service:
  type: NodePort
  nodePort: 32323
# 环境变量
extraEnvs:
  - name: 'ELASTICSEARCH_USERNAME'
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: username
  - name: 'ELASTICSEARCH_PASSWORD'
    valueFrom:
      secretKeyRef:
        name: elastic-credentials
        key: password
EOF

#   helm 安装指定版本 kibana 7.9.1
helm install kibana -n efk --values es-kibana.yaml elastic/kibana --version 7.9.1

7.3、查看运行 Kibana Pod 状态

[root@Node-01 ~]# kubectl get pods --namespace=efk -l app=kibana -w
NAME                             READY   STATUS    RESTARTS   AGE
kibana-kibana-6b65b974f5-w2gd6   1/1     Running   0          60s

八、访问仪表盘

8.1、 通过 Elasticsearch Head 访问

  • 其他浏览器我不清楚,Chrome 浏览器扩展商店搜索 ElasticSearch Head 然后安装该扩展
  • 条件已知 elasticsearch-client 使用了 NodePort 端口为: 30920
  • 使用方式: 集群随便一台机器 IP 地址,格式: http://节点IP:30920

Kubernetes(k8s)Helm 部署 EFK 集群-Akiraka

8.2、访问 Kibana 仪表盘

  • Kibana 默认端口为:32323
  • 访问方式: http://集群ip:32323
  • 默认设置中文界面
  • 默认用户与密码为自己设置,我设置
  • 本集群默认用户为: elastic
  • 本集群默认用户为: akiraka

Kubernetes(k8s)Helm 部署 EFK 集群-Akiraka

8.3、创建 Kibana 索引

  • 路径》管理》Kibana》索引模式》创建索引
  • 这里添加 Filebeat 索引

Kubernetes(k8s)Helm 部署 EFK 集群-Akiraka
Kubernetes(k8s)Helm 部署 EFK 集群-Akiraka
Kubernetes(k8s)Helm 部署 EFK 集群-Akiraka

8.4、通过 Kibana 查看 Filebeat 日志

Kubernetes(k8s)Helm 部署 EFK 集群-Akiraka

#docker#EFK#elasticsearch#filebeat#helm#k8s#kibana#kubernetes
3
猜你喜欢
  • Dockerfile 构建 FreeRadis 镜像
  • KeyCloak Docker Compose 部署
  • 密码保护:KeyCloak 结合 Gitlab SSO 一键登录认证
  • Jenkins 构建状态GIF动图
  • Helm 3 内置对象
评论 (54)
请登录以参与评论。
立即登录
  • 匿名

    您好博主,这个efk的f不应该是fluent吗?

    2年前 回复
    • akiraka

      @匿名 可以使用fluent,这个看个人喜好,直接使用fluent还是filebear即可但是会收集一堆日志很难处理如果服务超级多很难分类区分,可能我水平不够吧。我这里使用filebear做演示,fluent没写因为部署一点难度都没有。我是不建议直接部署fluent或者filebeat,可能我喜欢收集我想收集的数据,然后做grfana和kibana处理展示,包括kibana做好仪表盘方便开发快速定位问题。如果这种就需要另外一套方案了,我公司用的filebeat+项目pod做的,我已经写好了 helm 模板,部署很方便

      2年前 回复
    • 阿四

      @akiraka 大佬请问 还需要 kafaka中间吗?传统的架构 需要部署kafaka中间件 使用k8s后还需要吗?

      2年前 回复
    • Akiraka

      @阿四 看业务场景,如果日志量不高也没必要,如果多的话建议使用kafka

      2年前 回复
  • lala

    你好 我安装后No subject alternative DNS name matching elasticsearch-master-headless found.",
    ;报这个错,集群DNS解析式正常的,是创建证书的原因吗

    2年前 回复
    • Akiraka

      @lala 应该是你名称弄的不一样 导致找不到主机名

      2年前 回复
  • buy CBD

    Thanks , I've just been searching for info approximately this
    topic for ages and yours is the best I have came upon so far.

    But, what concerning the bottom line? Are you sure concerning the source?

    1年前 回复
  • buy CBD

    These are really fantastic ideas in on the topic of blogging.
    You have touched some fastidious points here.
    Any way keep up wrinting.

    1年前 回复
  • 飞翔沫沫情

    博主你好,看了你的很多文章 写的都不错 尤其是helm 这块的内容,全网最详细的文章了。 希望能与你共同探讨K8S ,哈哈
    我的博客: https://fxkjnj.com

    1年前 回复
  • -1 OR 2+434-434-1=0+0+0+1 --

    555

    1年前 回复
  • 1

    -1 OR 2+942-942-1=0+0+0+1 --

    1年前 回复
  • n7Dnxc8n

    555

    1年前 回复
  • curry 5

    An fascinating dialogue is price comment. I believe that it's best to write more on this subject, it may not be a taboo subject however typically individuals are not enough to talk on such topics. To the next. Cheers

    10月前 回复
    • Akiraka

      @curry 5 thanks

      9月前 回复
  • curry 6

    very nice submit, i actually love this website, keep on it

    10月前 回复
    • Akiraka

      @curry 6 thanks

      9月前 回复
  • birkin bag

    You must take part in a contest for one of the best blogs on the web. I'll advocate this web site!

    10月前 回复
    • Akiraka

      @birkin bag thanks

      9月前 回复
  • kyrie shoes

    you may have a great weblog here! would you prefer to make some invite posts on my weblog?

    10月前 回复
    • Akiraka

      @kyrie shoes no problem

      9月前 回复
  • lebron 17

    Nice post. I study something more difficult on totally different blogs everyday. It can at all times be stimulating to read content material from other writers and apply slightly something from their store. I抎 want to make use of some with the content material on my weblog whether or not you don抰 mind. Natually I抣l provide you with a hyperlink on your internet blog. Thanks for sharing.

    10月前 回复
    • Akiraka

      @lebron 17 Thanks, no problem

      9月前 回复
  • kobe 11

    Your home is valueble for me. Thanks!?

    10月前 回复
  • jordan 6

    It抯 arduous to seek out knowledgeable individuals on this subject, however you sound like you realize what you抮e talking about! Thanks

    10月前 回复
  • kd shoes

    I was very pleased to seek out this net-site.I wanted to thanks for your time for this glorious read!! I undoubtedly enjoying every little bit of it and I've you bookmarked to check out new stuff you blog post.

    10月前 回复
    • Akiraka

      @kd shoes Thanks for your support

      9月前 回复
  • kd 10

    Aw, this was a really nice post. In thought I would like to put in writing like this moreover ?taking time and actual effort to make an excellent article?but what can I say?I procrastinate alot and not at all appear to get one thing done.

    10月前 回复
  • moncler

    There may be noticeably a bundle to know about this. I assume you made sure nice factors in features also.

    9月前 回复
  • moncler

    Oh my goodness! an amazing article dude. Thanks Nevertheless I'm experiencing problem with ur rss . Don抰 know why Unable to subscribe to it. Is there anybody getting identical rss downside? Anyone who is aware of kindly respond. Thnkx

    9月前 回复
    • Akiraka

      @moncler There seems to be such a problem, I will solve the rss subscription problem.

      9月前 回复
    • Akiraka

      @moncler rss subscription address :http://www.akiraka.net/feed

      9月前 回复
  • chrome hearts store

    It's best to participate in a contest for top-of-the-line blogs on the web. I'll recommend this web site!

    9月前 回复
    • Akiraka

      @chrome hearts store thanks

      9月前 回复
  • kawhi leonard shoes

    There are some attention-grabbing time limits in this article but I don抰 know if I see all of them heart to heart. There may be some validity however I'll take maintain opinion until I look into it further. Good article , thanks and we would like more! Added to FeedBurner as nicely

    9月前 回复
    • Akiraka

      @kawhi leonard shoes thanks

      9月前 回复
  • cbd oil for pain topical cream

    Thank you so much for putting in the time to compose this up, rather useful.

    9月前 回复
  • Tayla

    Howdy! I understand this is sort of off-topic but I needed to
    ask. Does running a well-established website like yours require a
    large amount of work? I am brand new to running a blog but I do write in my diary everyday.

    I'd like to start a blog so I will be able to share my experience and views
    online. Please let me know if you have any recommendations or tips for
    new aspiring bloggers. Thankyou!

    9月前 回复
  • writeablog.net

    Fantastic post however I was wanting to know if you could write a litte more on this subject?

    I'd be very grateful if you could elaborate a little bit
    more. Kudos!

    9月前 回复
    • Akiraka

      @writeablog.net I haven’t had time to organize because I’m busy at work

      9月前 回复
  • cbd oil for pain

    Undeniably believe that which you said. Your favorite justification seemed to
    be on the net the easiest thing to be aware of. I say to you, I
    certainly get annoyed while people consider worries that they plainly do not
    know about. You managed to hit the nail upon the top and also defined out the whole thing without having
    side-effects , people can take a signal. Will probably be back
    to get more. Thanks

    9月前 回复
  • childrens curtain rod finials

    It's wonderful that you are getting ideas from this piece
    of writing as well as from our dialogue made at this place.

    6月前 回复
  • Fidel Eidschun

    Your method of explaining the whole thing in this paragraph is really pleasant, all be capable of simply know it, Thanks a lot.|

    5月前 回复
  • https://www.sfgate.com/market/article/best-cbd-oil-companies-15738194.php

    Excellent blog you have here.. It's difficult to find quality writing
    like yours these days. I seriously appreciate people like you!
    Take care!!

    5月前 回复
  • mail order cannabis for pets

    Wow, wonderful blog structure! How lengthy have you been running a blog for?
    you made blogging look easy. The whole look of your site is excellent, as neatly as the content material!

    5月前 回复
  • www.digitaljournal.com

    WOW just what I was looking for. Came here by searching for property canada

    5月前 回复
  • Robert Zoost Realtor

    Right now it appears like BlogEngine is the preferred
    blogging platform available right now. (from what I've read) Is
    that what you are using on your blog?

    5月前 回复
    • Akiraka

      @Robert Zoost Realtor wordpress

      5月前 回复
  • www.youtube.com

    Today, I went to the beach with my children. I found a
    sea shell and gave it to my 4 year old daughter and said
    "You can hear the ocean if you put this to your ear." She put the shell to her
    ear and screamed. There was a hermit crab inside and it pinched
    her ear. She never wants to go back! LoL I know this is entirely off topic but
    I had to tell someone!

    5月前 回复
  • Rob Ronning

    I'm really enjoying the theme/design of your site.

    Do you ever run into any browser compatibility problems?
    A couple of my blog visitors have complained about my site not
    operating correctly in Explorer but looks great in Firefox.
    Do you have any tips to help fix this issue?

    5月前 回复
    • Akiraka

      @Rob Ronning Try new themes

      5月前 回复
  • bbs.inmeng.cn

    Definitely imagine that that you said. Your favorite justification appeared to be on the web
    the simplest thing to take into account of. I say to you,
    I certainly get irked whilst people consider worries that they
    plainly do not recognize about. You controlled to hit the nail upon the top
    as smartly as defined out the entire thing without having side-effects , people could
    take a signal. Will likely be again to get more. Thanks

    5月前 回复
  • https://www.undrtone.com/robertzoost

    At this time it appears like Drupal is the best blogging
    platform available right now. (from what I've read) Is
    that what you're using on your blog?

    5月前 回复
    • Akiraka

      @https://www.undrtone.com/robertzoost wordpress

      5月前 回复
Akiraka
站长
本人擅长 Ai、Au、Fl、Ae、Pr、Ps 等软件的安装与卸载,精通 CSS、JavaScript、PHP、Python、Shell、Go 等单词的拼写,熟悉 Windows、Linux、Mac、Android、IOS 等系统的开关机!
158
文章
24
评论
73
获赞
Popular Articles
TOP1
Kubernetes(k8s)Helm 部署 EFK 集群
2年前
TOP2
Kubernetes(k8s)helm 搭建 prometheus + Grafana 监控
2年前
TOP3
Kubernetes(k8s)Helm 部署 Jenkins 持续化集成部署
2年前
TOP4
Container 命令ctr、crictl 命令使用说明
10月前
TOP5
Elasticsearch X-Pack 插件破解
2年前
Related Articles
密码保护:Kubernetes中容器Nginx动态解析
12月前
存活探针(Liveness)、就绪探针(Readiness)、启动探针(Startup)、容器钩子
1年前
Kubernetes(k8s) 清理删除未被使用的镜像
2年前
GO生成指定长度的随机字符串
1年前
Dockerfile 构建 FreeRadis 镜像
6天前
Copyright © 2019-2022 Akiraka. 沪18036911号