美文网首页
kubernetes fluentd-elasticsearch

kubernetes fluentd-elasticsearch

作者: 潘猛_9f76 | 来源:发表于2019-09-27 08:26 被阅读0次
部署

现在位置
https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch
下载并部署

#mkdir fluentd-elasticsearch
#cd fluentd-elasticsearch
#wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/fluentd-elasticsearch/es-service.yaml
#wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/fluentd-elasticsearch/es-statefulset.yaml
#wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/fluentd-elasticsearch/fluentd-es-configmap.yaml 
#wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/fluentd-elasticsearch/kibana-deployment.yaml    
#wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/fluentd-elasticsearch/kibana-service.yaml   
#wget https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/fluentd-elasticsearch/fluentd-es-ds.yaml

修改kibana-deployment.yaml,注销变量SERVER_BASEPATH,增加--allow-root参数

apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
        env:
   #       - name: SERVER_BASEPATH
   #         value: /api/v1/namespaces/kube-system/services/kibana-logging/proxy
        command:
          - "/usr/local/bin/kibana-docker"
          - "--allow-root"

修改kibana-service.yaml,增加nodePort的配置

apiVersion: v1
kind: Service
metadata:
spec:
  ports:
  - port: 5601
    protocol: TCP
    targetPort: ui
    nodePort: 30601
  type: NodePort

修改es-service.yaml ,增加nodePort的配置

apiVersion: v1
kind: Service
metadata:
spec:
  ports:
  - port: 9200
    protocol: TCP
    targetPort: db
    nodePort: 30602
  type: NodePort

部署清单中的对象

#kubectl apply -f .
service/elasticsearch-logging created
serviceaccount/elasticsearch-logging created
clusterrole.rbac.authorization.k8s.io/elasticsearch-logging created
clusterrolebinding.rbac.authorization.k8s.io/elasticsearch-logging created
statefulset.apps/elasticsearch-logging created
configmap/fluentd-es-config-v0.2.0 created
deployment.apps/kibana-logging created
service/kibana-logging created
验证

打开kibana的网页


image.png

打开es的网页


image.png
创建索引
image.png image.png image.png
image.png

相关文章

网友评论

      本文标题:kubernetes fluentd-elasticsearch

      本文链接:https://www.haomeiwen.com/subject/tkrnectx.html