部署
现在位置
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
网友评论