-
Notifications
You must be signed in to change notification settings - Fork 35
/
fluentd-indexer.yaml
106 lines (102 loc) · 2.25 KB
/
fluentd-indexer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-indexer-config
namespace: logging
data:
fluentd-indexer.conf: |
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<filter nginx.access>
@type parser
key_name message
remove_key_name_field false
<parse>
@type nginx
</parse>
</filter>
<match nginx.access>
@id elasticsearch
@type elasticsearch
@log_level info
include_tag_key true
host elasticsearch-logging.logging
port 9200
logstash_format true
logstash_prefix k8s-logging-efk
logstash_dateformat %Y.%m.%d
<buffer>
@type file
path /fluentd/log/fluentd-buffers/indexer.system.buffer
flush_mode interval
retry_type exponential_backoff
flush_thread_count 2
flush_interval 5s
retry_forever
retry_max_interval 30
chunk_limit_size 2M
queue_limit_length 8
overflow_action block
</buffer>
</match>
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: fluentd-indexer
namespace: logging
labels:
k8s-app: fluentd-indexer
spec:
replicas: 1
selector:
matchLabels:
k8s-app: fluentd-indexer
template:
metadata:
labels:
k8s-app: fluentd-indexer
spec:
containers:
- name: fluentd-indexer
image: registry.cn-shanghai.aliyuncs.com/k8s-log/fluentd:v1.2-debian
# imagePullPolicy: Always
env:
- name: FLUENTD_CONF
value: "fluentd-indexer.conf"
ports:
- name: indexer
containerPort: 24224
protocol: TCP
readinessProbe:
tcpSocket:
port: 24224
initialDelaySeconds: 30
timeoutSeconds: 5
periodSeconds: 3
volumeMounts:
- name: fluentd-indexer-config
mountPath: /fluentd/etc/
volumes:
- name: fluentd-indexer-config
configMap:
name: fluentd-indexer-config
---
apiVersion: v1
kind: Service
metadata:
name: fluentd-indexer
namespace: logging
labels:
k8s-app: fluentd-indexer
spec:
ports:
- name: indexer
port: 24224
protocol: TCP
targetPort: indexer
selector:
k8s-app: fluentd-indexer