-
Notifications
You must be signed in to change notification settings - Fork 29
/
efk.yaml
330 lines (330 loc) · 8.11 KB
/
efk.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: fluent-bit
release: efk
name: efk-fluent-bit
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: fluent-bit
release: efk
name: efk-fluent-bit
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: fluent-bit
release: efk
name: efk-fluent-bit
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: efk-fluent-bit
subjects:
- kind: ServiceAccount
name: efk-fluent-bit
namespace: default
---
apiVersion: v1
data:
action_file.yml: |-
---
actions:
1:
action: delete_indices
description: "Clean up ES by deleting old indices"
options:
timeout_override:
continue_if_exception: False
disable_action: False
ignore_empty_list: True
filters:
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 7
field:
stats_result:
epoch:
exclude: False
config.yml: "client:\n hosts: \n - elasticsearch-efk-cluster \n port: 9200\n"
kind: ConfigMap
metadata:
labels:
app: elasticsearch-curator
release: efk
name: efk-elasticsearch-curator-config
---
apiVersion: v1
data:
fluent-bit-filter.conf: "[FILTER]\n Name kubernetes\n Match
\ kube.*\n Kube_URL https://kubernetes.default.svc:443\n
\ Kube_CA_File /var/run/secrets/kubernetes.io/serviceaccount/ca.crt\n
\ Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token\n
\ Merge_Log On\n K8S-Logging.Parser On\n K8S-Logging.Exclude
On\n "
fluent-bit-input.conf: "[INPUT]\n Name tail\n Path /var/log/containers/*.log\n
\ Parser docker\n Tag kube.*\n Refresh_Interval
5\n Mem_Buf_Limit 5MB\n Skip_Long_Lines On\n "
fluent-bit-output.conf: "\n[OUTPUT]\n Name es\n Match *\n Host elasticsearch-efk-cluster\n
\ Port 9200\n Logstash_Format On\n Retry_Limit False\n Type flb_type\n
\ Time_Key @timestamp\n Replace_Dots On\n Logstash_Prefix kubernetes_cluster\n\n\n\n
\ "
fluent-bit-service.conf: |-
[SERVICE]
Flush 1
Daemon Off
Log_Level info
Parsers_File parsers.conf
fluent-bit.conf: |-
@INCLUDE fluent-bit-service.conf
@INCLUDE fluent-bit-input.conf
@INCLUDE fluent-bit-filter.conf
@INCLUDE fluent-bit-output.conf
parsers.conf: ""
kind: ConfigMap
metadata:
labels:
app: fluent-bit
release: efk
name: efk-fluent-bit-config
---
apiVersion: v1
data:
kibana.yml: |
elasticsearch.url: http://elasticsearch:9200
server.host: "0"
server.name: kibana
kind: ConfigMap
metadata:
labels:
app: kibana
release: efk
name: efk-kibana
---
apiVersion: v1
data:
es-tls-ca.crt: ""
kind: Secret
metadata:
labels:
app: fluent-bit
release: efk
name: efk-fluent-bit-es-tls-secret
type: Opaque
---
apiVersion: v1
kind: Service
metadata:
labels:
app: kibana
release: efk
name: efk-kibana
spec:
ports:
- port: 443
protocol: TCP
targetPort: 5601
selector:
app: kibana
release: efk
type: ClusterIP
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
labels:
app: kibana
release: efk
name: efk-kibana
spec:
replicas: 1
revisionHistoryLimit: 3
template:
metadata:
annotations:
checksum/config: dae06a930c445e7ddb2e20e22e7bb0b5b06e999d09ca341da391631eebabb4a5
labels:
app: kibana
release: efk
spec:
containers:
- env:
- name: ELASTICSEARCH_URL
value: http://elasticsearch-efk-cluster:9200
- name: LOGGING_VERBOSE
value: "true"
- name: SERVER_DEFAULTROUTE
value: /app/kibana
- name: SERVER_PORT
value: "5601"
image: docker.elastic.co/kibana/kibana-oss:6.4.2
imagePullPolicy: IfNotPresent
name: kibana
ports:
- containerPort: 5601
name: kibana
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /usr/share/kibana/config/kibana.yml
name: kibana
subPath: kibana.yml
serviceAccountName: default
tolerations: []
volumes:
- configMap:
name: efk-kibana
name: kibana
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
labels:
app: elasticsearch-curator
release: efk
name: efk-elasticsearch-curator
spec:
jobTemplate:
metadata:
labels:
app: elasticsearch-curator
release: efk
spec:
template:
metadata:
labels:
app: elasticsearch-curator
release: efk
spec:
containers:
- args:
- --config
- /etc/es-curator/config.yml
- /etc/es-curator/action_file.yml
command:
- curator
image: quay.io/pires/docker-elasticsearch-curator:5.5.4
imagePullPolicy: IfNotPresent
name: elasticsearch-curator
resources: {}
volumeMounts:
- mountPath: /etc/es-curator
name: config-volume
restartPolicy: Never
volumes:
- configMap:
name: efk-elasticsearch-curator-config
name: config-volume
schedule: 0 1 * * *
---
apiVersion: enterprises.upmc.com/v1
kind: ElasticsearchCluster
metadata:
labels:
app: elasticsearch
chart: elasticsearch-0.1.6
heritage: Tiller
release: efk
name: efk-cluster
spec:
client-java-options: -Xms1024m -Xmx1024m
client-node-replicas: 1
data-java-options: -Xms2048m -Xmx2048m
data-node-replicas: 1
data-volume-size: 10Gi
elastic-search-image: quay.io/pires/docker-elasticsearch-kubernetes:6.4.2
master-java-options: -Xms2048m -Xmx2048m
master-node-replicas: 1
network-host: 0.0.0.0
resources:
limits:
cpu: "1"
memory: 2048Mi
requests:
cpu: 200m
memory: 1024Mi
snapshot:
bucketName: elasticsnapshots
enabled: false
schedule: '@every 2m'
storage:
classProvisioner: volume.alpha.kubernetes.io/storage-class
reclaimPolicy: Delete
type: gp2
use-ssl: false
zones: []
---
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
app: fluent-bit
release: efk
name: fluent-bit
spec:
template:
metadata:
annotations:
checksum/config: 095b355883b73366c561bc1b977da84a373225d68ee0251cafc47a2d195902f5
labels:
app: fluent-bit
release: efk
spec:
containers:
- env: []
image: fluent/fluent-bit:1.0.4
imagePullPolicy: Always
name: fluent-bit
resources: {}
volumeMounts:
- mountPath: /var/log
name: varlog
- mountPath: /var/lib/docker/containers
name: varlibdockercontainers
readOnly: true
- mountPath: /fluent-bit/etc/fluent-bit.conf
name: config
subPath: fluent-bit.conf
- mountPath: /fluent-bit/etc/fluent-bit-service.conf
name: config
subPath: fluent-bit-service.conf
- mountPath: /fluent-bit/etc/fluent-bit-input.conf
name: config
subPath: fluent-bit-input.conf
- mountPath: /fluent-bit/etc/fluent-bit-filter.conf
name: config
subPath: fluent-bit-filter.conf
- mountPath: /fluent-bit/etc/fluent-bit-output.conf
name: config
subPath: fluent-bit-output.conf
dnsPolicy: ClusterFirst
hostNetwork: false
serviceAccountName: efk-fluent-bit
terminationGracePeriodSeconds: 10
volumes:
- hostPath:
path: /var/log
name: varlog
- hostPath:
path: /var/lib/docker/containers
name: varlibdockercontainers
- configMap:
name: efk-fluent-bit-config
name: config
updateStrategy:
type: RollingUpdate