-
Notifications
You must be signed in to change notification settings - Fork 2
/
fluentd.yaml
117 lines (117 loc) · 2.87 KB
/
fluentd.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
kind: ConfigMap
apiVersion: v1
metadata:
name: efk-fluentd-config
namespace: logging
data:
forward.input.conf: |-
# Takes the messages sent over TCP
<source>
@id fluentd-containers.log
@type tail
path /var/log/containers/*_default_*.log
exclude_path ["/var/log/containers/fluentd*"]
pos_file /var/log/es-containers.log.pos
<parse>
@type regexp
expression /^(\<time>[^ ]\+) (?<stream>stdout|stderr) (?<flags>[^ ]+) (?<message>.*)$/
time_format %Y-%m-%dT%H:%M:%S.%3N:%Z
</parse>
tag raw.kubernetes.*
read_from_head false
</source>
output.conf: |-
<match **>
@type elasticsearch
@log_level info
include_tag_key true
host "efk-es-http.logging.svc.cluster.local"
port 9200
user "elastic"
password "Your Password Here"
scheme https
ssl_verify false
ssl_version TLSv1_2
logstash_format false
# Set the chunk limits.
buffer_chunk_limit 2M
buffer_queue_limit 8
flush_interval 5s
# Never wait longer than 5 minutes between retries.
max_retry_wait 30
# Disable the limit on the number of retries (retry forever).
disable_retry_limit
# Use multiple threads for processing.
num_threads 2
reload_connections false
reconnect_on_error true
reload_on_failure true
</match>
---
apiVersion: v1
kind: Service
metadata:
name: efk-fluentd
namespace: logging
labels:
app: efk-fluentd
spec:
selector:
app: efk-fluentd
ports:
- name: fluentd-tcp
port: 24224
protocol: TCP
targetPort: 24224
- name: fluentd-udp
port: 24224
protocol: UDP
targetPort: 24224
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: efk-fluentd
namespace: logging
labels:
app: efk-fluentd
spec:
selector:
matchLabels:
app: efk-fluentd
template:
metadata:
labels:
app: efk-fluentd
spec:
containers:
- name: efk-fluentd
image: quay.io/fluentd_elasticsearch/fluentd:v3.0.2
env:
- name: FLUENTD_ARGS
value: --no-supervisor -q
resources:
limits:
memory: 500Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
- name: config-volume
mountPath: /etc/fluent/config.d
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: config-volume
configMap:
name: efk-fluentd-config