Merge pull request #58525 from monotek/fluentd-1.1.0

Automatic merge from submit-queue (batch tested with PRs 56206, 58525). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

updates fluentd in fluentd-es-image to fluentd 1.1.0

**What this PR does / why we need it**: Updates fluentd in fluentd-es-image to fluentd 1.1.0.

Its also needed to be able to use the new fluentd-elasticsearch helm chart from: https://github.com/kubernetes/charts/pull/3379


**Release note**:
```release-note
updates fluentd in fluentd-es-image to fluentd 1.1.0
```
This commit is contained in:
Kubernetes Submit Queue 2018-01-23 13:17:34 -08:00 committed by GitHub
commit 5b9ba2f647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 111 additions and 67 deletions

View File

@ -1,6 +1,16 @@
kind: ConfigMap kind: ConfigMap
apiVersion: v1 apiVersion: v1
metadata:
name: fluentd-es-config-v0.1.3
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile
data: data:
system.conf: |-
<system>
root_dir /tmp/fluentd-buffers/
</system>
containers.input.conf: |- containers.input.conf: |-
# This configuration file for Fluentd / td-agent is used # This configuration file for Fluentd / td-agent is used
# to watch changes to Docker log files. The kubelet creates symlinks that # to watch changes to Docker log files. The kubelet creates symlinks that
@ -101,25 +111,19 @@ data:
# CRI Log Example: # CRI Log Example:
# 2016-02-17T00:04:05.931087621Z stdout F [info:2016-02-16T16:04:05.930-08:00] Some log text here # 2016-02-17T00:04:05.931087621Z stdout F [info:2016-02-16T16:04:05.930-08:00] Some log text here
<source> <source>
type tail @id fluentd-containers.log
@type tail
path /var/log/containers/*.log path /var/log/containers/*.log
pos_file /var/log/es-containers.log.pos pos_file /var/log/es-containers.log.pos
time_format %Y-%m-%dT%H:%M:%S.%NZ time_format %Y-%m-%dT%H:%M:%S.%NZ
tag raw.kubernetes.* tag raw.kubernetes.*
read_from_head true
format multi_format
<pattern>
format json format json
time_key time read_from_head true
time_format %Y-%m-%dT%H:%M:%S.%NZ
</pattern>
<pattern>
format /^(?<time>.+) (?<stream>stdout|stderr) [^ ]* (?<log>.*)$/
time_format %Y-%m-%dT%H:%M:%S.%N%:z
</pattern>
</source> </source>
# Detect exceptions in the log output and forward them as one log entry. # Detect exceptions in the log output and forward them as one log entry.
<match raw.kubernetes.**> <match raw.kubernetes.**>
@id raw.kubernetes
@type detect_exceptions @type detect_exceptions
remove_tag_prefix raw remove_tag_prefix raw
message log message log
@ -128,11 +132,25 @@ data:
max_bytes 500000 max_bytes 500000
max_lines 1000 max_lines 1000
</match> </match>
system.input.conf: |- system.input.conf: |-
# Example:
# 2015-12-21 23:17:22,066 [salt.state ][INFO ] Completed state [net.ipv4.ip_forward] at time 23:17:22.066081
<source>
@id minion
@type tail
format /^(?<time>[^ ]* [^ ,]*)[^\[]*\[[^\]]*\]\[(?<severity>[^ \]]*) *\] (?<message>.*)$/
time_format %Y-%m-%d %H:%M:%S
path /var/log/salt/minion
pos_file /var/log/salt.pos
tag salt
</source>
# Example: # Example:
# Dec 21 23:17:22 gke-foo-1-1-4b5cbd14-node-4eoj startupscript: Finished running startup script /var/run/google.startup.script # Dec 21 23:17:22 gke-foo-1-1-4b5cbd14-node-4eoj startupscript: Finished running startup script /var/run/google.startup.script
<source> <source>
type tail @id startupscript.log
@type tail
format syslog format syslog
path /var/log/startupscript.log path /var/log/startupscript.log
pos_file /var/log/es-startupscript.log.pos pos_file /var/log/es-startupscript.log.pos
@ -143,7 +161,8 @@ data:
# time="2016-02-04T06:51:03.053580605Z" level=info msg="GET /containers/json" # time="2016-02-04T06:51:03.053580605Z" level=info msg="GET /containers/json"
# time="2016-02-04T07:53:57.505612354Z" level=error msg="HTTP Error" err="No such image: -f" statusCode=404 # time="2016-02-04T07:53:57.505612354Z" level=error msg="HTTP Error" err="No such image: -f" statusCode=404
<source> <source>
type tail @id docker.log
@type tail
format /^time="(?<time>[^)]*)" level=(?<severity>[^ ]*) msg="(?<message>[^"]*)"( err="(?<error>[^"]*)")?( statusCode=($<status_code>\d+))?/ format /^time="(?<time>[^)]*)" level=(?<severity>[^ ]*) msg="(?<message>[^"]*)"( err="(?<error>[^"]*)")?( statusCode=($<status_code>\d+))?/
path /var/log/docker.log path /var/log/docker.log
pos_file /var/log/es-docker.log.pos pos_file /var/log/es-docker.log.pos
@ -153,7 +172,8 @@ data:
# Example: # Example:
# 2016/02/04 06:52:38 filePurge: successfully removed file /var/etcd/data/member/wal/00000000000006d0-00000000010a23d1.wal # 2016/02/04 06:52:38 filePurge: successfully removed file /var/etcd/data/member/wal/00000000000006d0-00000000010a23d1.wal
<source> <source>
type tail @id etcd.log
@type tail
# Not parsing this, because it doesn't have anything particularly useful to # Not parsing this, because it doesn't have anything particularly useful to
# parse out of it (like severities). # parse out of it (like severities).
format none format none
@ -169,7 +189,8 @@ data:
# Example: # Example:
# I0204 07:32:30.020537 3368 server.go:1048] POST /stats/container/: (13.972191ms) 200 [[Go-http-client/1.1] 10.244.1.3:40537] # I0204 07:32:30.020537 3368 server.go:1048] POST /stats/container/: (13.972191ms) 200 [[Go-http-client/1.1] 10.244.1.3:40537]
<source> <source>
type tail @id kubelet.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -183,7 +204,8 @@ data:
# Example: # Example:
# I1118 21:26:53.975789 6 proxier.go:1096] Port "nodePort for kube-system/default-http-backend:http" (:31429/tcp) was open before and is still needed # I1118 21:26:53.975789 6 proxier.go:1096] Port "nodePort for kube-system/default-http-backend:http" (:31429/tcp) was open before and is still needed
<source> <source>
type tail @id kube-proxy.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -197,7 +219,8 @@ data:
# Example: # Example:
# I0204 07:00:19.604280 5 handlers.go:131] GET /api/v1/nodes: (1.624207ms) 200 [[kube-controller-manager/v1.1.3 (linux/amd64) kubernetes/6a81b50] 127.0.0.1:38266] # I0204 07:00:19.604280 5 handlers.go:131] GET /api/v1/nodes: (1.624207ms) 200 [[kube-controller-manager/v1.1.3 (linux/amd64) kubernetes/6a81b50] 127.0.0.1:38266]
<source> <source>
type tail @id kube-apiserver.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -211,7 +234,8 @@ data:
# Example: # Example:
# I0204 06:55:31.872680 5 servicecontroller.go:277] LB already exists and doesn't need update for service kube-system/kube-ui # I0204 06:55:31.872680 5 servicecontroller.go:277] LB already exists and doesn't need update for service kube-system/kube-ui
<source> <source>
type tail @id kube-controller-manager.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -225,7 +249,8 @@ data:
# Example: # Example:
# W0204 06:49:18.239674 7 reflector.go:245] pkg/scheduler/factory/factory.go:193: watch of *api.Service ended with: 401: The event in requested index is outdated and cleared (the requested history has been cleared [2578313/2577886]) [2579312] # W0204 06:49:18.239674 7 reflector.go:245] pkg/scheduler/factory/factory.go:193: watch of *api.Service ended with: 401: The event in requested index is outdated and cleared (the requested history has been cleared [2578313/2577886]) [2579312]
<source> <source>
type tail @id kube-scheduler.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -239,7 +264,8 @@ data:
# Example: # Example:
# I1104 10:36:20.242766 5 rescheduler.go:73] Running Rescheduler # I1104 10:36:20.242766 5 rescheduler.go:73] Running Rescheduler
<source> <source>
type tail @id rescheduler.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -253,7 +279,8 @@ data:
# Example: # Example:
# I0603 15:31:05.793605 6 cluster_manager.go:230] Reading config from path /etc/gce.conf # I0603 15:31:05.793605 6 cluster_manager.go:230] Reading config from path /etc/gce.conf
<source> <source>
type tail @id glbc.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -267,7 +294,8 @@ data:
# Example: # Example:
# I0603 15:31:05.793605 6 cluster_manager.go:230] Reading config from path /etc/gce.conf # I0603 15:31:05.793605 6 cluster_manager.go:230] Reading config from path /etc/gce.conf
<source> <source>
type tail @id cluster-autoscaler.log
@type tail
format multiline format multiline
multiline_flush_interval 5s multiline_flush_interval 5s
format_firstline /^\w\d{4}/ format_firstline /^\w\d{4}/
@ -280,33 +308,47 @@ data:
# Logs from systemd-journal for interesting services. # Logs from systemd-journal for interesting services.
<source> <source>
type systemd @id journald-docker
@type systemd
filters [{ "_SYSTEMD_UNIT": "docker.service" }] filters [{ "_SYSTEMD_UNIT": "docker.service" }]
pos_file /var/log/gcp-journald-docker.pos <storage>
@type local
persistent true
</storage>
read_from_head true read_from_head true
tag docker tag docker
</source> </source>
<source> <source>
type systemd @id journald-kubelet
@type systemd
filters [{ "_SYSTEMD_UNIT": "kubelet.service" }] filters [{ "_SYSTEMD_UNIT": "kubelet.service" }]
pos_file /var/log/gcp-journald-kubelet.pos <storage>
@type local
persistent true
</storage>
read_from_head true read_from_head true
tag kubelet tag kubelet
</source> </source>
<source> <source>
type systemd @id journald-node-problem-detector
@type systemd
filters [{ "_SYSTEMD_UNIT": "node-problem-detector.service" }] filters [{ "_SYSTEMD_UNIT": "node-problem-detector.service" }]
pos_file /var/log/gcp-journald-node-problem-detector.pos <storage>
@type local
persistent true
</storage>
read_from_head true read_from_head true
tag node-problem-detector tag node-problem-detector
</source> </source>
forward.input.conf: |- forward.input.conf: |-
# Takes the messages sent over TCP # Takes the messages sent over TCP
<source> <source>
type forward @type forward
</source> </source>
monitoring.conf: |- monitoring.conf: |-
# Prometheus Exporter Plugin # Prometheus Exporter Plugin
# input plugin that exports metrics # input plugin that exports metrics
@ -341,32 +383,32 @@ data:
host ${hostname} host ${hostname}
</labels> </labels>
</source> </source>
output.conf: |- output.conf: |-
# Enriches records with Kubernetes metadata # Enriches records with Kubernetes metadata
<filter kubernetes.**> <filter kubernetes.**>
type kubernetes_metadata @type kubernetes_metadata
</filter> </filter>
<match **> <match **>
type elasticsearch @id elasticsearch
log_level info @type elasticsearch
@log_level info
include_tag_key true include_tag_key true
host elasticsearch-logging host elasticsearch-logging
port 9200 port 9200
logstash_format true logstash_format true
# Set the chunk limits. <buffer>
buffer_chunk_limit 2M @type file
buffer_queue_limit 8 path /var/log/fluentd-buffers/kubernetes.system.buffer
flush_mode interval
retry_type exponential_backoff
flush_thread_count 2
flush_interval 5s flush_interval 5s
# Never wait longer than 5 minutes between retries. retry_forever
max_retry_wait 30 retry_max_interval 30
# Disable the limit on the number of retries (retry forever). chunk_limit_size 2M
disable_retry_limit queue_limit_length 8
# Use multiple threads for processing. overflow_action block
num_threads 2 </buffer>
</match> </match>
metadata:
name: fluentd-es-config-v0.1.2
namespace: kube-system
labels:
addonmanager.kubernetes.io/mode: Reconcile

View File

@ -48,24 +48,24 @@ roleRef:
apiVersion: apps/v1 apiVersion: apps/v1
kind: DaemonSet kind: DaemonSet
metadata: metadata:
name: fluentd-es-v2.0.3 name: fluentd-es-v2.0.4
namespace: kube-system namespace: kube-system
labels: labels:
k8s-app: fluentd-es k8s-app: fluentd-es
version: v2.0.3 version: v2.0.4
kubernetes.io/cluster-service: "true" kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile addonmanager.kubernetes.io/mode: Reconcile
spec: spec:
selector: selector:
matchLabels: matchLabels:
k8s-app: fluentd-es k8s-app: fluentd-es
version: v2.0.3 version: v2.0.4
template: template:
metadata: metadata:
labels: labels:
k8s-app: fluentd-es k8s-app: fluentd-es
kubernetes.io/cluster-service: "true" kubernetes.io/cluster-service: "true"
version: v2.0.3 version: v2.0.4
# This annotation ensures that fluentd does not get evicted if the node # This annotation ensures that fluentd does not get evicted if the node
# supports critical pod annotation based priority scheme. # supports critical pod annotation based priority scheme.
# Note that this does not guarantee admission on the nodes (#40573). # Note that this does not guarantee admission on the nodes (#40573).
@ -75,7 +75,7 @@ spec:
serviceAccountName: fluentd-es serviceAccountName: fluentd-es
containers: containers:
- name: fluentd-es - name: fluentd-es
image: gcr.io/google-containers/fluentd-elasticsearch:v2.0.3 image: gcr.io/google-containers/fluentd-elasticsearch:v2.0.4
env: env:
- name: FLUENTD_ARGS - name: FLUENTD_ARGS
value: --no-supervisor -q value: --no-supervisor -q
@ -112,4 +112,4 @@ spec:
path: /usr/lib64 path: /usr/lib64
- name: config-volume - name: config-volume
configMap: configMap:
name: fluentd-es-config-v0.1.2 name: fluentd-es-config-v0.1.3

View File

@ -21,6 +21,8 @@
FROM debian:stretch-slim FROM debian:stretch-slim
ARG DEBIAN_FRONTEND=noninteractive
COPY clean-apt /usr/bin COPY clean-apt /usr/bin
COPY clean-install /usr/bin COPY clean-install /usr/bin
COPY Gemfile /Gemfile COPY Gemfile /Gemfile

View File

@ -1,11 +1,11 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'fluentd', '~>0.12.32' gem 'fluentd', '<=1.1.0'
gem 'activesupport', '~>4.2.6' gem 'activesupport', '~>5.1.4'
gem 'fluent-plugin-kubernetes_metadata_filter', '~>0.27.0' gem 'fluent-plugin-kubernetes_metadata_filter', '~>1.0.0'
gem 'fluent-plugin-elasticsearch', '~>1.9.5' gem 'fluent-plugin-elasticsearch', '~>2.4.1'
gem 'fluent-plugin-systemd', '~>0.0.8' gem 'fluent-plugin-systemd', '~>0.3.1'
gem 'fluent-plugin-detect-exceptions', '~>0.0.8' gem 'fluent-plugin-detect-exceptions', '~>0.0.9'
gem 'fluent-plugin-prometheus', '~>0.3.0' gem 'fluent-plugin-prometheus', '~>0.3.0'
gem 'fluent-plugin-multi-format-parser', '~>0.1.1' gem 'fluent-plugin-multi-format-parser', '~>1.0.0'
gem 'oj', '~>2.18.1' gem 'oj', '~>3.3.1.0'

View File

@ -16,7 +16,7 @@
PREFIX = gcr.io/google-containers PREFIX = gcr.io/google-containers
IMAGE = fluentd-elasticsearch IMAGE = fluentd-elasticsearch
TAG = v2.0.3 TAG = v2.0.4
build: build:
docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) . docker build --pull -t $(PREFIX)/$(IMAGE):$(TAG) .

View File

@ -2,7 +2,7 @@
# Do not collect fluentd's own logs to avoid infinite loops. # Do not collect fluentd's own logs to avoid infinite loops.
<match fluent.**> <match fluent.**>
type null @type null
</match> </match>
@include /etc/fluent/config.d/*.conf @include /etc/fluent/config.d/*.conf