#!/usr/bin/dumb-init /bin/sh
uid=${FLUENT_UID:-1000}
# check if a old fluent user exists and delete it
cat /etc/passwd | grep fluent
if [ $? -eq 0 ]; then
deluser fluent
fi
# (re)add the fluent user with $FLUENT_UID
useradd -u ${uid} -o -c "" -m fluent
export HOME=/home/fluent
# chown home and data folder
chown -R fluent /home/fluent
chown -R fluent /fluentd
exec gosu fluent "$@"
kind: ConfigMap
apiVersion: v1
metadata:
name: fluentd-config
namespace: monitoring
labels:
k8s-app: fluentd-config
data:
fluent.conf: |
@include application.conf
<match **>
@type redis
host logstash-redis.gtforge.com
port 6379
insert_key_prefix fluentd_prod
# database number is optional.
# db_number 0 # 0 is default
# If requirepass is set, please specify this.
# password hogefuga
# Users can set '${tag}' or ${tag[0]}.${tag[1]} or ...?
# insert_key_prefix '${tag}'
# Users can set strftime format.
# "%s" will be replaced into unixtime.
# "%Y%m%d.%H%M%S" will be replaced like as 20161202.112335.
# strftime_format "%s"
# Allow insert key duplicate. It will work as update values.
# allow_duplicate_key true
# ttl 300 # If 0 or negative value is set, ttl is not set in each key.
</match>
application.conf: |
<match kubernetes.var.log.containers.**fluentd**.log>
@type null
</match>
<source>
@type tail
path /var/log/containers/*.log
tag kube.*
read_from_head true
format json
<parse>
@type none
</parse>
</source>
after deploying to kubernetes pods are coming up and recieving the following error (for example):
2018-05-03 13:47:31 +0000 [warn]: #0 /var/log/containers/fluentd-logging-46phg_monitoring_fluentd-33e87e34dae2ff6bc3e98c55df9730171e756d2d9e91355b96d169838e4c2870.log unreadable. It is excluded and would be examined next time.
I've tried to play with a lot, can't find any solution...
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days
K8S version 1.10.0
trying to deploy using a deamonset in pre baked docker image: my docker file :
my entrypoint.sh:
my k8s Deamonset yaml:
my config file (fluent.conf) :
after deploying to kubernetes pods are coming up and recieving the following error (for example):
2018-05-03 13:47:31 +0000 [warn]: #0 /var/log/containers/fluentd-logging-46phg_monitoring_fluentd-33e87e34dae2ff6bc3e98c55df9730171e756d2d9e91355b96d169838e4c2870.log unreadable. It is excluded and would be examined next time.
I've tried to play with a lot, can't find any solution...Please advise.