Bug 1420204 - Fluentd should overwrite the default value of openshift_logging_fluentd_use_journal by detecting whether or not Docker is using the journald log driver
Summary: Fluentd should overwrite the default value of openshift_logging_fluentd_use_j...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Logging
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jeff Cantrill
QA Contact: Xia Zhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-08 06:20 UTC by Xia Zhao
Modified: 2017-07-24 14:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2017-04-12 18:50:05 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0903 0 normal SHIPPED_LIVE OpenShift Container Platform atomic-openshift-utils bug fix and enhancement 2017-04-12 22:45:42 UTC

Description Xia Zhao 2017-02-08 06:20:32 UTC
Description of problem:
The openshift master/nodes' default log driver is now journald along with the fix of https://bugzilla.redhat.com/show_bug.cgi?id=1388191, but fluentd didn't overwrite the default value of USE_JOURNAL=false after detecting whether or not Docker is using the journald log driver.
Another approach is to adjust the default value of openshift_logging_fluentd_use_journal to true, which is identical to openshift master/nodes.

Version-Release number of selected component (if applicable):
ops registry:
logging-fluentd         3.5.0               47057624ecab

# openshift version
openshift v3.5.0.17+c55cf2b
kubernetes v1.5.2+43a9be4
etcd 3.1.0

How reproducible:
Always

Steps to Reproduce:
1.Launch openshift env and make sure the log driver of master/nodes are default to journald
2.Deploy logging 3.5.0 stacks by executing ansible scripts, without value openshift_logging_fluentd_use_journal specified (should be default to false)
3.After fluentd is running, check env USE_JOURNAL

Actual results:
USE_JOURNAL=false

Expected results:
USE_JOURNAL=true

Additional info:

Comment 1 Rich Megginson 2017-02-08 15:26:06 UTC
Hmm - If there is a bug here, it is that USE_JOURNAL always has a value, and the default value is false.  The way the logic in fluentd run.sh works is that it will autodetect what docker is using _if USE_JOURNAL is not set at all_.  However, the fluentd.yaml template has this:

            env:
            - name: "USE_JOURNAL"
              value: ${USE_JOURNAL}
...
parameters:
-
  description: "Use the journal as input for system logs"
  name: USE_JOURNAL
  value: "false"

And we run the deployer like this:

  use_journal=${input_vars[use-journal]:-}
...
   create_template_optional_nodeselector "${input_vars[fluentd-nodeselector]}" fluentd \
   --param USE_JOURNAL=${use_journal} \

I'm not sure how this works if use_journal is unset in the env or configmap. Will this pass an empty value to the template, which will will cause env. USE_JOURNAL to be an empty value in the fluentd pod?  If so, then the answer is this:

If you want fluentd to autodetect if docker is using journal, make sure use_journal/USE_JOURNAL is unset.

Comment 2 Jeff Cantrill 2017-02-08 16:13:12 UTC
Fixed to default to empty spaces so it is consistent with the deployer and forces fluentd to evaluate the log driver: https://github.com/openshift/openshift-ansible/pull/3293

Comment 3 openshift-github-bot 2017-02-10 14:32:12 UTC
Commits pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/ff02c984c4a0dcc809ec65fe5db530a3ceb81a84
fix bug 1420204. Default openshift_logging_use_journal to empty so fluentd detects and is consistent with deployer

https://github.com/openshift/openshift-ansible/commit/bef3e1dc951699d769b7776129a5bd73fce2ff7c
Merge pull request #3293 from jcantrill/bz_1420204_use_journal_fix

fix bug 1420204. Default openshift_logging_use_journal to empty so fl…

Comment 4 Xia Zhao 2017-02-28 10:04:05 UTC
Verified with openshift-ansible-3.5.15-1.git.0.8d2a456.el7.noarch, deployed logging on both json-file and journald log driver systems without specifying the value to openshift_logging_fluentd_use_journal, the fluentd autodetect log driver function worked fine. In the both cases can see log entries present in kiaban UI. 

Please feel free to transfer back to ON_QA for closure, also thanks Rich and Jeff for the explanations.

Comment 5 Xia Zhao 2017-03-01 00:36:23 UTC
Set to verified based on comment #4.

Comment 7 errata-xmlrpc 2017-04-12 18:50:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0903


Note You need to log in before you can comment on or make changes to this bug.