Explorar o código

Merge pull request #7102 from wozniakjan/logging/cri-o

Automatic merge from submit-queue.

logging: allow fluentd to determine cri-o

Allow fluentd to try to determine if OpenShift is running cri-o from `etc/origin/node/node-config.yaml` config file where `kubeletArguments -> container-runtime-endpoint` contains `cri-o`

cc: @mrunalp , @jcantrill , @richm
OpenShift Merge Robot %!s(int64=7) %!d(string=hai) anos
pai
achega
3df8199253

+ 14 - 1
roles/openshift_logging/README.md

@@ -219,7 +219,7 @@ Elasticsearch OPS too, if using an OPS cluster:
 - `openshift_logging_fluentd_remote_syslog_use_record`: Set `true` to use the severity and facility from the record, defaults to `false`
 - `openshift_logging_fluentd_remote_syslog_use_record`: Set `true` to use the severity and facility from the record, defaults to `false`
 - `openshift_logging_fluentd_remote_syslog_payload_key`: If string is specified, use this field from the record as the payload on the syslog message
 - `openshift_logging_fluentd_remote_syslog_payload_key`: If string is specified, use this field from the record as the payload on the syslog message
 
 
-The corresponding openshift\_logging\_mux\_* parameters are below.
+The corresponding `openshift_logging_mux_*` parameters are below.
 
 
 - `openshift_logging_mux_remote_syslog`: Set `true` to enable remote syslog forwarding, defaults to `false`
 - `openshift_logging_mux_remote_syslog`: Set `true` to enable remote syslog forwarding, defaults to `false`
 - `openshift_logging_mux_remote_syslog_host`: Required, hostname or IP of remote syslog server
 - `openshift_logging_mux_remote_syslog_host`: Required, hostname or IP of remote syslog server
@@ -231,6 +231,19 @@ The corresponding openshift\_logging\_mux\_* parameters are below.
 - `openshift_logging_mux_remote_syslog_use_record`: Set `true` to use the severity and facility from the record, defaults to `false`
 - `openshift_logging_mux_remote_syslog_use_record`: Set `true` to use the severity and facility from the record, defaults to `false`
 - `openshift_logging_mux_remote_syslog_payload_key`: If string is specified, use this field from the record as the payload on the syslog message
 - `openshift_logging_mux_remote_syslog_payload_key`: If string is specified, use this field from the record as the payload on the syslog message
 
 
+Cri-o Formatted Container Logs
+------------------------------
+In order to enable cri-o logs parsing, the `openshift_logging_fluentd` role
+mounts `node-config.yaml` from the host to the fluentd container to this path:
+```
+/etc/origin/node/node-config.yaml
+```
+
+Fluentd pod on startup automatically determines from the `node-config.yaml`
+whether to setup `in_tail` plugin to parse cri-o formatted logs in
+`/var/log/containers/*` based on the
+`kubeletArguments -> container-runtime-endpoint` value.
+
 Image update procedure
 Image update procedure
 ----------------------
 ----------------------
 An upgrade of the logging stack from older version to newer is an automated process and should be performed by calling appropriate ansible playbook and setting required ansible variables in your inventory as documented in https://docs.openshift.org/.
 An upgrade of the logging stack from older version to newer is an automated process and should be performed by calling appropriate ansible playbook and setting required ansible variables in your inventory as documented in https://docs.openshift.org/.

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

@@ -79,6 +79,9 @@ spec:
         - name: dockerdaemoncfg
         - name: dockerdaemoncfg
           mountPath: /etc/docker
           mountPath: /etc/docker
           readOnly: true
           readOnly: true
+        - name: originnodecfg 
+          mountPath: /etc/origin/node
+          readOnly: true
         - name: filebufferstorage
         - name: filebufferstorage
           mountPath: /var/lib/fluentd
           mountPath: /var/lib/fluentd
 {% if openshift_logging_mux_client_mode is defined and
 {% if openshift_logging_mux_client_mode is defined and
@@ -234,6 +237,9 @@ spec:
       - name: dockercfg
       - name: dockercfg
         hostPath:
         hostPath:
           path: /etc/sysconfig/docker
           path: /etc/sysconfig/docker
+      - name: originnodecfg 
+        hostPath:
+          path: /etc/origin/node
       - name: dockerdaemoncfg
       - name: dockerdaemoncfg
         hostPath:
         hostPath:
           path: /etc/docker
           path: /etc/docker