Openshift Container Platform 4.6 Logging
Total Page:16
File Type:pdf, Size:1020Kb
OpenShift Container Platform 4.6 Logging Configuring cluster logging in OpenShift Container Platform Last Updated: 2021-09-21 OpenShift Container Platform 4.6 Logging Configuring cluster logging in OpenShift Container Platform Legal Notice Copyright © 2021 Red Hat, Inc. The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/ . In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates. XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries. Node.js ® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project. The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community. All other trademarks are the property of their respective owners. Abstract This document provides instructions for installing, configuring, and using cluster logging, which aggregates logs for a range of OpenShift Container Platform services. Table of Contents Table of Contents .C . H. .A . P. .T .E . R. 1.. .U . N. D. .E . R. S. .T . A. .N . D. .I N. G. C. .L . U. .S . T. E. .R . .L . O. .G . G. I.N . G. 6. 1.1. ABOUT DEPLOYING CLUSTER LOGGING 6 1.1.1. About cluster logging components 6 1.1.2. About the logging collector 7 1.1.3. About the log store 7 1.1.4. About logging visualization 8 1.1.5. About event routing 8 1.1.6. About log forwarding 8 .C . H. .A . P. .T .E . R. 2. I.N . .S .T . A. .L . L. .I N. .G . .C . L. .U . S. .T . E. R. L. .O . G. G. .I N. G. 9. 2.1. INSTALLING CLUSTER LOGGING USING THE WEB CONSOLE 9 2.2. POST-INSTALLATION TASKS 14 2.3. INSTALLING CLUSTER LOGGING USING THE CLI 14 2.4. POST-INSTALLATION TASKS 22 2.4.1. Defining Kibana index patterns 22 2.4.2. Allowing traffic between projects when network isolation is enabled 23 .C . H. .A . P. .T .E . R. 3. C. O. .N . F. .I G. U. .R . I.N . G. Y. .O . .U . R. C. .L .U . .S .T . E. .R . .L .O . .G . G. .I .N . G. D. .E . P. .L . O. .Y . M. E. .N . T. .2 . 5. 3.1. ABOUT THE CLUSTER LOGGING CUSTOM RESOURCE 25 3.1.1. About the ClusterLogging custom resource 25 3.2. CONFIGURING THE LOGGING COLLECTOR 26 3.2.1. About unsupported configurations 26 3.2.2. Viewing logging collector pods 27 3.2.3. Configure log collector CPU and memory limits 27 3.2.4. Advanced configuration for the log forwarder 28 3.2.5. Removing unused components if you do not use the default Elasticsearch log store 32 3.3. CONFIGURING THE LOG STORE 34 3.3.1. Forward audit logs to the log store 34 3.3.2. Configuring log retention time 36 3.3.3. Configuring CPU and memory requests for the log store 38 3.3.4. Configuring replication policy for the log store 39 3.3.5. Scaling down Elasticsearch pods 40 3.3.6. Configuring persistent storage for the log store 40 3.3.7. Configuring the log store for emptyDir storage 41 3.3.8. Performing an Elasticsearch rolling cluster restart 42 3.3.9. Exposing the log store service as a route 45 3.4. CONFIGURING THE LOG VISUALIZER 48 3.4.1. Configuring CPU and memory limits 48 3.4.2. Scaling redundancy for the log visualizer nodes 49 3.5. CONFIGURING CLUSTER LOGGING STORAGE 50 3.5.1. Storage considerations for cluster logging and OpenShift Container Platform 50 3.5.2. Additional resources 51 3.6. CONFIGURING CPU AND MEMORY LIMITS FOR CLUSTER LOGGING COMPONENTS 51 3.6.1. Configuring CPU and memory limits 51 3.7. USING TOLERATIONS TO CONTROL CLUSTER LOGGING POD PLACEMENT 52 3.7.1. Using tolerations to control the log store pod placement 54 3.7.2. Using tolerations to control the log visualizer pod placement 55 3.7.3. Using tolerations to control the log collector pod placement 56 3.7.4. Additional resources 57 3.8. MOVING THE CLUSTER LOGGING RESOURCES WITH NODE SELECTORS 57 3.8.1. Moving the cluster logging resources 57 1 OpenShift Container Platform 4.6 Logging 3.9. CONFIGURING SYSTEMD-JOURNALD AND FLUENTD 61 3.9.1. Configuring systemd-journald for cluster logging 61 3.10. CONFIGURING THE LOG CURATOR 64 3.10.1. Configuring the Curator schedule 64 3.10.2. Configuring Curator index deletion 65 3.11. MAINTENANCE AND SUPPORT 67 3.11.1. About unsupported configurations 67 3.11.2. Unsupported configurations 67 3.11.3. Support policy for unmanaged Operators 68 .C . H. .A . P. .T .E . R. 4. .V . I.E . W. I.N . G. L. .O . G. S. F. O. R. A. R . E. .S . O. .U . R. .C . E. .7 .0 . 4.1. VIEWING RESOURCE LOGS 70 .C . H. .A . P. .T .E . R. 5. V. .I .E .W . .I N. G. C. .L . U. .S . T. E. .R . .L . O. .G . .S . B. .Y . .U . S. .I N. .G . K. .I B. .A . N. .A . .7 . 2. 5.1. DEFINING KIBANA INDEX PATTERNS 72 5.2. VIEWING CLUSTER LOGS IN KIBANA 73 .C . H. .A . P. .T .E . R. 6. .F .O . .R . W. A. .R .D . .I N. .G . .L . O. G. .S . .T .O . T. .H . I.R . D. P. .A . R. .T .Y . .S . Y. .S . T. E. .M . .S . .7 . 6. 6.1. ABOUT FORWARDING LOGS TO THIRD-PARTY SYSTEMS 76 Fluentd log handling when the external log aggregator is unavailable 80 6.1.1. Forwarding logs to an external Elasticsearch instance 80 6.1.2. Forwarding logs using the Fluentd forward protocol 82 6.1.3. Forwarding logs using the syslog protocol 84 6.1.3.1. Syslog parameters 86 6.1.3.2. Additional RFC5424 syslog parameters 88 6.1.4. Forwarding logs to a Kafka broker 88 6.1.5. Forwarding application logs from specific projects 90 6.1.6. Forwarding logs using the legacy Fluentd method 92 6.1.7. Forwarding logs using the legacy syslog method 94 .C . H. .A . P. .T .E . R. 7. C. .O . .L . L. E. .C . T. .I N. .G . A. .N . D. S. .T .O . .R . I.N . G. .K .U . B. .E . R. .N . E. .T . E. S. E. .V . E. .N . T. .S . .9 .8 . 7.1. DEPLOYING AND CONFIGURING THE EVENT ROUTER 98 .C . H. .A . P. .T .E . R. 8. .U . P. .D . A. .T .I .N . G. C. .L . U. .S . T. .E .R . .L . O. .G . .G . I.N . G. .1 .0 . 2. 8.1. UPDATING CLUSTER LOGGING 102 8.2. UPDATING LOG FORWARDING CUSTOM RESOURCES 106 .C . H. .A . P. .T .E . R. 9. .V . I.E .W . .I .N . G. C. .L . U. .S . T. .E .R . .D . A. .S . H. .B . O. A. .R .D . .S . 1. 1.0 . 9.1. ACCESSING THE ELASTISEARCH AND OPENSHIFT LOGGING DASHBOARDS 110 9.2. ABOUT THE OPENSHIFT LOGGING DASHBOARD 110 9.3. CHARTS ON THE LOGGING/ELASTICSEARCH NODES DASHBOARD 112 .C . H. .A . P. .T .E . R. 1.0 . .. T. .R . O. .U . B. .L . E. .S .H . .O . O. T. I.N . .G . .C . L. .U . S. .T .E . R. L. .O . G. .G . .I N. .G . .1 1. 8. ..