Przeglądaj źródła

Bug 1466152 - Json-file log driver: Neither "openshift_logging_fluentd_use_journal=false" nor omitted collects the log entries

https://bugzilla.redhat.com/show_bug.cgi?id=1466152
Do not set openshift_logging_fluentd_use_journal or USE_JOURNAL at
all unless it is explicitly set as an ansible param.  It is almost
always better to let fluentd figure out which log driver docker
is using.
Rich Megginson 7 lat temu
rodzic
commit
c9e92b4733

+ 1 - 1
roles/openshift_hosted_logging/README.md

@@ -22,7 +22,7 @@
 - openshift_hosted_logging_kibana_nodeselector: Specify the nodeSelector that Kibana should be use (label=value)
 - openshift_hosted_logging_curator_nodeselector: Specify the nodeSelector that Curator should be use (label=value)
 - openshift_hosted_logging_enable_ops_cluster: If "true", configure a second ES cluster and Kibana for ops logs.
-- openshift_hosted_logging_use_journal: If this is unset or empty, logging will try to figure out from docker which log driver it is using (json-file or journald).  You can set this param to "true" or "false" to force logging to use journal or not (but make sure you are sure which one docker is using).
+- openshift_hosted_logging_use_journal: *DEPRECATED - DO NOT USE*
 - openshift_hosted_logging_journal_source: By default, if this param is unset or empty, logging will use `/var/log/journal` if it exists, or `/run/log/journal` if not.  You can use this param to force logging to use a different location.
 - openshift_hosted_logging_journal_read_from_head: Set to `true` to have fluentd read from the beginning of the journal, to get historical log data.  Default is `false`.  *WARNING* Using `true` may take several minutes or even hours, depending on the size of the journal, until any new records show up in Elasticsearch, and will cause fluentd to consume a lot of CPU and RAM resources.
 

Plik diff jest za duży
+ 1 - 2
roles/openshift_hosted_logging/vars/main.yaml


+ 1 - 1
roles/openshift_logging/README.md

