Merge "Enable the Fluentd Plugin Systemd"

This commit is contained in:
Zuul 2024-01-10 16:00:36 +00:00 committed by Gerrit Code Review
commit 357db52433
8 changed files with 54 additions and 0 deletions

View File

@ -806,6 +806,7 @@ enable_cyborg: "no"
enable_designate: "no"
enable_etcd: "no"
enable_fluentd: "yes"
enable_fluentd_systemd: "{{ (enable_fluentd | bool) and (enable_central_logging | bool) }}"
enable_freezer: "no"
enable_gnocchi: "no"
enable_gnocchi_statsd: "no"

View File

@ -120,6 +120,7 @@ fluentd_default_volumes:
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "kolla_logs:/var/log/kolla/"
- "fluentd_data:/var/lib/fluentd/data/"
- "/var/log/journal:/var/log/journal:ro"
kolla_toolbox_extra_volumes: "{{ default_extra_volumes }}"
cron_extra_volumes: "{{ default_extra_volumes }}"
fluentd_extra_volumes: "{{ default_extra_volumes }}"

View File

@ -165,6 +165,8 @@
enabled: true
- name: "conf/input/11-letsencrypt.conf.j2"
enabled: "{{ enable_letsencrypt | bool }}"
- name: "conf/input/12-systemd.conf.j2"
enabled: "{{ enable_fluentd_systemd | bool }}"
customised_input_files: "{{ find_custom_fluentd_inputs.files | map(attribute='path') | list }}"
# Filters
fluentd_filter_files: "{{ default_filter_files | customise_fluentd(customised_filter_files) }}"

View File

@ -0,0 +1,9 @@
<source>
@type systemd
tag journal
path /var/log/journal
<entry>
fields_strip_underscores true
fields_lowercase true
</entry>
</source>

View File

@ -24,6 +24,13 @@
"recurse": true
},
{% endfor %}
{% if enable_fluentd_systemd | bool %}
{
"path": "/var/log/journal",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",
"recurse": true
},
{% endif %}
{
"path": "/var/lib/fluentd/data",
"owner": "{{ fluentd_user }}:{{ fluentd_user }}",

View File

@ -276,3 +276,13 @@ network equipment. This can be done by configuring custom fluentd inputs.
Configuration of custom fluentd inputs is possible by placing input
configuration files in ``/etc/kolla/config/fluentd/input/*.conf`` on the
control host.
Systemd Logs
------------
By default, when enabling central logging, we also enable reading ``systemd``
logs from the ``/var/log/journal`` file.
To disable this behavior when central logging is enabled, set the value of
the variable ``enable_fluentd_systemd`` to ``false`` in the configuration
file ``/etc/kolla/globals.yml``.

View File

@ -351,6 +351,7 @@ workaround_ansible_issue_8743: yes
#enable_destroy_images: "no"
#enable_etcd: "no"
#enable_fluentd: "yes"
#enable_fluentd_systemd: "{{ (enable_fluentd | bool) and (enable_central_logging | bool) }}"
#enable_freezer: "no"
#enable_gnocchi: "no"
#enable_gnocchi_statsd: "no"

View File

@ -0,0 +1,23 @@
---
features:
- |
Implements [Enable Fluentd Plugin Systemd].
Adds the needed changes and configurations in order to use the
fluentd plugin, systemd, to read logs from /var/log/journal by
default. This allows us to read and manipulate this logs for
monitoring purposes.
These logs will be sent to OpenSearch by default, to disable this
behavior, set the value of the variable ``enable_fluentd_systemd``
to ``false`` in the configuration file ``/etc/kolla/globals.yml``.
By default, when enabling central logging, we also enable the
``systemd`` plugin. To disable this behavior when central logging
is enabled, set the value of the variable ``enable_fluentd_systemd``
to ``false`` in the configuration file ``/etc/kolla/globals.yml``.
fluent-plugin-systemd source:
https://github.com/fluent-plugin-systemd/fluent-plugin-systemd
`Blueprint enable-fluent-plugin-systemd
<https://blueprints.launchpad.net/kolla-ansible/+spec/enable-fluent-plugin-systemd>`__