X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fcaas-logging.git;a=blobdiff_plain;f=ansible%2Froles%2Ffluentd%2Ftemplates%2Ffluentd-cm.yaml;fp=ansible%2Froles%2Ffluentd%2Ftemplates%2Ffluentd-cm.yaml;h=fb58c0d0281965a9423a8772042e1ad611d31d42;hp=0000000000000000000000000000000000000000;hb=229e54ec0c45ee7389247cf6cda79d31b303de85;hpb=9afa6af59d04c80d65eede7fc36b09d370b57abb diff --git a/ansible/roles/fluentd/templates/fluentd-cm.yaml b/ansible/roles/fluentd/templates/fluentd-cm.yaml new file mode 100644 index 0000000..fb58c0d --- /dev/null +++ b/ansible/roles/fluentd/templates/fluentd-cm.yaml @@ -0,0 +1,64 @@ +{# +Copyright 2019 Nokia + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +#} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: fluentd-cm + namespace: kube-system +data: + #Take care that the files will be processed by fluentd in alphabetical order + 01-fluentd_kubernetes.conf: |- + + # Look for files of type *kube-system* and add tag kubernetes + + @type tail + path /var/log/containers/*kube-system*.log + pos_file /fluentd/log/fluentd-kubernetes.log.pos + time_format %Y-%m-%dT%H:%M:%S.%NZ + tag kubernetes.* + format json + read_from_head true + + # Add kubernetes metadata to "kubernetes" tagged messages + + @type kubernetes_metadata + + + 02-fluentd_elasticsearch.conf: |- + + # Forward all messages with either kubenetes tag to elasticsearch + + @type elasticsearch + @log_level info + include_tag_key true + host "{{ caas.elasticsearch_url }}" + port "{{ caas.elasticsearch_port }}" + scheme "{{ elasticsearch_sheme | default('http') }}" + user "{{ elasticsearch_user | default('elastic') }}" + password "{{ elasticsearch_passwd | default('changeme') }}" + ssl_verify "{{ elasticsearch_ssl | default('true') }}" + reload_connections "{{ elasticsearch_reload_connections | default('true') }}" + logstash_prefix "{{ elasticsearch_logstash_prefix | default('logstash') }}" + logstash_format true + reconnect_on_error true + resurrect_after 5s + + chunk_limit_size 256m + flush_at_shutdown "true" + flush_interval 5s + +