@@ -52,7 +52,7 @@ When both `openshift_logging_install_logging` and `openshift_logging_upgrade_log
 - `openshift_logging_fluentd_cpu_limit`: The CPU limit for Fluentd pods. Defaults to '100m'.
 - `openshift_logging_fluentd_memory_limit`: The memory limit for Fluentd pods. Defaults to '512Mi'.
 - `openshift_logging_fluentd_es_copy`: Whether or not to use the ES_COPY feature for Fluentd (DEPRECATED). Defaults to 'False'.
-- `openshift_logging_fluentd_use_journal`: NOTE: Fluentd will attempt to detect whether or not Docker is using the journald log driver when using the default of empty.
+- `openshift_logging_fluentd_use_journal`: *DEPRECATED - DO NOT USE* Fluentd will automatically detect whether or not Docker is using the journald log driver.
 - `openshift_logging_fluentd_journal_read_from_head`: If empty, Fluentd will use its internal default, which is false.
 - `openshift_logging_fluentd_hosts`: List of nodes that should be labeled for Fluentd to be deployed to. Defaults to ['--all'].
 - `openshift_logging_fluentd_buffer_queue_limit`: Buffer queue limit for Fluentd. Defaults to 1024.

+ 0 - 1
roles/openshift_logging/defaults/main.yml

@@ -72,7 +72,6 @@ openshift_logging_fluentd_nodeselector: "{{ openshift_hosted_logging_fluentd_nod
 openshift_logging_fluentd_cpu_limit: 100m
 openshift_logging_fluentd_memory_limit: 512Mi
 openshift_logging_fluentd_es_copy: false
-openshift_logging_fluentd_use_journal: "{{ openshift_hosted_logging_use_journal if openshift_hosted_logging_use_journal is defined else (docker_log_driver == 'journald') | ternary(True, False) if docker_log_driver is defined else (openshift.docker.log_driver == 'journald') | ternary(True, False) if openshift.docker.log_driver is defined else openshift.docker.options | search('--log-driver=journald') if openshift.docker.options is defined else default(omit) }}"
 openshift_logging_fluentd_journal_source: "{{ openshift_hosted_logging_journal_source | default('') }}"
 openshift_logging_fluentd_journal_read_from_head: "{{ openshift_hosted_logging_journal_read_from_head | default('') }}"
 openshift_logging_fluentd_hosts: ['--all']

+ 0 - 1
roles/openshift_logging/tasks/install_logging.yaml

@@ -261,7 +261,6 @@
   vars:
     generated_certs_dir: "{{openshift.common.config_base}}/logging"
     openshift_logging_fluentd_ops_host: "{{ ( openshift_logging_use_ops | bool ) | ternary('logging-es-ops', 'logging-es') }}"
-    openshift_logging_fluentd_use_journal: "{{ openshift.docker.options | search('journald') }}"
     openshift_logging_fluentd_image_prefix: "{{ openshift_logging_image_prefix }}"
     openshift_logging_fluentd_image_version: "{{ openshift_logging_image_version }}"
     openshift_logging_fluentd_image_pull_secret: "{{ openshift_logging_image_pull_secret }}"

+ 0 - 1
roles/openshift_logging_fluentd/defaults/main.yml

@@ -28,7 +28,6 @@ openshift_logging_fluentd_ops_host: "{{ openshift_logging_fluentd_app_host }}"
 openshift_logging_fluentd_ops_port: "{{ openshift_logging_fluentd_app_port }}"
 
 ### Used by "hosted" and "secure-aggregator" deployments
-#openshift_logging_fluentd_use_journal: "{{ openshift_hosted_logging_use_journal }}"
 openshift_logging_fluentd_journal_source: "{{ openshift_hosted_logging_journal_source | default('') }}"
 openshift_logging_fluentd_journal_read_from_head: "{{ openshift_hosted_logging_journal_read_from_head | default('') }}"
 

+ 7 - 11
roles/openshift_logging_fluentd/tasks/main.yaml

@@ -15,19 +15,15 @@
     msg: Invalid deployment type, one of ['hosted', 'secure-aggregator', 'secure-host'] allowed
   when: not openshift_logging_fluentd_deployment_type in __allowed_fluentd_types
 
-- include: determine_version.yaml
+- debug:
+    msg: openshift_logging_fluentd_use_journal is deprecated.  Fluentd will automatically detect which logging driver is being used.
+  when: openshift_logging_fluentd_use_journal is defined
 
-- set_fact:
-    openshift_logging_fluentd_use_journal: "{{ openshift_hosted_logging_use_journal }}"
-  when:
-  - openshift_hosted_logging_use_journal is defined
-  - openshift_logging_fluentd_use_journal is not defined
+- debug:
+    msg: openshift_hosted_logging_use_journal is deprecated.  Fluentd will automatically detect which logging driver is being used.
+  when: openshift_hosted_logging_use_journal is defined
 
-- set_fact:
-    openshift_logging_fluentd_use_journal: "{{ __fluentd_use_journal }}"
-  when:
-  - openshift_hosted_logging_use_journal is not defined
-  - openshift_logging_fluentd_use_journal is not defined
+- include: determine_version.yaml
 
 # allow passing in a tempdir
 - name: Create temp directory for doing work in

+ 0 - 2
roles/openshift_logging_fluentd/templates/fluentd.j2

@@ -92,8 +92,6 @@ spec:
           value: "{{ openshift_logging_fluentd_ops_ca }}"
         - name: "ES_COPY"
           value: "false"
-        - name: "USE_JOURNAL"
-          value: "{{ openshift_logging_fluentd_use_journal | lower }}"
         - name: "JOURNAL_SOURCE"
           value: "{{ openshift_logging_fluentd_journal_source | default('') }}"
         - name: "JOURNAL_READ_FROM_HEAD"

+ 0 - 1
roles/openshift_logging_fluentd/vars/main.yml

@@ -2,4 +2,3 @@
 __latest_fluentd_version: "3_5"
 __allowed_fluentd_versions: ["3_5", "3_6"]
 __allowed_fluentd_types: ["hosted", "secure-aggregator", "secure-host"]
-__fluentd_use_journal: "{{ (docker_log_driver == 'journald') | ternary(True, False) if docker_log_driver is defined else (openshift.docker.log_driver == 'journald') | ternary(True, False) if openshift.docker.log_driver is defined else openshift.docker.options | search('--log-driver=journald') if openshift.docker.options is defined else default(omit) }}"

+ 0 - 1
roles/openshift_logging_mux/defaults/main.yml

@@ -24,7 +24,6 @@ openshift_logging_mux_ops_host: "{{ openshift_logging_mux_app_host }}"
 openshift_logging_mux_ops_port: "{{ openshift_logging_mux_app_port }}"
 
 ### Used by "hosted" and "secure-aggregator" deployments
-openshift_logging_mux_use_journal: "{{ openshift_hosted_logging_use_journal | default('') }}"
 openshift_logging_mux_journal_source: "{{ openshift_hosted_logging_journal_source | default('') }}"
 openshift_logging_mux_journal_read_from_head: "{{ openshift_hosted_logging_journal_read_from_head | default('') }}"
 

+ 0 - 2
roles/openshift_logging_mux/templates/mux.j2

@@ -89,8 +89,6 @@ spec:
           value: "{{openshift_logging_mux_ops_client_key}}"
         - name: "OPS_CA"
           value: "{{openshift_logging_mux_ops_ca}}"
-        - name: "USE_JOURNAL"
-          value: "false"
         - name: "JOURNAL_SOURCE"
           value: "{{openshift_logging_mux_journal_source | default('')}}"
         - name: "JOURNAL_READ_FROM_HEAD"