This repository has been archived by the owner on Mar 6, 2023. It is now read-only.
forked from fluent/fluentd-kubernetes-daemonset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubernetes.conf.erb
67 lines (61 loc) · 2.19 KB
/
kubernetes.conf.erb
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
<% target = (dockerfile.split("/").last.split("-").last) %>
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /templates/conf/kubernetes.conf.erb
<label @FLUENT_LOG>
<match fluent.**>
@type null
@id ignore_fluent_logs
</match>
</label>
@include kubernetes/cluster-autoscaler.conf
@include kubernetes/containers.conf
@include kubernetes/docker.conf
@include kubernetes/etcd.conf
@include kubernetes/glbc.conf
@include kubernetes/kube-apiserver-audit.conf
@include kubernetes/kube-apiserver.conf
@include kubernetes/kube-controller-manager.conf
@include kubernetes/kube-proxy.conf
@include kubernetes/kube-scheduler.conf
@include kubernetes/kubelet.conf
@include kubernetes/rescheduler.conf
@include kubernetes/salt.conf
@include kubernetes/startupscript.conf
<filter kubernetes.**>
@type kubernetes_metadata
@id filter_kube_metadata
kubernetes_url "#{ENV['FLUENT_FILTER_KUBERNETES_URL'] || 'https://' + ENV.fetch('KUBERNETES_SERVICE_HOST') + ':' + ENV.fetch('KUBERNETES_SERVICE_PORT') + '/api'}"
verify_ssl "#{ENV['KUBERNETES_VERIFY_SSL'] || true}"
ca_file "#{ENV['KUBERNETES_CA_FILE']}"
skip_labels "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_LABELS'] || 'false'}"
skip_container_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_CONTAINER_METADATA'] || 'false'}"
skip_master_url "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_MASTER_URL'] || 'false'}"
skip_namespace_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_NAMESPACE_METADATA'] || 'false'}"
watch "#{ENV['FLUENT_KUBERNETES_WATCH'] || 'true'}"
</filter>
<% case target when "papertrail" %>
<filter kube-apiserver-audit>
@type record_transformer
@id filter_rt_kube_apiserver_audit
enable_ruby true
<record>
hostname #{ENV['FLUENT_HOSTNAME']}
program kube-apiserver-audit
severity info
facility local0
message ${record}
</record>
</filter>
<filter kubernetes.**>
@type record_transformer
@id filter_rt_kube_logs
enable_ruby true
<record>
hostname #{ENV['FLUENT_HOSTNAME']}-${record["kubernetes"]["namespace_name"]}-${record["kubernetes"]["pod_name"]}
program ${record["kubernetes"]["container_name"]}
severity info
facility local0
message ${record['log']}
</record>
</filter>
<% end %>