2020-08-14 22:02:30 +00:00
|
|
|
# use this for backwards compatability
|
2020-08-13 18:44:50 +00:00
|
|
|
# fullnameOverride: ""
|
2020-08-11 14:09:48 +00:00
|
|
|
|
2020-11-21 12:24:57 +00:00
|
|
|
eck-operator:
|
|
|
|
enabled: false
|
|
|
|
tolerations:
|
|
|
|
- key: node-role.kubernetes.io/master
|
|
|
|
effect: NoSchedule
|
|
|
|
nodeSelector:
|
|
|
|
node-role.kubernetes.io/master: ""
|
|
|
|
|
2020-08-11 14:09:48 +00:00
|
|
|
# Version for ElasticSearch and Kibana have to match so we define it at top-level
|
2020-11-21 12:24:57 +00:00
|
|
|
version: 7.10.0
|
2020-08-11 14:09:48 +00:00
|
|
|
|
2020-08-15 13:25:07 +00:00
|
|
|
elastic_password: "" # super_secret_elastic_password
|
|
|
|
|
2020-08-11 14:09:48 +00:00
|
|
|
es:
|
|
|
|
nodeSets: []
|
|
|
|
#- count: 2
|
|
|
|
# storage:
|
|
|
|
# size: 16Gi
|
|
|
|
# class: local-sc-xfs
|
|
|
|
# zone: us-west-2a
|
2020-08-13 18:44:50 +00:00
|
|
|
s3Snapshot:
|
|
|
|
enabled: false
|
|
|
|
iamrole: "" # INSERT_CLOUDFORMATION_OUTPUT_ElasticSearchSnapshots
|
2020-08-11 14:09:48 +00:00
|
|
|
|
2020-08-13 18:44:50 +00:00
|
|
|
prometheus: false
|
|
|
|
|
2020-08-11 14:09:48 +00:00
|
|
|
kibana:
|
2020-08-14 14:52:10 +00:00
|
|
|
count: 1
|
2020-08-11 14:09:48 +00:00
|
|
|
#servicename: kibana.example.com
|
|
|
|
istio:
|
|
|
|
enabled: false
|
|
|
|
gateway: "istio-system/ingressgateway"
|
|
|
|
url: "" # kibana.example.com
|
2020-08-18 10:34:34 +00:00
|
|
|
|
|
|
|
fluentd:
|
|
|
|
enabled: false
|
2020-08-23 16:41:37 +00:00
|
|
|
image:
|
|
|
|
repository: quay.io/fluentd_elasticsearch/fluentd
|
2020-10-01 19:32:21 +00:00
|
|
|
tag: v2.9.0
|
2020-08-18 10:34:34 +00:00
|
|
|
istio:
|
|
|
|
enabled: false
|
|
|
|
|
2020-08-18 10:41:09 +00:00
|
|
|
# broken as of 2.5.1 ;-(
|
|
|
|
# useStatefulSet: true
|
2020-08-18 10:34:34 +00:00
|
|
|
replicaCount: 2
|
|
|
|
|
|
|
|
plugins:
|
2020-08-18 11:36:56 +00:00
|
|
|
enabled: false
|
2020-08-18 10:34:34 +00:00
|
|
|
pluginsList:
|
2020-08-18 11:36:56 +00:00
|
|
|
#- fluent-plugin-detect-exceptions
|
|
|
|
#- fluent-plugin-s3
|
|
|
|
#- fluent-plugin-grok-parser
|
2020-08-18 10:34:34 +00:00
|
|
|
|
2020-08-18 11:08:49 +00:00
|
|
|
#persistence:
|
|
|
|
# enabled: true
|
|
|
|
# storageClass: "ebs-sc-gp2-xfs"
|
|
|
|
# accessMode: ReadWriteOnce
|
|
|
|
# size: 4Gi
|
2020-08-18 10:34:34 +00:00
|
|
|
|
|
|
|
service:
|
|
|
|
ports:
|
|
|
|
- name: tcp-forward
|
|
|
|
protocol: TCP
|
|
|
|
containerPort: 24224
|
|
|
|
- name: http-fluentd
|
|
|
|
protocol: TCP
|
|
|
|
containerPort: 9880
|
|
|
|
|
|
|
|
metrics:
|
|
|
|
enabled: false
|
|
|
|
serviceMonitor:
|
|
|
|
enabled: true
|
|
|
|
additionalLabels:
|
|
|
|
release: metrics
|
2020-11-21 12:24:57 +00:00
|
|
|
# namespace: monitoring
|
2020-08-18 10:34:34 +00:00
|
|
|
|
|
|
|
output:
|
2020-09-18 15:12:52 +00:00
|
|
|
# Default should be "logging-kubezero-logging-es-http" if fullnameOverride is NOT used
|
2020-08-18 10:34:34 +00:00
|
|
|
host: logging-es-http
|
|
|
|
|
2020-08-18 10:58:37 +00:00
|
|
|
shared_key: "cloudbender"
|
|
|
|
|
2020-08-18 10:34:34 +00:00
|
|
|
env:
|
|
|
|
OUTPUT_USER: elastic
|
|
|
|
OUTPUT_SSL_VERIFY: "false"
|
|
|
|
|
2020-09-18 15:12:52 +00:00
|
|
|
# Same here the secret names change if fullnameOverride is not used !!
|
2020-08-18 10:34:34 +00:00
|
|
|
extraEnvVars:
|
|
|
|
- name: OUTPUT_PASSWORD
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: logging-es-elastic-user
|
|
|
|
key: elastic
|
|
|
|
- name: FLUENTD_SHARED_KEY
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
2020-08-18 10:58:37 +00:00
|
|
|
name: logging-fluentd-secret
|
2020-08-18 10:34:34 +00:00
|
|
|
key: shared_key
|
|
|
|
|
|
|
|
configMaps:
|
2020-10-02 21:41:40 +00:00
|
|
|
general.conf: |
|
|
|
|
<label @FLUENT_LOG>
|
2020-10-02 21:46:07 +00:00
|
|
|
<match **>
|
|
|
|
@type null
|
|
|
|
</match>
|
2020-10-02 21:41:40 +00:00
|
|
|
</label>
|
|
|
|
<source>
|
|
|
|
@type http
|
|
|
|
port 9880
|
|
|
|
bind 0.0.0.0
|
|
|
|
keepalive_timeout 30
|
|
|
|
</source>
|
|
|
|
<source>
|
|
|
|
@type monitor_agent
|
|
|
|
bind 0.0.0.0
|
|
|
|
port 24220
|
|
|
|
tag fluentd.monitor.metrics
|
|
|
|
</source>
|
|
|
|
|
2020-08-18 10:34:34 +00:00
|
|
|
forward-input.conf: |
|
|
|
|
<source>
|
|
|
|
@type forward
|
|
|
|
port 24224
|
|
|
|
bind 0.0.0.0
|
|
|
|
skip_invalid_event true
|
2020-10-05 10:50:23 +00:00
|
|
|
send_keepalive_packet true
|
2020-08-18 10:34:34 +00:00
|
|
|
<security>
|
|
|
|
self_hostname "#{ENV['HOSTNAME']}"
|
|
|
|
shared_key "#{ENV['FLUENTD_SHARED_KEY']}"
|
|
|
|
</security>
|
|
|
|
</source>
|
|
|
|
|
|
|
|
output.conf: |
|
|
|
|
<match **>
|
|
|
|
@id elasticsearch
|
|
|
|
@type elasticsearch
|
|
|
|
@log_level info
|
|
|
|
include_tag_key true
|
|
|
|
id_key id
|
|
|
|
remove_keys id
|
|
|
|
|
2020-08-22 17:27:18 +00:00
|
|
|
# KubeZero pipeline incl. GeoIP etc.
|
2020-09-28 11:54:47 +00:00
|
|
|
# pipeline fluentd
|
2020-08-18 10:34:34 +00:00
|
|
|
|
|
|
|
host "#{ENV['OUTPUT_HOST']}"
|
|
|
|
port "#{ENV['OUTPUT_PORT']}"
|
|
|
|
scheme "#{ENV['OUTPUT_SCHEME']}"
|
|
|
|
ssl_version "#{ENV['OUTPUT_SSL_VERSION']}"
|
|
|
|
ssl_verify "#{ENV['OUTPUT_SSL_VERIFY']}"
|
|
|
|
user "#{ENV['OUTPUT_USER']}"
|
|
|
|
password "#{ENV['OUTPUT_PASSWORD']}"
|
|
|
|
|
2020-08-26 17:13:21 +00:00
|
|
|
log_es_400_reason
|
2020-08-18 10:34:34 +00:00
|
|
|
logstash_format true
|
|
|
|
reconnect_on_error true
|
2020-08-26 17:13:21 +00:00
|
|
|
# reload_on_failure true
|
|
|
|
request_timeout 15s
|
2020-08-23 16:41:37 +00:00
|
|
|
suppress_type_name true
|
2020-08-18 10:34:34 +00:00
|
|
|
|
2020-10-01 17:11:48 +00:00
|
|
|
<buffer tag>
|
|
|
|
@type file_single
|
2020-08-18 10:34:34 +00:00
|
|
|
path /var/log/fluentd-buffers/kubernetes.system.buffer
|
|
|
|
flush_mode interval
|
|
|
|
flush_thread_count 2
|
2020-08-27 00:13:34 +00:00
|
|
|
flush_interval 30s
|
2020-08-18 10:34:34 +00:00
|
|
|
flush_at_shutdown true
|
|
|
|
retry_type exponential_backoff
|
|
|
|
retry_timeout 60m
|
|
|
|
overflow_action drop_oldest_chunk
|
|
|
|
</buffer>
|
|
|
|
</match>
|
|
|
|
|
2020-09-08 14:05:31 +00:00
|
|
|
filter.conf: |
|
2020-10-02 21:41:40 +00:00
|
|
|
<filter disabled.kube.**>
|
2020-09-08 14:07:17 +00:00
|
|
|
@type parser
|
2020-09-08 14:05:31 +00:00
|
|
|
key_name message
|
|
|
|
remove_key_name_field true
|
2020-09-08 14:41:20 +00:00
|
|
|
reserve_data true
|
2020-10-05 16:01:50 +00:00
|
|
|
reserve_time true
|
2020-10-02 21:41:40 +00:00
|
|
|
# inject_key_prefix message_json.
|
2020-09-08 14:34:16 +00:00
|
|
|
emit_invalid_record_to_error false
|
2020-09-08 14:05:31 +00:00
|
|
|
<parse>
|
|
|
|
@type json
|
|
|
|
</parse>
|
|
|
|
</filter>
|
|
|
|
|
2020-08-22 17:27:18 +00:00
|
|
|
fluent-bit:
|
2020-08-23 16:41:37 +00:00
|
|
|
enabled: false
|
2020-08-22 17:27:18 +00:00
|
|
|
test:
|
|
|
|
enabled: false
|
|
|
|
|
|
|
|
config:
|
|
|
|
outputs: |
|
|
|
|
[OUTPUT]
|
2020-10-05 16:03:47 +00:00
|
|
|
Match *
|
|
|
|
Name forward
|
|
|
|
Host logging-fluentd
|
|
|
|
Port 24224
|
|
|
|
Shared_Key cloudbender
|
|
|
|
Send_options true
|
|
|
|
Require_ack_response true
|
2020-10-05 16:01:50 +00:00
|
|
|
|
|
|
|
customParsers: |
|
|
|
|
[PARSER]
|
2020-10-05 16:03:47 +00:00
|
|
|
Name cri-log
|
|
|
|
Format regex
|
|
|
|
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<log>.*)$
|
|
|
|
Time_Key time
|
|
|
|
Time_Format %Y-%m-%dT%H:%M:%S.%L%z
|
2020-08-22 17:27:18 +00:00
|
|
|
|
|
|
|
inputs: |
|
|
|
|
[INPUT]
|
|
|
|
Name tail
|
|
|
|
Path /var/log/containers/*.log
|
2020-10-05 16:01:50 +00:00
|
|
|
Parser cri-log
|
2020-10-06 00:27:58 +00:00
|
|
|
Tag cri.*
|
2020-10-02 21:41:40 +00:00
|
|
|
Mem_Buf_Limit 16MB
|
2020-08-22 17:27:18 +00:00
|
|
|
Skip_Long_Lines On
|
|
|
|
Refresh_Interval 10
|
|
|
|
DB /var/log/flb_kube.db
|
|
|
|
DB.Sync Normal
|
|
|
|
|
|
|
|
filters: |
|
2020-09-08 12:12:21 +00:00
|
|
|
[FILTER]
|
|
|
|
Name lua
|
2020-10-06 00:27:58 +00:00
|
|
|
Match cri.*
|
2020-09-08 12:12:21 +00:00
|
|
|
script /fluent-bit/etc/functions.lua
|
|
|
|
call reassemble_cri_logs
|
|
|
|
|
2020-08-22 17:27:18 +00:00
|
|
|
[FILTER]
|
|
|
|
Name kubernetes
|
2020-10-06 00:27:58 +00:00
|
|
|
Match cri.*
|
2020-08-22 17:27:18 +00:00
|
|
|
Merge_Log On
|
2020-10-06 00:27:58 +00:00
|
|
|
Merge_Log_Key kube
|
|
|
|
Kube_Tag_Prefix cri.var.log.containers.
|
2020-08-22 17:27:18 +00:00
|
|
|
Keep_Log Off
|
2020-10-05 16:01:50 +00:00
|
|
|
K8S-Logging.Parser Off
|
|
|
|
K8S-Logging.Exclude Off
|
2020-08-22 17:27:18 +00:00
|
|
|
|
2020-10-06 00:27:58 +00:00
|
|
|
[FILTER]
|
|
|
|
Name rewrite_tag
|
|
|
|
Match cri.*
|
|
|
|
Emitter_Name kube_tag_rewriter
|
|
|
|
Rule logtag F kube.$kubernetes['namespace_name'].$kubernetes['container_name'] false
|
2020-08-22 17:27:18 +00:00
|
|
|
|
2020-10-07 16:09:24 +00:00
|
|
|
[FILTER]
|
|
|
|
Name lua
|
|
|
|
Match kube.*
|
|
|
|
script /fluent-bit/etc/functions.lua
|
|
|
|
call nest_k8s_ns
|
2020-10-07 16:11:22 +00:00
|
|
|
|
2020-08-22 17:27:18 +00:00
|
|
|
service: |
|
|
|
|
[SERVICE]
|
2020-10-06 00:27:58 +00:00
|
|
|
Flush 1
|
2020-08-22 17:27:18 +00:00
|
|
|
Daemon Off
|
|
|
|
Log_Level warn
|
|
|
|
Parsers_File parsers.conf
|
|
|
|
Parsers_File custom_parsers.conf
|
|
|
|
HTTP_Server On
|
|
|
|
HTTP_Listen 0.0.0.0
|
|
|
|
HTTP_Port 2020
|
|
|
|
|
|
|
|
lua: |
|
2020-09-08 12:12:21 +00:00
|
|
|
local reassemble_state = {}
|
|
|
|
|
|
|
|
function reassemble_cri_logs(tag, timestamp, record)
|
|
|
|
local reassemble_key = tag
|
|
|
|
if record.logtag == 'P' then
|
2020-10-05 16:01:50 +00:00
|
|
|
reassemble_state[reassemble_key] = reassemble_state[reassemble_key] or "" .. record.log
|
2020-09-08 12:12:21 +00:00
|
|
|
return -1, 0, 0
|
|
|
|
end
|
2020-10-05 16:01:50 +00:00
|
|
|
record.log = reassemble_state[reassemble_key] or "" .. (record.log or "")
|
2020-09-08 12:12:21 +00:00
|
|
|
reassemble_state[reassemble_key] = nil
|
|
|
|
return 1, timestamp, record
|
|
|
|
end
|
|
|
|
|
2020-10-07 16:09:24 +00:00
|
|
|
function nest_k8s_ns(tag, timestamp, record)
|
|
|
|
if not record['kubernetes']['namespace_name'] then
|
|
|
|
return 0, 0, 0
|
|
|
|
end
|
|
|
|
new_record = {}
|
|
|
|
for key, val in pairs(record) do
|
|
|
|
if key == 'kube' then
|
|
|
|
new_record[key] = {}
|
|
|
|
new_record[key][record['kubernetes']['namespace_name']] = record[key]
|
|
|
|
else
|
|
|
|
new_record[key] = record[key]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return 1, timestamp, new_record
|
|
|
|
end
|
|
|
|
|
2020-08-22 17:27:18 +00:00
|
|
|
serviceMonitor:
|
|
|
|
enabled: true
|
|
|
|
namespace: monitoring
|
|
|
|
selector:
|
|
|
|
release: metrics
|
|
|
|
|
|
|
|
tolerations:
|
|
|
|
- key: node-role.kubernetes.io/master
|
|
|
|
effect: NoSchedule
|