2017-05-17 17:04:46 +08:00
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: filebeat-test
|
|
|
|
namespace: default
|
|
|
|
spec:
|
|
|
|
replicas: 3
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: filebeat-test
|
|
|
|
spec:
|
|
|
|
containers:
|
2018-05-04 19:48:54 +08:00
|
|
|
- image: harbor-001.jimmysong.io/library/filebeat:5.4.0
|
2017-05-17 17:04:46 +08:00
|
|
|
name: filebeat
|
|
|
|
volumeMounts:
|
|
|
|
- name: app-logs
|
|
|
|
mountPath: /log
|
|
|
|
- name: filebeat-config
|
|
|
|
mountPath: /etc/filebeat/
|
2018-05-04 19:48:54 +08:00
|
|
|
- image: harbor-001.jimmysong.io/library/analytics-docker-test:Build_8
|
2017-05-17 17:04:46 +08:00
|
|
|
name : app
|
|
|
|
ports:
|
|
|
|
- containerPort: 80
|
|
|
|
volumeMounts:
|
|
|
|
- name: app-logs
|
|
|
|
mountPath: /usr/local/TalkingData/logs
|
|
|
|
volumes:
|
|
|
|
- name: app-logs
|
|
|
|
emptyDir: {}
|
|
|
|
- name: filebeat-config
|
|
|
|
configMap:
|
|
|
|
name: filebeat-config
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: filebeat-test
|
|
|
|
labels:
|
|
|
|
app: filebeat-test
|
|
|
|
spec:
|
|
|
|
ports:
|
|
|
|
- port: 80
|
|
|
|
protocol: TCP
|
|
|
|
name: http
|
|
|
|
selector:
|
2017-07-18 22:22:27 +08:00
|
|
|
k8s-app: filebeat-test
|
2017-05-17 17:04:46 +08:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: filebeat-config
|
|
|
|
data:
|
|
|
|
filebeat.yml: |
|
|
|
|
filebeat.prospectors:
|
|
|
|
- input_type: log
|
|
|
|
paths:
|
|
|
|
- "/log/*"
|
|
|
|
- "/log/usermange/common/*"
|
|
|
|
output.elasticsearch:
|
|
|
|
hosts: ["172.23.5.255:9200"]
|
2017-06-28 16:56:34 +08:00
|
|
|
username: "elastic"
|
|
|
|
password: "changeme"
|
|
|
|
index: "filebeat-test"
|