This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Este conteúdo não está disponível no idioma selecionado.
Logging
Configuring cluster logging in OpenShift Container Platform
Abstract
Chapter 1. Understanding cluster logging and OpenShift Container Platform
As a cluster administrator, you can deploy cluster logging to aggregate all the logs from your OpenShift Container Platform cluster, such as node system logs, application container logs, and so forth.
1.1. Cluster logging
OpenShift Container Platform cluster administrators can deploy cluster logging using a few CLI commands and the OpenShift Container Platform web console to install the Elasticsearch Operator and Cluster Logging Operator. When the operators are installed, create a Cluster Logging Custom Resource (CR) to schedule cluster logging pods and other resources necessary to support cluster logging. The operators are responsible for deploying, upgrading, and maintaining cluster logging.
				You can configure cluster logging by modifying the Cluster Logging Custom Resource (CR), named instance. The CR defines a complete cluster logging deployment that includes all the components of the logging stack to collect, store and visualize logs. The Cluster Logging Operator watches the ClusterLogging Custom Resource and adjusts the logging deployment accordingly.
			
Administrators and application developers can view the logs of the projects for which they have view access.
1.1.1. Cluster logging components
The cluster logging components are based upon Elasticsearch, Fluentd, and Kibana (EFK). The collector, Fluentd, is deployed to each node in the OpenShift Container Platform cluster. It collects all node and container logs and writes them to Elasticsearch (ES). Kibana is the centralized, web UI where users and administrators can create rich visualizations and dashboards with the aggregated data.
There are currently 5 different types of cluster logging components:
- logStore - This is where the logs will be stored. The current implementation is Elasticsearch.
- collection - This is the component that collects logs from the node, formats them, and stores them in the logStore. The current implementation is Fluentd.
- visualization - This is the UI component used to view logs, graphs, charts, and so forth. The current implementation is Kibana.
- curation - This is the component that trims logs by age. The current implementation is Curator.
In this document, we may refer to logStore or Elasticsearch, visualization or Kibana, curation or Curator, collection or Fluentd, interchangeably, except where noted.
1.1.2. About the log store
OpenShift Container Platform uses Elasticsearch (ES) to organize the log data from Fluentd into datastores, or indices.
Elasticsearch subdivides each index into multiple pieces called shards, which it spreads across a set of Elasticsearch nodes in an Elasticsearch cluster. You can configure Elasticsearch to make copies of the shards, called replicas. Elasticsearch also spreads these replicas across the Elasticsearch nodes. The ClusterLogging Custom Resource allows you to specify the replication policy in the Custom Resource Definition (CRD) to provide data redundancy and resilience to failure.
The cluster logging Elasticsearch instance is optimized and tested for short term storage of approximately seven days. If you want to retain your logs over a longer term, it is recommended that you move the data to a third-party storage system.
The number of primary shards for the index templates is equal to the number of Elasticsearch data nodes.
The Cluster Logging Operator and companion Elasticsearch Operator ensure that each Elasticsearch node is deployed using a unique Deployment that includes its own storage volume. You can use a Cluster Logging Custom Resource (CR) to increase the number of Elasticsearch nodes. Refer to Elastic’s documentation for considerations involved in choosing storage and network location as directed below.
A highly-available Elasticsearch environment requires at least three Elasticsearch nodes, each on a different host.
					Role-based access control (RBAC) applied on the Elasticsearch indices enables the controlled access of the logs to the developers. Access to the indexes with the project.{project_name}.{project_uuid}.* format is restricted based on the permissions of the user in the specific project.
				
For more information, see Elasticsearch (ES).
1.1.3. About the logging collector
OpenShift Container Platform uses Fluentd to collect data about your cluster.
					The logging collector is deployed as a DaemonSet in OpenShift Container Platform that deploys pods to each OpenShift Container Platform node. journald is the system log source supplying log messages from the operating system, the container runtime, and OpenShift Container Platform.
				
The container runtimes provide minimal information to identify the source of log messages: project, pod name, and container id. This is not sufficient to uniquely identify the source of the logs. If a pod with a given name and project is deleted before the log collector begins processing its logs, information from the API server, such as labels and annotations, might not be available. There might not be a way to distinguish the log messages from a similarly named pod and project or trace the logs to their source. This limitation means log collection and normalization is considered best effort.
The available container runtimes provide minimal information to identify the source of log messages and do not guarantee unique individual log messages or that these messages can be traced to their source.
For more information, see Fluentd.
1.1.4. About logging visualization
OpenShift Container Platform uses Kibana to display the log data collected by Fluentd and indexed by Elasticsearch.
Kibana is a browser-based console interface to query, discover, and visualize your Elasticsearch data through histograms, line graphs, pie charts, heat maps, built-in geospatial support, and other visualizations.
For more information, see Kibana.
1.1.5. About logging curation
The Elasticsearch Curator tool performs scheduled maintenance operations on a global and/or on a per-project basis. Curator performs actions based on its configuration. Only one Curator Pod is recommended per Elasticsearch cluster.
- 1
- Specify the Curator schedule in the cron format.
For more information, see Curator.
1.1.6. About event routing
					The Event Router is a Pod that watches OpenShift Container Platform events so they can be collected by cluster logging. The Event Router collects events from all projects and writes them to STDOUT. Fluentd collects those events and forwards them into the OpenShift Container Platform Elasticsearch instance. Elasticsearch indexes the events to the infra index.
				
You must manually deploy the Event Router.
1.1.7. About the Cluster Logging Custom Resource
To make changes to your cluster logging deployment, create and modify the Cluster Logging Custom Resource (CR). Instructions for creating or modifying a CR are provided in this documentation as appropriate.
The following is an example of a typical Custom Resource for cluster logging.
Sample Cluster Logging CR
Chapter 2. About deploying cluster logging
Before installing cluster logging into your OpenShift Container Platform cluster, review the following sections.
2.1. About deploying and configuring cluster logging
OpenShift Container Platform cluster logging is designed to be used with the default configuration, which is tuned for small to medium sized OpenShift Container Platform clusters.
The installation instructions that follow include a sample Cluster Logging Custom Resource (CR), which you can use to create a cluster logging instance and configure your cluster logging deployment.
If you want to use the default cluster logging install, you can use the sample CR directly.
If you want to customize your deployment, make changes to the sample CR as needed. The following describes the configurations you can make when installing your cluster logging instance or modify after installation. See the Configuring sections for more information on working with each component, including modifications you can make outside of the Cluster Logging Custom Resource.
2.1.1. Configuring and Tuning Cluster Logging
					You can configure your cluster logging environment by modifying the Cluster Logging Custom Resource deployed in the openshift-logging project.
				
You can modify any of the following components upon install or after install:
- Memory and CPU
- 
								You can adjust both the CPU and memory limits for each component by modifying the resourcesblock with valid memory and CPU values:
- Elasticsearch storage
- 
								You can configure a persistent storage class and size for the Elasticsearch cluster using the storageClassnameandsizeparameters. The Cluster Logging Operator creates aPersistentVolumeClaimfor each data node in the Elasticsearch cluster based on these parameters.
					This example specifies each data node in the cluster will be bound to a PersistentVolumeClaim that requests "200G" of "gp2" storage. Each primary shard will be backed by a single replica.
				
						Omitting the storage block results in a deployment that includes ephemeral storage only.
					
- Elasticsearch replication policy
- You can set the policy that defines how Elasticsearch shards are replicated across data nodes in the cluster: - 
										FullRedundancy. The shards for each index are fully replicated to every data node.
- 
										MultipleRedundancy. The shards for each index are spread over half of the data nodes.
- 
										SingleRedundancy. A single copy of each shard. Logs are always available and recoverable as long as at least two data nodes exist.
- 
										ZeroRedundancy. No copies of any shards. Logs may be unavailable (or lost) in the event a node is down or fails.
 
- 
										
- Curator schedule
- You specify the schedule for Curator in the cron format.
2.1.2. Sample modified Cluster Logging Custom Resource
The following is an example of a Cluster Logging Custom Resource modified using the options previously described.
Sample modified Cluster Logging Custom Resource
2.2. Storage considerations for cluster logging and OpenShift Container Platform
A persistent volume is required for each Elasticsearch deployment to have one data volume per data node. On OpenShift Container Platform this is achieved using Persistent Volume Claims.
The Elasticsearch Operator names the PVCs using the Elasticsearch resource name. Refer to Persistent Elasticsearch Storage for more details.
Fluentd ships any logs from systemd journal and /var/log/containers/ to Elasticsearch.
Therefore, consider how much data you need in advance and that you are aggregating application log data. Some Elasticsearch users have found that it is necessary to keep absolute storage consumption around 50% and below 70% at all times. This helps to avoid Elasticsearch becoming unresponsive during large merge operations.
By default, at 85% Elasticsearch stops allocating new data to the node, at 90% Elasticsearch attempts to relocate existing shards from that node to other nodes if possible. But if no nodes have free capacity below 85%, Elasticsearch effectively rejects creating new indices and becomes RED.
These low and high watermark values are Elasticsearch defaults in the current release. You can modify these values, but you also must apply any modifications to the alerts also. The alerts are based on these defaults.
2.3. Additional resources
For more information on installing operators,see Installing Operators from the OperatorHub.
Chapter 3. Deploying cluster logging
You can install cluster logging by deploying the Elasticsearch and Cluster Logging Operators. The Elasticsearch Operator creates and manages the Elasticsearch cluster used by cluster logging. The Cluster Logging Operator creates and manages the components of the logging stack.
The process for deploying cluster logging to OpenShift Container Platform involves:
- Reviewing the installation options in About deploying cluster logging.
- Reviewing the cluster logging storage considerations.
- Installing the Elasticsearch Operator and Cluster Logging Operator.
3.1. Install the Elasticsearch Operator using the CLI
You must install the Elasticsearch Operator using the CLI following the directions below.
Prerequisites
Ensure that you have the necessary persistent storage for Elasticsearch. Note that each Elasticsearch node requires its own storage volume.
Elasticsearch is a memory-intensive application. By default, OpenShift Container Platform installs three Elasticsearch nodes with memory requests and limits of 16 GB. This initial set of three OpenShift Container Platform nodes might not have enough memory to run Elasticsearch within your cluster. If you experience memory issues that are related to Elasticsearch, you should add more Elasticsearch nodes to your cluster rather than increasing the memory on exiting nodes.
Procedure
To install the Elasticsearch Operator using the CLI:
- Create a Namespace for the Elasticsearch Operator. - Create a Namespace object YAML file (for example, - eo-namespace.yaml) for the Elasticsearch Operator:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- You must specify theopenshift-operators-redhatNamespace. To prevent possible conflicts with metrics, you should configure the Prometheus Cluster Monitoring stack to scrape metrics from theopenshift-operators-redhatNamespace and not theopenshift-operatorsNamespace. Theopenshift-operatorsNamespace might contain Community Operators, which are untrusted and could publish a metric with the same name as an OpenShift Container Platform metric, which would cause conflicts.
- 2
- You must specify this label as shown to ensure that cluster monitoring scrapes theopenshift-operators-redhatNamespace.
 
- Create the Namespace: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f eo-namespace.yaml - $ oc create -f eo-namespace.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Install the Elasticsearch Operator by creating the following objects: - Create an Operator Group object YAML file (for example, - eo-og.yaml) for the Elasticsearch operator:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- You must specify theopenshift-operators-redhatNamespace.
 
- Create an Operator Group object: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f eo-og.yaml - $ oc create -f eo-og.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create a Subscription object YAML file (for example, - eo-sub.yaml) to subscribe a Namespace to an Operator.- Example Subscription - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- You must specify theopenshift-operators-redhatNamespace.
- 2
- Specify4.3as the channel.
- 3
- Specifyredhat-operators. If your OpenShift Container Platform cluster is installed on a restricted network, also known as a disconnected cluster, specify the name of the CatalogSource object created when you configured the Operator Lifecycle Manager (OLM).
 
- Create the Subscription object: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f eo-sub.yaml - $ oc create -f eo-sub.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Change to the - openshift-operators-redhatproject:- oc project openshift-operators-redhat - $ oc project openshift-operators-redhat Now using project "openshift-operators-redhat"- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create a Role-based Access Control (RBAC) object file (for example, - eo-rbac.yaml) to grant Prometheus permission to access the- openshift-operators-redhatNamespace:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the RBAC object: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f eo-rbac.yaml - $ oc create -f eo-rbac.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The Elasticsearch Operator is installed to the - openshift-operators-redhatNamespace and copied to each project in the cluster.
 
- Verify the Operator installation: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - There should be an Elasticsearch Operator in each Namespace. The version number might be different than shown. 
Next step
Install the Cluster Logging Operator using the Console or the CLI using the steps in the following sections.
3.2. Install the Cluster Logging Operator using the web console
You can use the OpenShift Container Platform web console to install the Cluster Logging Operator.
					You cannot create a Project starting with openshift- using the web console or by using the oc new-project command. You must create a Namespace using a YAML object file and run the oc create -f <file-name>.yaml command, as shown.
				
Procedure
To install the Cluster Logging Operator using the OpenShift Container Platform web console:
- Create a Namespace for the Cluster Logging Operator. You must use the CLI to create the Namespace. - Create a Namespace object YAML file (for example, - clo-namespace.yaml) for the Cluster Logging Operator:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the Namespace: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f clo-namespace.yaml - $ oc create -f clo-namespace.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Install the Cluster Logging Operator: - In the OpenShift Container Platform web console, click Operators → OperatorHub.
- Choose Cluster Logging from the list of available Operators, and click Install.
- On the Create Operator Subscription page, under A specific Namespace on the cluster select openshift-logging. Then, click Subscribe.
 
- Verify that the Cluster Logging Operator installed: - Switch to the Operators → Installed Operators page.
- Ensure that Cluster Logging is listed in the openshift-logging project with a Status of InstallSucceeded. Note- During installation an Operator might display a Failed status. If the Operator then installs with an InstallSucceeded message, you can safely ignore the Failed message. - If the Operator does not appear as installed, to troubleshoot further: - Switch to the Operators → Installed Operators page and inspect the Status column for any errors or failures.
- 
										Switch to the Workloads → Pods page and check the logs in any Pods in the openshift-loggingandopenshift-operators-redhatprojects that are reporting issues.
 
 
- Create a cluster logging instance: - Switch to the Administration → Custom Resource Definitions page.
- On the Custom Resource Definitions page, click ClusterLogging.
- On the Custom Resource Definition Overview page, select View Instances from the Actions menu.
- On the Cluster Loggings page, click Create Cluster Logging. - You might have to refresh the page to load the data. 
- In the YAML field, replace the code with the following: Note- This default cluster logging configuration should support a wide array of environments. Review the topics on tuning and configuring the cluster logging components for information on modifications you can make to your cluster logging cluster. - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- The name must beinstance.
- 2
- The cluster logging management state. In most cases, if you change the cluster logging defaults, you must set this toUnmanaged. However, an unmanaged deployment does not receive updates until the cluster logging is placed back into a managed state. For more information, see Changing cluster logging management state.
- 3
- Settings for configuring Elasticsearch. Using the CR, you can configure shard replication policy and persistent storage. For more information, see Configuring Elasticsearch.
- 4
- Specify the number of Elasticsearch nodes. See the note that follows this list.
- 5
- Enter the name of an existing StorageClass for Elasticsearch storage. For best performance, specify a StorageClass that allocates block storage.
- 6
- Settings for configuring Kibana. Using the CR, you can scale Kibana for redundancy and configure the CPU and memory for your Kibana nodes. For more information, see Configuring Kibana.
- 7
- Settings for configuring Curator. Using the CR, you can set the Curator schedule. For more information, see Configuring Curator.
- 8
- Settings for configuring Fluentd. Using the CR, you can configure Fluentd CPU and memory limits. For more information, see Configuring Fluentd.
 Note- The maximum number of Elasticsearch master nodes is three. If you specify a - nodeCountgreater than- 3, OpenShift Container Platform creates three Elasticsearch nodes that are Master-eligible nodes, with the master, client, and data roles. The additional Elasticsearch nodes are created as Data-only nodes, using client and data roles. Master nodes perform cluster-wide actions such as creating or deleting an index, shard allocation, and tracking nodes. Data nodes hold the shards and perform data-related operations such as CRUD, search, and aggregations. Data-related operations are I/O-, memory-, and CPU-intensive. It is important to monitor these resources and to add more Data nodes if the current nodes are overloaded.- For example, if - nodeCount=4, the following nodes are created:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The number of primary shards for the index templates is equal to the number of Elasticsearch data nodes. 
- Click Create. This creates the Cluster Logging Custom Resource and Elasticsearch Custom Resource, which you can edit to make changes to your cluster logging cluster.
 
- Verify the install: - Switch to the Workloads → Pods page.
- Select the openshift-logging project. - You should see several Pods for cluster logging, Elasticsearch, Fluentd, and Kibana similar to the following list: - cluster-logging-operator-cb795f8dc-xkckc
- elasticsearch-cdm-b3nqzchd-1-5c6797-67kfz
- elasticsearch-cdm-b3nqzchd-2-6657f4-wtprv
- elasticsearch-cdm-b3nqzchd-3-588c65-clg7g
- fluentd-2c7dg
- fluentd-9z7kk
- fluentd-br7r2
- fluentd-fn2sb
- fluentd-pb2f8
- fluentd-zqgqx
- kibana-7fb4fd4cc9-bvt4p
 
 
3.3. Install the Cluster Logging Operator using the CLI
You can use the OpenShift Container Platform CLI to install the Cluster Logging Operator. The Cluster Logging Operator creates and manages the components of the logging stack.
Procedure
To install the Cluster Logging Operator using the CLI:
- Create a Namespace for the Cluster Logging Operator: - Create a Namespace object YAML file (for example, - clo-namespace.yaml) for the Cluster Logging Operator:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the Namespace: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f clo-namespace.yaml - $ oc create -f clo-namespace.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Install the Cluster Logging Operator by creating the following objects: - Create an OperatorGroup object YAML file (for example, - clo-og.yaml) for the Cluster Logging Operator:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the OperatorGroup object: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f clo-og.yaml - $ oc create -f clo-og.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create a Subscription object YAML file (for example, - clo-sub.yaml) to subscribe a Namespace to an Operator.- Example Subscription - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- You must specify theopenshift-loggingNamespace.
- 2
- Specify4.3as the channel.
- 3
- Specifyredhat-operators. If your OpenShift Container Platform cluster is installed on a restricted network, also known as a disconnected cluster, specify the name of the CatalogSource object you created when you configured the Operator Lifecycle Manager (OLM).
 
- Create the Subscription object: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f clo-sub.yaml - $ oc create -f clo-sub.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The Cluster Logging Operator is installed to the - openshift-loggingNamespace.
 
- Verify the Operator installation. - There should be a Cluster Logging Operator in the - openshift-loggingNamespace. The Version number might be different than shown.- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create a Cluster Logging instance: - Create an instance object YAML file (for example, - clo-instance.yaml) for the Cluster Logging Operator:Note- This default Cluster Logging configuration should support a wide array of environments. Review the topics on tuning and configuring the Cluster Logging components for information on modifications you can make to your Cluster Logging cluster. - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- The name must beinstance.
- 2
- The Cluster Logging management state. In most cases, if you change the Cluster Logging defaults, you must set this toUnmanaged. However, an unmanaged deployment does not receive updates until Cluster Logging is placed back into theManagedstate. For more information, see Changing cluster logging management state.
- 3
- Settings for configuring Elasticsearch. Using the Custom Resource (CR), you can configure shard replication policy and persistent storage. For more information, see Configuring Elasticsearch.
- 4
- Specify the number of Elasticsearch nodes. See the note that follows this list.
- 5
- Enter the name of an existing StorageClass for Elasticsearch storage. For best performance, specify a StorageClass that allocates block storage.
- 6
- Settings for configuring Kibana. Using the CR, you can scale Kibana for redundancy and configure the CPU and memory for your Kibana nodes. For more information, see Configuring Kibana.
- 7
- Settings for configuring Curator. Using the CR, you can set the Curator schedule. For more information, see Configuring Curator.
- 8
- Settings for configuring Fluentd. Using the CR, you can configure Fluentd CPU and memory limits. For more information, see Configuring Fluentd.
 Note- The maximum number of Elasticsearch master nodes is three. If you specify a - nodeCountgreater than- 3, OpenShift Container Platform creates three Elasticsearch nodes that are Master-eligible nodes, with the master, client, and data roles. The additional Elasticsearch nodes are created as Data-only nodes, using client and data roles. Master nodes perform cluster-wide actions such as creating or deleting an index, shard allocation, and tracking nodes. Data nodes hold the shards and perform data-related operations such as CRUD, search, and aggregations. Data-related operations are I/O-, memory-, and CPU-intensive. It is important to monitor these resources and to add more Data nodes if the current nodes are overloaded.- For example, if - nodeCount=4, the following nodes are created:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The number of primary shards for the index templates is equal to the number of Elasticsearch data nodes. 
- Create the instance: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create -f clo-instance.yaml - $ oc create -f clo-instance.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Verify the install by listing the Pods in the openshift-logging project. - You should see several Pods for Cluster Logging, Elasticsearch, Fluentd, and Kibana similar to the following list: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
3.4. Additional resources
For more information on installing Operators,see Installing Operators from the OperatorHub.
Chapter 4. Updating cluster logging
After updating the OpenShift Container Platform cluster from 4.2 to 4.3, you must then upgrade cluster logging from 4.2 to 4.3.
4.1. Updating cluster logging
After updating the OpenShift Container Platform cluster, you can update cluster logging from 4.2 to 4.3 by updating the subscription for the Elasticsearch Operator and the Cluster Logging Operator.
					Changes introduced by the new log forward feature modified the support for out_forward starting with the OpenShift Container Platform 4.3 release. In OpenShift Container Platform 4.3, you create a ConfigMap to configure out_forward. Any updates to the secure-forward.conf section of the Fluentd ConfigMap are removed.
				
					If you use the out_forward plug-in, before updating, you can copy your current secure-forward.conf section from the Fluentd ConfigMap and use the copied data when you create the secure-forward ConfigMap.
				
Prerequisites
- Update the cluster from 4.2 to 4.3.
- Make sure the cluster logging status is healthy: - 
								All Pods are ready.
- Elasticsearch cluster is healthy.
 
- 
								All Pods are 
- 
						Optionally, copy your current secure-forward.confsection from the Fluentd ConfigMap for use if you want to create thesecure-forwardConfigMap. See the note above.
Procedure
- Update the Elasticsearch Operator: - From the web console, click Operators → Installed Operators.
- 
								Select the openshift-loggingproject.
- Click the Elasticsearch Operator.
- Click Subscription → Channel.
- In the Change Subscription Update Channel window, select 4.3 and click Save.
- Wait for a few seconds, then click Operators → Installed Operators. - The Elasticsearch Operator is shown as 4.3. For example: - Elasticsearch Operator 4.3.0-201909201915 provided by Red Hat, Inc - Elasticsearch Operator 4.3.0-201909201915 provided by Red Hat, Inc- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Update the Cluster Logging Operator: - From the web console, click Operators → Installed Operators.
- 
								Select the openshift-loggingProject.
- Click the Cluster Logging Operator.
- Click Subscription → Channel.
- In the Change Subscription Update Channel window, select 4.3 and click Save.
- Wait for a few seconds, then click Operators → Installed Operators. - The Cluster Logging Operator is shown as 4.3. For example: - Cluster Logging 4.3.0-201909201915 provided by Red Hat, Inc - Cluster Logging 4.3.0-201909201915 provided by Red Hat, Inc- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Check the logging components: - Ensure that the Elasticsearch Pods are using a 4.3 image: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Ensure that all Elasticsearch Pods are in the Ready status: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Ensure that the Elasticsearch cluster is healthy: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Ensure that the logging collector Pods are using a 4.3 image: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Ensure that the Kibana Pods are using a 4.3 image: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Ensure that the Curator CronJob is using a 4.3 image: - $ oc get CronJob curator -n openshift-logging -o yaml |grep 'image:' - $ $ oc get CronJob curator -n openshift-logging -o yaml |grep 'image:' image: registry.redhat.io/openshift4/ose-logging-curator5:v4.3.0-202001081344- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
Chapter 5. Viewing cluster logs
You can view OpenShift Container Platform cluster logs in the CLI or OpenShift Container Platform web console.
5.1. Viewing cluster logs
You can view cluster logs in the CLI.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
To view cluster logs:
				Use the oc logs [-f] <pod_name> command, where the -f is optional.
			
oc logs -f <any-fluentd-pod> -n openshift-logging
$ oc logs -f <any-fluentd-pod> -n openshift-logging - 1
- Specify the name of a log collector pod. Use the-foption to follow what is being written into the logs.
For example
oc logs -f fluentd-ht42r -n openshift-logging
$ oc logs -f fluentd-ht42r -n openshift-loggingThe contents of log files are printed out.
By default, Fluentd reads logs from the tail, or end, of the log.
5.2. Viewing cluster logs in the OpenShift Container Platform web console
You can view cluster logs in the OpenShift Container Platform web console .
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
To view cluster logs:
- In the OpenShift Container Platform console, navigate to Workloads → Pods.
- 
						Select the openshift-loggingproject from the drop-down menu.
- 
						Click one of the logging collector pods with the fluentdprefix.
- Click Logs.
By default, Fluentd reads logs from the tail, or end, of the log.
Chapter 6. Viewing cluster logs using Kibana
The cluster logging installation deploys the Kibana web console.
6.1. Launching Kibana
Kibana is a browser-based console to query, discover, and visualize your logs through histograms, line graphs, pie charts, heat maps, built-in geospatial support, and other visualizations.
Prerequisites
					If you installed OpenShift Container Platform with a proxy, you need to add .apps.<cluster_name>.<base_domain> to the noProxy list in your cluster-wide Proxy object.
				
For example:
- 1
- Add.apps.<cluster_name>.<base_domain>to thenoProxylist. This is a comma-separated list of destination domain names, domains, IP addresses, or other network CIDRs to exclude proxying.
Procedure
To launch Kibana:
- In the OpenShift Container Platform console, click Monitoring → Logging.
- Log in using the same credentials you use to log in to the OpenShift Container Platform console. - The Kibana interface launches. You can now: - Search and browse your data using the Discover page.
- Chart and map your data using the Visualize page.
- Create and view custom dashboards using the Dashboard page. - Use and configuration of the Kibana interface is beyond the scope of this documentation. For more information, on using the interface, see the Kibana documentation. 
 
If you get a security_exception error in the Kibana console and cannot access your Kibana indices, you might have an expired OAuth token. If you see this error, log out of the Kibana console, and then log back in. This refreshes your OAuth tokens and you should be able to access your indices.
Chapter 7. Configuring your cluster logging deployment
7.1. About configuring cluster logging
After installing cluster logging into your OpenShift Container Platform cluster, you can make the following configurations.
You must set cluster logging to Unmanaged state before performing these configurations, unless otherwise noted. For more information, see Changing the cluster logging management state.
Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
For more information, see Support policy for unmanaged Operators.
7.1.1. About deploying and configuring cluster logging
OpenShift Container Platform cluster logging is designed to be used with the default configuration, which is tuned for small to medium sized OpenShift Container Platform clusters.
The installation instructions that follow include a sample Cluster Logging Custom Resource (CR), which you can use to create a cluster logging instance and configure your cluster logging deployment.
If you want to use the default cluster logging install, you can use the sample CR directly.
If you want to customize your deployment, make changes to the sample CR as needed. The following describes the configurations you can make when installing your cluster logging instance or modify after installation. See the Configuring sections for more information on working with each component, including modifications you can make outside of the Cluster Logging Custom Resource.
7.1.1.1. Configuring and Tuning Cluster Logging
						You can configure your cluster logging environment by modifying the Cluster Logging Custom Resource deployed in the openshift-logging project.
					
You can modify any of the following components upon install or after install:
- Memory and CPU
- 
									You can adjust both the CPU and memory limits for each component by modifying the resourcesblock with valid memory and CPU values:
- Elasticsearch storage
- 
									You can configure a persistent storage class and size for the Elasticsearch cluster using the storageClassnameandsizeparameters. The Cluster Logging Operator creates aPersistentVolumeClaimfor each data node in the Elasticsearch cluster based on these parameters.
						This example specifies each data node in the cluster will be bound to a PersistentVolumeClaim that requests "200G" of "gp2" storage. Each primary shard will be backed by a single replica.
					
							Omitting the storage block results in a deployment that includes ephemeral storage only.
						
- Elasticsearch replication policy
- You can set the policy that defines how Elasticsearch shards are replicated across data nodes in the cluster: - 
											FullRedundancy. The shards for each index are fully replicated to every data node.
- 
											MultipleRedundancy. The shards for each index are spread over half of the data nodes.
- 
											SingleRedundancy. A single copy of each shard. Logs are always available and recoverable as long as at least two data nodes exist.
- 
											ZeroRedundancy. No copies of any shards. Logs may be unavailable (or lost) in the event a node is down or fails.
 
- 
											
- Curator schedule
- You specify the schedule for Curator in the cron format.
7.1.1.2. Sample modified Cluster Logging Custom Resource
The following is an example of a Cluster Logging Custom Resource modified using the options previously described.
Sample modified Cluster Logging Custom Resource
7.2. Changing cluster logging management state
In order to modify certain components managed by the Cluster Logging Operator or the Elasticsearch Operator, you must set the operator to the unmanaged state.
In unmanaged state, the operators do not respond to changes in the CRs. The administrator assumes full control of individual component configurations and upgrades when in unmanaged state.
Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
For more information, see Support policy for unmanaged Operators.
In managed state, the Cluster Logging Operator (CLO) responds to changes in the Cluster Logging Custom Resource (CR) and adjusts the logging deployment accordingly.
The OpenShift Container Platform documentation indicates in a prerequisite step when you must set the OpenShift Container Platform cluster to Unmanaged.
If you set the Elasticsearch Operator (EO) to unmanaged and leave the Cluster Logging Operator (CLO) as managed, the CLO will revert changes you make to the EO, as the EO is managed by the CLO.
7.2.1. Changing the cluster logging management state
You must set the operator to the unmanaged state in order to modify the components managed by the Cluster Logging Operator:
- the Curator CronJob,
- the Elasticsearch CR,
- the Kibana Deployment,
- the log collector DaemonSet.
If you make changes to these components in managed state, the Cluster Logging Operator reverts those changes.
An unmanaged cluster logging environment does not receive updates until you return the Cluster Logging Operator to Managed state.
Prerequisites
- The Cluster Logging Operator must be installed.
Procedure
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the management state asManagedorUnmanaged.
 
7.2.2. Changing the Elasticsearch management state
You must set the operator to the unmanaged state in order to modify the Elasticsearch deployment files, which are managed by the Elasticsearch Operator.
If you make changes to these components in managed state, the Elasticsearch Operator reverts those changes.
An unmanaged Elasticsearch cluster does not receive updates until you return the Elasticsearch Operator to Managed state.
Prerequisite
- The Elasticsearch Operator must be installed.
- Have the name of the Elasticsearch CR, in the - openshift-loggingproject:- oc get -n openshift-logging Elasticsearch - $ oc get -n openshift-logging Elasticsearch NAME AGE elasticsearch 28h- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Procedure
						Edit the Elasticsearch Custom Resource (CR) in the openshift-logging project:
					
- 1
- Specify the management state asManagedorUnmanaged.
If you set the Elasticsearch Operator (EO) to unmanaged and leave the Cluster Logging Operator (CLO) as managed, the CLO will revert changes you make to the EO, as the EO is managed by the CLO.
7.3. Configuring cluster logging
				Cluster logging is configurable using a Cluster Logging Custom Resource (CR) deployed in the openshift-logging project.
			
The Cluster Logging Operator watches for changes to Cluster Logging CRs, creates any missing logging components, and adjusts the logging deployment accordingly.
The Cluster Logging CR is based on the Cluster Logging Custom Resource Definition (CRD), which defines a complete cluster logging deployment and includes all the components of the logging stack to collect, store and visualize logs.
Sample Cluster Logging Custom Resource (CR)
You can configure the following for cluster logging:
- You can place cluster logging into an unmanaged state that allows an administrator to assume full control of individual component configurations and upgrades.
- 
						You can overwrite the image for each cluster logging component by modifying the appropriate environment variable in the cluster-logging-operatorDeployment.
- You can specify specific nodes for the logging components using node selectors.
7.3.1. Understanding the cluster logging component images
There are several components in cluster logging, each one implemented with one or more images. Each image is specified by an environment variable defined in the cluster-logging-operator deployment in the openshift-logging project and should not be changed.
You can view the images by running the following command:
oc -n openshift-logging set env deployment/cluster-logging-operator --list | grep _IMAGE
$ oc -n openshift-logging set env deployment/cluster-logging-operator --list | grep _IMAGEELASTICSEARCH_IMAGE=registry.redhat.io/openshift4/ose-logging-elasticsearch5:v4.3 FLUENTD_IMAGE=registry.redhat.io/openshift4/ose-logging-fluentd:v4.3 KIBANA_IMAGE=registry.redhat.io/openshift4/ose-logging-kibana5:v4.3 CURATOR_IMAGE=registry.redhat.io/openshift4/ose-logging-curator5:v4.3 OAUTH_PROXY_IMAGE=registry.redhat.io/openshift4/ose-oauth-proxy:v4.3
ELASTICSEARCH_IMAGE=registry.redhat.io/openshift4/ose-logging-elasticsearch5:v4.3 
FLUENTD_IMAGE=registry.redhat.io/openshift4/ose-logging-fluentd:v4.3 
KIBANA_IMAGE=registry.redhat.io/openshift4/ose-logging-kibana5:v4.3 
CURATOR_IMAGE=registry.redhat.io/openshift4/ose-logging-curator5:v4.3 
OAUTH_PROXY_IMAGE=registry.redhat.io/openshift4/ose-oauth-proxy:v4.3 The values might be different depending on your environment.
The logging routes are managed by the Cluster Logging Operator and cannot be modified by the user.
7.4. Configuring Elasticsearch to store and organize log data
OpenShift Container Platform uses Elasticsearch (ES) to store and organize the log data.
Some of the modifications you can make to your log store include:
- storage for your Elasticsearch cluster;
- how shards are replicated across data nodes in the cluster, from full replication to no replication;
- allowing external access to Elasticsearch data.
Scaling down Elasticsearch nodes is not supported. When scaling down, Elasticsearch pods can be accidentally deleted, possibly resulting in shards not being allocated and replica shards being lost.
Elasticsearch is a memory-intensive application. Each Elasticsearch node needs 16G of memory for both memory requests and limits, unless you specify otherwise in the Cluster Logging Custom Resource. The initial set of OpenShift Container Platform nodes might not be large enough to support the Elasticsearch cluster. You must add additional nodes to the OpenShift Container Platform cluster to run with the recommended or higher memory.
Each Elasticsearch node can operate with a lower memory setting though this is not recommended for production deployments.
If you set the Elasticsearch Operator (EO) to unmanaged and leave the Cluster Logging Operator (CLO) as managed, the CLO will revert changes you make to the EO, as the EO is managed by the CLO.
7.4.1. Configuring Elasticsearch CPU and memory limits
Each component specification allows for adjustments to both the CPU and memory limits. You should not have to manually adjust these values as the Elasticsearch Operator sets values sufficient for your environment.
Each Elasticsearch node can operate with a lower memory setting though this is not recommended for production deployments. For production use, you should have no less than the default 16Gi allocated to each Pod. Preferably you should allocate as much as possible, up to 64Gi per Pod.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the CPU and memory limits as needed. If you leave these values blank, the Elasticsearch Operator sets default values that should be sufficient for most deployments.
 - If you adjust the amount of Elasticsearch CPU and memory, you must change both the request value and the limit value. - For example: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Kubernetes generally adheres the node CPU configuration and DOES not allow Elasticsearch to use the specified limits. Setting the same value for the - requestsand- limitsensures that Elasticseach can use the CPU and memory you want, assuming the node has the CPU and memory available.
7.4.2. Configuring Elasticsearch replication policy
You can define how Elasticsearch shards are replicated across data nodes in the cluster.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit clusterlogging instance - oc edit clusterlogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify a redundancy policy for the shards. The change is applied upon saving the changes.- FullRedundancy. Elasticsearch fully replicates the primary shards for each index to every data node. This provides the highest safety, but at the cost of the highest amount of disk required and the poorest performance.
- MultipleRedundancy. Elasticsearch fully replicates the primary shards for each index to half of the data nodes. This provides a good tradeoff between safety and performance.
- SingleRedundancy. Elasticsearch makes one copy of the primary shards for each index. Logs are always available and recoverable as long as at least two data nodes exist. Better performance than MultipleRedundancy, when using 5 or more nodes. You cannot apply this policy on deployments of single Elasticsearch node.
- ZeroRedundancy. Elasticsearch does not make copies of the primary shards. Logs might be unavailable or lost in the event a node is down or fails. Use this mode when you are more concerned with performance than safety, or have implemented your own disk/PVC backup/restore strategy.
 
 
The number of primary shards for the index templates is equal to the number of Elasticsearch data nodes.
7.4.3. Configuring Elasticsearch storage
Elasticsearch requires persistent storage. The faster the storage, the faster the Elasticsearch performance.
Using NFS storage as a volume or a persistent volume (or via NAS such as Gluster) is not supported for Elasticsearch storage, as Lucene relies on file system behavior that NFS does not supply. Data corruption and other problems can occur.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Edit the Cluster Logging CR to specify that each data node in the cluster is bound to a Persistent Volume Claim. - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
This example specifies each data node in the cluster is bound to a Persistent Volume Claim that requests "200G" of AWS General Purpose SSD (gp2) storage.
7.4.4. Configuring Elasticsearch for emptyDir storage
You can use emptyDir with Elasticsearch, which creates an ephemeral deployment in which all of a pod’s data is lost upon restart.
When using emptyDir, if Elasticsearch is restarted or redeployed, you will lose data.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Edit the Cluster Logging CR to specify emptyDir: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
7.4.5. Exposing Elasticsearch as a route
By default, Elasticsearch deployed with cluster logging is not accessible from outside the logging cluster. You can enable a route with re-encryption termination for external access to Elasticsearch for those tools that access its data.
Externally, you can access Elasticsearch by creating a reencrypt route, your OpenShift Container Platform token and the installed Elasticsearch CA certificate. Then, access an Elasticsearch node with a cURL request that contains:
- 
							The Authorization: Bearer ${token}
- The Elasticsearch reencrypt route and an Elasticsearch API request.
Internally, you can access Elastiscearch using the Elasticsearch cluster IP:
You can get the Elasticsearch cluster IP using either of the following commands:
oc get service elasticsearch -o jsonpath={.spec.clusterIP} -n openshift-logging
$ oc get service elasticsearch -o jsonpath={.spec.clusterIP} -n openshift-logging
172.30.183.229Prerequisites
- Cluster logging and Elasticsearch must be installed.
- You must have access to the project in order to be able to access to the logs.
Procedure
To expose Elasticsearch externally:
- Change to the - openshift-loggingproject:- oc project openshift-logging - $ oc project openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Extract the CA certificate from Elasticsearch and write to the admin-ca file: - oc extract secret/elasticsearch --to=. --keys=admin-ca - $ oc extract secret/elasticsearch --to=. --keys=admin-ca admin-ca- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the route for the Elasticsearch service as a YAML file: - Create a YAML file with the following: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Add the Elasticsearch CA certifcate or use the command in the next step. You do not have to set thespec.tls.key,spec.tls.certificate, andspec.tls.caCertificateparameters required by some reencrypt routes.
 
- Run the following command to add the Elasticsearch CA certificate to the route YAML you created: - cat ./admin-ca | sed -e "s/^/ /" >> <file-name>.yaml - cat ./admin-ca | sed -e "s/^/ /" >> <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the route: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml route.route.openshift.io/elasticsearch created- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Check that the Elasticsearch service is exposed: - Get the token of this ServiceAccount to be used in the request: - token=$(oc whoami -t) - $ token=$(oc whoami -t)- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Set the elasticsearch route you created as an environment variable. - routeES=`oc get route elasticsearch -o jsonpath={.spec.host}`- $ routeES=`oc get route elasticsearch -o jsonpath={.spec.host}`- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- To verify the route was successfully created, run the following command that accesses Elasticsearch through the exposed route: - curl -tlsv1.2 --insecure -H "Authorization: Bearer ${token}" "https://${routeES}/.operations.*/_search?size=1" | jq- curl -tlsv1.2 --insecure -H "Authorization: Bearer ${token}" "https://${routeES}/.operations.*/_search?size=1" | jq- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The response appears similar to the following: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
7.4.6. About Elasticsearch alerting rules
You can view these alerting rules in Prometheus.
| Alert | Description | Severity | 
|---|---|---|
| ElasticsearchClusterNotHealthy | Cluster health status has been RED for at least 2m. Cluster does not accept writes, shards may be missing or master node hasn’t been elected yet. | critical | 
| ElasticsearchClusterNotHealthy | Cluster health status has been YELLOW for at least 20m. Some shard replicas are not allocated. | warning | 
| ElasticsearchBulkRequestsRejectionJumps | High Bulk Rejection Ratio at node in cluster. This node may not be keeping up with the indexing speed. | warning | 
| ElasticsearchNodeDiskWatermarkReached | Disk Low Watermark Reached at node in cluster. Shards can not be allocated to this node anymore. You should consider adding more disk space to the node. | alert | 
| ElasticsearchNodeDiskWatermarkReached | Disk High Watermark Reached at node in cluster. Some shards will be re-allocated to different nodes if possible. Make sure more disk space is added to the node or drop old indices allocated to this node. | high | 
| ElasticsearchJVMHeapUseHigh | JVM Heap usage on the node in cluster is <value> | alert | 
| AggregatedLoggingSystemCPUHigh | System CPU usage on the node in cluster is <value> | alert | 
| ElasticsearchProcessCPUHigh | ES process CPU usage on the node in cluster is <value> | alert | 
7.5. Configuring Kibana
OpenShift Container Platform uses Kibana to display the log data collected by Fluentd and indexed by Elasticsearch.
You can scale Kibana for redundancy and configure the CPU and memory for your Kibana nodes.
You must set cluster logging to Unmanaged state before performing these configurations, unless otherwise noted. For more information, see Changing the cluster logging management state.
Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
For more information, see Support policy for unmanaged Operators.
7.5.1. Configure Kibana CPU and memory limits
Each component specification allows for adjustments to both the CPU and memory limits.
Procedure
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
7.5.2. Scaling Kibana for redundancy
You can scale the Kibana deployment for redundancy.
..Procedure
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the number of Kibana nodes.
 
7.5.3. Using tolerations to control the Kibana Pod placement
You can control which nodes the Kibana Pods run on and prevent other workloads from using those nodes by using tolerations on the Pods.
					You apply tolerations to the Kibana Pods through the Cluster Logging Custom Resource (CR) and apply taints to a node through the node specification. A taint on a node is a key:value pair that instructs the node to repel all Pods that do not tolerate the taint. Using a specific key:value pair that is not on other Pods ensures only the Kibana Pod can run on that node.
				
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Use the following command to add a taint to a node where you want to schedule the Kibana Pod: - oc adm taint nodes <node-name> <key>=<value>:<effect> - $ oc adm taint nodes <node-name> <key>=<value>:<effect>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc adm taint nodes node1 kibana=node:NoExecute - $ oc adm taint nodes node1 kibana=node:NoExecute- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This example places a taint on - node1that has key- kibana, value- node, and taint effect- NoExecute. You must use the- NoExecutetaint effect.- NoExecuteschedules only Pods that match the taint and remove existing Pods that do not match.
- Edit the - visualizationsection of the Cluster Logging Custom Resource (CR) to configure a toleration for the Kibana Pod:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
					This toleration matches the taint created by the oc adm taint command. A Pod with this toleration would be able to schedule onto node1.
				
7.5.4. Installing the Kibana Visualize tool
					Kibana’s Visualize tab enables you to create visualizations and dashboards for monitoring container logs, allowing administrator users (cluster-admin or cluster-reader) to view logs by deployment, namespace, pod, and container.
				
Procedure
To load dashboards and other Kibana UI objects:
- If necessary, get the Kibana route, which is created by default upon installation of the Cluster Logging Operator: - oc get routes -n openshift-logging - $ oc get routes -n openshift-logging NAMESPACE NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD openshift-logging kibana kibana-openshift-logging.apps.openshift.com kibana <all> reencrypt/Redirect None- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the name of your Elasticsearch pods. - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the necessary per-user configuration that this procedure requires: - Log in to the Kibana dashboard as the user you want to add the dashboards to. - https://kibana-openshift-logging.apps.openshift.com - https://kibana-openshift-logging.apps.openshift.com- 1 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Where the URL is Kibana route.
 
- If the Authorize Access page appears, select all permissions and click Allow selected permissions.
- Log out of the Kibana dashboard.
 
- Run the following command from the project where the pod is located using the name of any of your Elastiscearch pods: - oc exec <es-pod> -- es_load_kibana_ui_objects <user-name> - $ oc exec <es-pod> -- es_load_kibana_ui_objects <user-name>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc exec elasticsearch-cdm-5ceex6ts-1-dcd6c4c7c-jpw6k -- es_load_kibana_ui_objects <user-name> - $ oc exec elasticsearch-cdm-5ceex6ts-1-dcd6c4c7c-jpw6k -- es_load_kibana_ui_objects <user-name>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
						The metadata of the Kibana objects such as visualizations, dashboards, and so forth are stored in Elasticsearch with the .kibana.{user_hash} index format. You can obtain the user_hash using the userhash=$(echo -n $username | sha1sum | awk '{print $1}') command. By default, the Kibana shared_ops index mode enables all users with cluster admin roles to share the index, and this Kibana object metadata is saved to the .kibana index.
					
Any custom dashboard can be imported for a particular user either by using the import/export feature or by inserting the metadata onto the Elasticsearch index using the curl command.
7.6. Curation of Elasticsearch Data
The Elasticsearch Curator tool performs scheduled maintenance operations on a global and/or on a per-project basis. Curator performs actions based on its configuration.
				The Cluster Logging Operator installs Curator and its configuration. You can configure the Curator cron schedule using the Cluster Logging Custom Resource and further configuration options can be found in the Curator ConfigMap, curator in the openshift-logging project, which incorporates the Curator configuration file, curator5.yaml and an OpenShift Container Platform custom configuration file, config.yaml.
			
				OpenShift Container Platform uses the config.yaml internally to generate the Curator action file.
			
				Optionally, you can use the action file, directly. Editing this file allows you to use any action that Curator has available to it to be run periodically. However, this is only recommended for advanced users as modifying the file can be destructive to the cluster and can cause removal of required indices/settings from Elasticsearch. Most users only must modify the Curator configuration map and never edit the action file.
			
7.6.1. Configuring the Curator schedule
You can specify the schedule for Curator using the cluster logging Custom Resource created by the cluster logging installation.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
To configure the Curator schedule:
- Edit the Cluster Logging Custom Resource in the - openshift-loggingproject:- oc edit clusterlogging instance - $ oc edit clusterlogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the schedule for Curator in cron format.
 Note- The time zone is set based on the host node where the Curator pod runs. 
7.6.2. Configuring Curator index deletion
You can configure Curator to delete Elasticsearch data based on retention settings. You can configure per-project and global settings. Global settings apply to any project not specified. Per-project settings override global settings.
Prerequisite
- Cluster logging must be installed.
Procedure
To delete indices:
- Edit the OpenShift Container Platform custom Curator configuration file: - oc edit configmap/curator - $ oc edit configmap/curator- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Set the following parameters as needed: - config.yaml: | project_name: action unit:value- config.yaml: | project_name: action unit:value- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The available parameters are: - Expand - Table 7.1. Project options - Variable Name - Description - project_name- The actual name of a project, such as myapp-devel. For OpenShift Container Platform operations logs, use the name - .operationsas the project name.- action- The action to take, currently only - deleteis allowed.- unit- The period to use for deletion, - days,- weeks, or- months.- value- The number of units. - Expand - Table 7.2. Filter options - Variable Name - Description - .defaults- Use - .defaultsas the- project_nameto set the defaults for projects that are not specified.- .regex- The list of regular expressions that match project names. - pattern- The valid and properly escaped regular expression pattern enclosed by single quotation marks. 
For example, to configure Curator to:
- 
							Delete indices in the myapp-dev project older than 1 day
- 
							Delete indices in the myapp-qe project older than 1 week
- 
							Delete operations logs older than 8 weeks
- 
							Delete all other projects indices after they are 31 daysold
- 
							Delete indices older than 1 day that are matched by the ^project\..+\-dev.*$regex
- 
							Delete indices older than 2 days that are matched by the ^project\..+\-test.*$regex
Use:
						When you use months as the $UNIT for an operation, Curator starts counting at the first day of the current month, not the current day of the current month. For example, if today is April 15, and you want to delete indices that are 2 months older than today (delete: months: 2), Curator does not delete indices that are dated older than February 15; it deletes indices older than February 1. That is, it goes back to the first day of the current month, then goes back two whole months from that date. If you want to be exact with Curator, it is best to use days (for example, delete: days: 30).
					
7.6.3. Troubleshooting Curator
You can use information in this section for debugging Curator. For example, if curator is in failed state, but the log messages do not provide a reason, you could increase the log level and trigger a new job, instead of waiting for another scheduled run of the cron job.
Prerequisites
Cluster logging and Elasticsearch must be installed.
Procedure
Enable the Curator debug log and trigger next Curator iteration manually
- Enable debug log of Curator: - oc set env cronjob/curator CURATOR_LOG_LEVEL=DEBUG CURATOR_SCRIPT_LOG_LEVEL=DEBUG - $ oc set env cronjob/curator CURATOR_LOG_LEVEL=DEBUG CURATOR_SCRIPT_LOG_LEVEL=DEBUG- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Specify the log level: - CRITICAL. Curator displays only critical messages.
- ERROR. Curator displays only error and critical messages.
- WARNING. Curator displays only error, warning, and critical messages.
- INFO. Curator displays only informational, error, warning, and critical messages.
- DEBUG. Curator displays only debug messages, in addition to all of the above. - The default value is INFO. Note- Cluster logging uses the OpenShift Container Platform custom environment variable - CURATOR_SCRIPT_LOG_LEVELin OpenShift Container Platform wrapper scripts (- run.shand- convert.py). The environment variable takes the same values as- CURATOR_LOG_LEVELfor script debugging, as needed.
 
- Trigger next curator iteration: - oc create job --from=cronjob/curator <job_name> - $ oc create job --from=cronjob/curator <job_name>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the following commands to control the CronJob: - Suspend a CronJob: - oc patch cronjob curator -p '{"spec":{"suspend":true}}'- $ oc patch cronjob curator -p '{"spec":{"suspend":true}}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Resume a CronJob: - oc patch cronjob curator -p '{"spec":{"suspend":false}}'- $ oc patch cronjob curator -p '{"spec":{"suspend":false}}'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Change a CronJob schedule: - oc patch cronjob curator -p '{"spec":{"schedule":"0 0 * * *"}}'- $ oc patch cronjob curator -p '{"spec":{"schedule":"0 0 * * *"}}'- 1 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Thescheduleoption accepts schedules in cron format.
 
 
7.6.4. Configuring Curator in scripted deployments
Use the information in this section if you must configure Curator in scripted deployments.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
- Set cluster logging to the unmanaged state.
Procedure
Use the following snippets to configure Curator in your scripts:
- For scripted deployments - Create and modify the configuration: - Copy the Curator configuration file and the OpenShift Container Platform custom configuration file from the Curator configuration map and create separate files for each: - oc extract configmap/curator --keys=curator5.yaml,config.yaml --to=/my/config - $ oc extract configmap/curator --keys=curator5.yaml,config.yaml --to=/my/config- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Edit the /my/config/curator5.yaml and /my/config/config.yaml files.
 
- Delete the existing Curator config map and add the edited YAML files to a new Curator config map. - oc delete configmap curator ; sleep 1 oc create configmap curator \ --from-file=curator5.yaml=/my/config/curator5.yaml \ --from-file=config.yaml=/my/config/config.yaml \ ; sleep 1- $ oc delete configmap curator ; sleep 1 $ oc create configmap curator \ --from-file=curator5.yaml=/my/config/curator5.yaml \ --from-file=config.yaml=/my/config/config.yaml \ ; sleep 1- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The next iteration will use this configuration. 
 
- If you are using the action file: - Create and modify the configuration: - Copy the Curator configuration file and the action file from the Curator configuration map and create separate files for each: - oc extract configmap/curator --keys=curator5.yaml,actions.yaml --to=/my/config - $ oc extract configmap/curator --keys=curator5.yaml,actions.yaml --to=/my/config- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Edit the /my/config/curator5.yaml and /my/config/actions.yaml files.
 
- Delete the existing Curator config map and add the edited YAML files to a new Curator config map. - oc delete configmap curator ; sleep 1 oc create configmap curator \ --from-file=curator5.yaml=/my/config/curator5.yaml \ --from-file=actions.yaml=/my/config/actions.yaml \ ; sleep 1- $ oc delete configmap curator ; sleep 1 $ oc create configmap curator \ --from-file=curator5.yaml=/my/config/curator5.yaml \ --from-file=actions.yaml=/my/config/actions.yaml \ ; sleep 1- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The next iteration will use this configuration. 
 
7.6.5. Using the Curator Action file
					The Curator ConfigMap in the openshift-logging project includes a Curator action file where you configure any Curator action to be run periodically.
				
					However, when you use the action file, OpenShift Container Platform ignores the config.yaml section of the curator ConfigMap, which is configured to ensure important internal indices do not get deleted by mistake. In order to use the action file, you should add an exclude rule to your configuration to retain these indices. You also must manually add all the other patterns following the steps in this topic.
				
						The actions and config.yaml are mutually-exclusive configuration files. Once the actions file exist, OpenShift Container Platform ignores the config.yaml file. Using the action file is recommended only for advanced users as using this file can be destructive to the cluster and can cause removal of required indices/settings from Elasticsearch.
					
Prerequisite
- Cluster logging and Elasticsearch must be installed.
- Set cluster logging to the unmanaged state. Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
Procedure
To configure Curator to delete indices:
- Edit the Curator ConfigMap: - oc edit cm/curator -n openshift-logging - oc edit cm/curator -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Make the following changes to the - actionfile:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specifydelete_indicesto delete the specified index.
- 2
- Use thefilersparameters to specify the index to be deleted. See the Elastic Search curator documentation for information on these parameters.
- 3
- Specifyfalseto allow the index to be deleted.
 
7.7. Configuring the logging collector
OpenShift Container Platform uses Fluentd to collect operations and application logs from your cluster and enriches the data with Kubernetes Pod and Namespace metadata.
You can configure log rotation, log location, use an external log aggregator, and make other configurations for the log collector.
You must set cluster logging to Unmanaged state before performing these configurations, unless otherwise noted. For more information, see Changing the cluster logging management state.
Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
For more information, see Support policy for unmanaged Operators.
7.7.1. Viewing logging collector pods
					You can use the oc get pods --all-namespaces -o wide command to see the nodes where the Fluentd are deployed.
				
Procedure
						Run the following command in the openshift-logging project:
					
7.7.2. Configure log collector CPU and memory limits
The log collector allows for adjustments to both the CPU and memory limits.
Procedure
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the CPU and memory limits and requests as needed. The values shown are the default values.
 
7.7.3. Configuring Buffer Chunk Limiting for Fluentd
If the Fluentd log collector is unable to keep up with a high number of logs, Fluentd performs file buffering to reduce memory usage and prevent data loss.
Fluentd file buffering stores records in chunks. Chunks are stored in buffers.
You can tune file buffering in your cluster by editing environment variables in the Fluentd Daemonset:
						To modify the FILE_BUFFER_LIMIT or BUFFER_SIZE_LIMIT parameters in the Fluentd Daemonset, you must set cluster logging to the unmanaged state. Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
					
- BUFFER_SIZE_LIMIT. This parameter determines the maximum size of each chunk file before Fluentd creates a new chunk. The default is - 8M. This parameter sets the Fluentd- chunk_limit_sizevariable.- A high - BUFFER_SIZE_LIMITcan collect more records per chunk file. However, bigger records take longer to be sent to the logstore.
- FILE_BUFFER_LIMIT. This parameter determines the file buffer size per logging output. This value is only a request based on the available space on the node where a Fluentd pod is scheduled. OpenShift Container Platform does not allow Fluentd to exceed the node capacity. The default is - 256Mi.- A high - FILE_BUFFER_LIMITcould translate to a higher- BUFFER_QUEUE_LIMITbased the number of outputs. However, if the node’s space is under pressure, Fluentd can fail.- By default, the - number_of_outputsis- 1if all the logs are sent to a single resource, and is incremented by- 1for each additional resource. You might have multiple outputs if you use the Log Forwarding API, the Fluentd Forward protocol, or syslog protocol to forward logs to external locations.- The permanent volume size must be larger than - FILE_BUFFER_LIMITmultiplied by the number of outputs.
- BUFFER_QUEUE_LIMIT. This parameter is the maximum number of buffer chunks allowed. The - BUFFER_QUEUE_LIMITparameter is not directly tunable. OpenShift Container Platform calculates this value based on the number of logging outputs, the chunk size, and the filesystem space available. The default is- 32chunks. To change the- BUFFER_QUEUE_LIMIT, you must change the value of- FILE_BUFFER_LIMIT. The- BUFFER_QUEUE_LIMITparameter sets the Fluentd- queue_limit_lengthparameter.- OpenShift Container Platform calculates the - BUFFER_QUEUE_LIMITas- (FILE_BUFFER_LIMIT / (number_of_outputs * BUFFER_SIZE_LIMIT)).- Using the default set of values, the value of - BUFFER_QUEUE_LIMITis 32:- 
									FILE_BUFFER_LIMIT = 256Mi
- 
									number_of_outputs = 1
- 
									BUFFER_SIZE_LIMIT = 8Mi
 
- 
									
OpenShift Container Platform uses the Fluentd file buffer plug-in to configure how the chunks are stored. You can see the location of the buffer file using the following command:
oc get cm fluentd -o json | jq -r '.data."fluent.conf"'
$ oc get cm fluentd -o json | jq -r '.data."fluent.conf"'<buffer> @type file path '/var/lib/flunetd/retry-elasticseach'
<buffer>
   @type file 
   path '/var/lib/flunetd/retry-elasticseach' Prerequisite
- Set cluster logging to the unmanaged state. Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
Procedure
To configure Buffer Chunk Limiting:
7.7.4. Configuring the logging collector using environment variables
You can use environment variables to modify the configuration of the Fluentd log collector.
See the Fluentd README in Github for lists of the available environment variables.
Prerequisite
- Set cluster logging to the unmanaged state. Operators in an unmanaged state are unsupported and the cluster administrator assumes full control of the individual component configurations and upgrades.
Procedure
Set any of the Fluentd environment variables as needed:
oc set env ds/fluentd <env-var>=<value>
oc set env ds/fluentd <env-var>=<value>For example:
oc set env ds/fluentd LOGGING_FILE_AGE=30
oc set env ds/fluentd LOGGING_FILE_AGE=307.7.5. About logging collector alerts
The following alerts are generated by the logging collector and can be viewed on the Alerts tab of the Prometheus UI.
All the logging collector alerts are listed on the Monitoring → Alerts page of the OpenShift Container Platform web console. Alerts are in one of the following states:
- Firing. The alert condition is true for the duration of the timeout. Click the Options menu at the end of the firing alert to view more information or silence the alert.
- Pending The alert condition is currently true, but the timeout has not been reached.
- Not Firing. The alert is not currently triggered.
| Alert | Message | Description | Severity | 
|---|---|---|---|
| 
									 | 
									 | Fluentd is reporting a higher number of issues than the specified number, default 10. | Critical | 
| 
									 | 
									 | Fluentd is reporting that Prometheus could not scrape a specific Fluentd instance. | Critical | 
| 
									 | 
									 | Fluentd is reporting that it is overwhelmed. | Warning | 
| 
									 | 
									 | Fluentd is reporting queue usage issues. | Critical | 
7.8. Collecting and storing Kubernetes events
The OpenShift Container Platform Event Router is a Pod that watches Kubernetes events and logs them for collection by cluster logging. You must manually deploy the Event Router.
				The Event Router collects events from all projects and writes them to STDOUT. Fluentd collects those events and forwards them into the OpenShift Container Platform Elasticsearch instance. Elasticsearch indexes the events to the infra index.
			
The Event Router adds additional load to Fluentd and can impact the number of other log messages that can be processed.
7.8.1. Deploying and configuring the Event Router
					Use the following steps to deploy the Event Router into your cluster. You should always deploy the Event Router to the openshift-logging project to ensure it collects events from across the cluster.
				
The following Template object creates the service account, cluster role, and cluster role binding required for the Event Router. The template also configures and deploys the Event Router Pod. You can use this template without making changes, or change the Deployment object CPU and memory requests.
Prerequisites
- You need proper permissions to create service accounts and update cluster role bindings. For example, you can run the following template with a user that has the cluster-admin role.
- Cluster logging must be installed.
Procedure
- Create a template for the Event Router: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Creates a Service Account in theopenshift-loggingproject for the Event Router.
- 2
- Creates a ClusterRole to monitor for events in the cluster.
- 3
- Creates a ClusterRoleBinding to bind the ClusterRole to the ServiceAccount.
- 4
- Creates a ConfigMap in theopenshift-loggingproject to generate the requiredconfig.jsonfile.
- 5
- Creates a Deployment in theopenshift-loggingproject to generate and configure the Event Router Pod.
- 6
- Specifies the minimum amount of memory to allocate to the Event Router Pod. Defaults to128Mi.
- 7
- Specifies the minimum amount of CPU to allocate to the Event Router Pod. Defaults to100m.
- 8
- Specifies theopenshift-loggingproject to install objects in.
 
- Use the following command to process and apply the template: - oc process -f <templatefile> | oc apply -f - - $ oc process -f <templatefile> | oc apply -f -- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc process -f eventrouter.yaml | oc apply -f - - $ oc process -f eventrouter.yaml | oc apply -f -- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - serviceaccount/logging-eventrouter created clusterrole.authorization.openshift.io/event-reader created clusterrolebinding.authorization.openshift.io/event-reader-binding created configmap/logging-eventrouter created deployment.apps/logging-eventrouter created - serviceaccount/logging-eventrouter created clusterrole.authorization.openshift.io/event-reader created clusterrolebinding.authorization.openshift.io/event-reader-binding created configmap/logging-eventrouter created deployment.apps/logging-eventrouter created- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Validate that the Event Router installed in the - openshift-loggingproject:- View the new Event Router Pod: - oc get pods --selector component=eventrouter -o name -n openshift-logging - $ oc get pods --selector component=eventrouter -o name -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - pod/cluster-logging-eventrouter-d649f97c8-qvv8r - pod/cluster-logging-eventrouter-d649f97c8-qvv8r- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- View the events collected by the Event Router: - oc logs <cluster_logging_eventrouter_pod> -n openshift-logging - $ oc logs <cluster_logging_eventrouter_pod> -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc logs cluster-logging-eventrouter-d649f97c8-qvv8r -n openshift-logging - $ oc logs cluster-logging-eventrouter-d649f97c8-qvv8r -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Example output - {"verb":"ADDED","event":{"metadata":{"name":"openshift-service-catalog-controller-manager-remover.1632d931e88fcd8f","namespace":"openshift-service-catalog-removed","selfLink":"/api/v1/namespaces/openshift-service-catalog-removed/events/openshift-service-catalog-controller-manager-remover.1632d931e88fcd8f","uid":"787d7b26-3d2f-4017-b0b0-420db4ae62c0","resourceVersion":"21399","creationTimestamp":"2020-09-08T15:40:26Z"},"involvedObject":{"kind":"Job","namespace":"openshift-service-catalog-removed","name":"openshift-service-catalog-controller-manager-remover","uid":"fac9f479-4ad5-4a57-8adc-cb25d3d9cf8f","apiVersion":"batch/v1","resourceVersion":"21280"},"reason":"Completed","message":"Job completed","source":{"component":"job-controller"},"firstTimestamp":"2020-09-08T15:40:26Z","lastTimestamp":"2020-09-08T15:40:26Z","count":1,"type":"Normal"}}- {"verb":"ADDED","event":{"metadata":{"name":"openshift-service-catalog-controller-manager-remover.1632d931e88fcd8f","namespace":"openshift-service-catalog-removed","selfLink":"/api/v1/namespaces/openshift-service-catalog-removed/events/openshift-service-catalog-controller-manager-remover.1632d931e88fcd8f","uid":"787d7b26-3d2f-4017-b0b0-420db4ae62c0","resourceVersion":"21399","creationTimestamp":"2020-09-08T15:40:26Z"},"involvedObject":{"kind":"Job","namespace":"openshift-service-catalog-removed","name":"openshift-service-catalog-controller-manager-remover","uid":"fac9f479-4ad5-4a57-8adc-cb25d3d9cf8f","apiVersion":"batch/v1","resourceVersion":"21280"},"reason":"Completed","message":"Job completed","source":{"component":"job-controller"},"firstTimestamp":"2020-09-08T15:40:26Z","lastTimestamp":"2020-09-08T15:40:26Z","count":1,"type":"Normal"}}- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - You can also use Kibana to view events by creating an index pattern using the Elasticsearch - infraindex.
 
7.9. Using tolerations to control cluster logging pod placement
You can use taints and tolerations to ensure that cluster logging pods run on specific nodes and that no other workload can run on those nodes.
				Taints and tolerations are simple key:value pair. A taint on a node instructs the node to repel all Pods that do not tolerate the taint.
			
				The key is any string, up to 253 characters and the value is any string up to 63 characters. The string must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores.
			
Sample cluster logging CR with tolerations
7.9.1. Using tolerations to control the Elasticsearch Pod placement
You can control which nodes the Elasticsearch Pods runs on and prevent other workloads from using those nodes by using tolerations on the Pods.
					You apply tolerations to Elasticsearch Pods through the Cluster Logging Custom Resource (CR) and apply taints to a node through the node specification. A taint on a node is a key:value pair that instructs the node to repel all Pods that do not tolerate the taint. Using a specific key:value pair that is not on other Pods ensures only Elasticseach Pods can run on that node.
				
By default, the Elasticsearch Pods have the following toleration:
tolerations: - effect: "NoExecute" key: "node.kubernetes.io/disk-pressure" operator: "Exists"
tolerations:
- effect: "NoExecute"
  key: "node.kubernetes.io/disk-pressure"
  operator: "Exists"Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Use the following command to add a taint to a node where you want to schedule the cluster logging Pods: - oc adm taint nodes <node-name> <key>=<value>:<effect> - $ oc adm taint nodes <node-name> <key>=<value>:<effect>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc adm taint nodes node1 elasticsearch=node:NoExecute - $ oc adm taint nodes node1 elasticsearch=node:NoExecute- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This example places a taint on - node1that has key- elasticsearch, value- node, and taint effect- NoExecute. Nodes with the- NoExecuteeffect schedule only Pods that match the taint and remove existing Pods that do not match.
- Edit the - logstoresection of the Cluster Logging Custom Resource (CR) to configure a toleration for the Elasticsearch Pods:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the key that you added to the node.
- 2
- Specify theExistsoperator to require a taint with the keyelasticsearchto be present on the Node.
- 3
- Specify theNoExecuteeffect.
- 4
- Optionally, specify thetolerationSecondsparameter to set how long a Pod can remain bound to a node before being evicted.
 
					This toleration matches the taint created by the oc adm taint command. A Pod with this toleration could be scheduled onto node1.
				
7.9.2. Using tolerations to control the Kibana Pod placement
You can control which nodes the Kibana Pods run on and prevent other workloads from using those nodes by using tolerations on the Pods.
					You apply tolerations to the Kibana Pods through the Cluster Logging Custom Resource (CR) and apply taints to a node through the node specification. A taint on a node is a key:value pair that instructs the node to repel all Pods that do not tolerate the taint. Using a specific key:value pair that is not on other Pods ensures only the Kibana Pod can run on that node.
				
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Use the following command to add a taint to a node where you want to schedule the Kibana Pod: - oc adm taint nodes <node-name> <key>=<value>:<effect> - $ oc adm taint nodes <node-name> <key>=<value>:<effect>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc adm taint nodes node1 kibana=node:NoExecute - $ oc adm taint nodes node1 kibana=node:NoExecute- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This example places a taint on - node1that has key- kibana, value- node, and taint effect- NoExecute. You must use the- NoExecutetaint effect.- NoExecuteschedules only Pods that match the taint and remove existing Pods that do not match.
- Edit the - visualizationsection of the Cluster Logging Custom Resource (CR) to configure a toleration for the Kibana Pod:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
					This toleration matches the taint created by the oc adm taint command. A Pod with this toleration would be able to schedule onto node1.
				
7.9.3. Using tolerations to control the Curator Pod placement
You can control which node the Curator Pod runs on and prevent other workloads from using those nodes by using tolerations on the Pod.
					You apply tolerations to the Curator Pod through the Cluster Logging Custom Resource (CR) and apply taints to a node through the node specification. A taint on a node is a key:value pair that instructs the node to repel all Pods that do not tolerate the taint. Using a specific key:value pair that is not on other Pods ensures only the Curator Pod can run on that node.
				
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Use the following command to add a taint to a node where you want to schedule the Curator Pod: - oc adm taint nodes <node-name> <key>=<value>:<effect> - $ oc adm taint nodes <node-name> <key>=<value>:<effect>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc adm taint nodes node1 curator=node:NoExecute - $ oc adm taint nodes node1 curator=node:NoExecute- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This example places a taint on - node1that has key- curator, value- node, and taint effect- NoExecute. You must use the- NoExecutetaint effect.- NoExecuteschedules only Pods that match the taint and remove existing Pods that do not match.
- Edit the - curationsection of the Cluster Logging Custom Resource (CR) to configure a toleration for the Curator Pod:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
					This toleration matches the taint that is created by the oc adm taint command. A Pod with this toleration would be able to schedule onto node1.
				
7.9.4. Using tolerations to control the log collector Pod placement
You can ensure which nodes the logging collector Pods run on and prevent other workloads from using those nodes by using tolerations on the Pods.
You apply tolerations to logging collector Pods through the Cluster Logging Custom Resource (CR) and apply taints to a node through the node specification. You can use taints and tolerations to ensure the Pod does not get evicted for things like memory and CPU issues.
By default, the logging collector Pods have the following toleration:
tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" effect: "NoExecute"
tolerations:
- key: "node-role.kubernetes.io/master"
  operator: "Exists"
  effect: "NoExecute"Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Use the following command to add a taint to a node where you want logging collector Pods to schedule logging collector Pods: - oc adm taint nodes <node-name> <key>=<value>:<effect> - $ oc adm taint nodes <node-name> <key>=<value>:<effect>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc adm taint nodes node1 collector=node:NoExecute - $ oc adm taint nodes node1 collector=node:NoExecute- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - This example places a taint on - node1that has key- collector, value- node, and taint effect- NoExecute. You must use the- NoExecutetaint effect.- NoExecuteschedules only Pods that match the taint and removes existing Pods that do not match.
- Edit the - collectionsection of the Cluster Logging Custom Resource (CR) to configure a toleration for the logging collector Pods:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
					This toleration matches the taint created by the oc adm taint command. A Pod with this toleration would be able to schedule onto node1.
				
7.9.5. Additional resources
For more information about taints and tolerations, see Controlling pod placement using node taints.
7.10. Forward logs to third party systems
By default, OpenShift Container Platform cluster logging sends logs to the default internal Elasticsearch logstore, defined in the Cluster Logging Custom Resource.
- Sending logs using the Fluentd forward protocol. You can create a Configmap to use the Fluentd forward protocol to securely send logs to an external logging aggregator that accepts the Fluent forward protocol.
- Sending logs using syslog. You can create a Configmap to use the syslog protocol to send logs to an external syslog (RFC 3164) server.
Alternatively, you can use the Log Forwarding API, currently in Technology Preview. The Log Forwarding API, which is easier to configure than the Fluentd protocol and syslog, exposes configuration for sending logs to the internal Elasticsearch logstore and to external Fluentd log aggregation solutions.
The Log Forwarding API is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.
The methods for forwarding logs using a ConfigMap are deprecated and will be replaced by the Log Forwarding API in a future release.
7.10.1. Forwarding logs using the Fluentd forward protocol
You can use the Fluentd forward protocol to send a copy of your logs to an external log aggregator, instead of the default Elasticsearch logstore. On the OpenShift Container Platform cluster, you use the Fluentd forward protocol to send logs to a server configured to accept the protocol. You are responsible to configure the external log aggregator to receive the logs from OpenShift Container Platform.
This method for forwarding logs is deprecated in OpenShift Container Platform and will be replaced by the Log Forwarding API in a future release.
					To configure OpenShift Container Platform to send logs using the Fluentd forward protocol, create a ConfigMap called secure-forward in the openshift-logging namespace that points to an external log aggregator.
				
Starting with the OpenShift Container Platform 4.3, the process for using the Fluentd forward protocol has changed. You now need to create a ConfigMap, as described below.
						Additionally, you can add any certificates required by your configuration to a secret named secure-forward that will be mounted to the Fluentd Pods.
					
Sample secure-forward.conf
Sample secure-forward ConfigMap based on the configuration
Procedure
To configure OpenShift Container Platform to forward logs using the Fluentd forward protocol:
- Create a configuration file named - secure-forward.conffor the forward parameters:- Configure the secrets and TLS information: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the default value of the auto-generated certificate common name (CN).
- 2
- Enter the Shared key between nodes
- 3
- Specifytlsto enable TLS validation.
- 4
- Set totrueto verify the server cert hostname. Set tofalseto ignore server cert hostname.
- 5
- Specify the path to private CA certificate file as/etc/ocp-forward/ca_cert.pem.
 - To use mTLS, see the Fluentd documentation for information about client certificate, key parameters, and other settings. 
- Configure the name, host, and port for your external Fluentd server: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Create a ConfigMap named - secure-forwardin the- openshift-loggingnamespace from the configuration file:- oc create configmap secure-forward --from-file=secure-forward.conf -n openshift-logging - $ oc create configmap secure-forward --from-file=secure-forward.conf -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Optional: Import any secrets required for the receiver: - oc create secret generic secure-forward --from-file=<arbitrary-name-of-key1>=cert_file_from_fluentd_receiver --from-literal=shared_key=value_from_fluentd_receiver - $ oc create secret generic secure-forward --from-file=<arbitrary-name-of-key1>=cert_file_from_fluentd_receiver --from-literal=shared_key=value_from_fluentd_receiver- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc create secret generic secure-forward --from-file=ca-bundle.crt=ca-for-fluentd-receiver/ca.crt --from-literal=shared_key=fluentd-receiver - $ oc create secret generic secure-forward --from-file=ca-bundle.crt=ca-for-fluentd-receiver/ca.crt --from-literal=shared_key=fluentd-receiver- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Refresh the - fluentdPods to apply the- secure-forwardsecret and- secure-forwardConfigMap:- oc delete pod --selector logging-infra=fluentd - $ oc delete pod --selector logging-infra=fluentd- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Configure the external log aggregator to accept messages securely from OpenShift Container Platform.
7.10.2. Forwarding logs using the syslog protocol
You can use the syslog protocol to send a copy of your logs to an external syslog server, instead of the default Elasticsearch logstore. Note the following about this syslog protocol:
- uses syslog protocol (RFC 3164), not RFC 5424;
- does not support TLS and thus, is not secure;
- does not provide Kubernetes metadata, systemd data, or other metadata.
This method for forwarding logs is deprecated in OpenShift Container Platform and will be replaced by the Log Forwarding API in a future release.
There are two versions of the syslog protocol:
- out_syslog: The non-buffered implementation, which communicates through UDP, does not buffer data and writes out results immediately.
- out_syslog_buffered: The buffered implementation, which communicates through TCP, buffers data into chunks.
					To configure log forwarding using the syslog protocol, create a configuration file, called syslog.conf, with the information needed to forward the logs. Then use that file to create a ConfigMap called syslog in the openshift-logging namespace, which OpenShift Container Platform uses when forwarding the logs. You are responsible to configure your syslog server to receive the logs from OpenShift Container Platform.
				
Starting with the OpenShift Container Platform 4.3, the process for using the syslog protocol has changed. You now need to create a ConfigMap, as described below.
					You can forward logs to multiple syslog servers by specifying separate <store> stanzas in the configuration file.
				
Sample syslog.conf
- 1
- The syslog protocol, either:syslogorsyslog_buffered.
- 2
- The fully qualified domain name (FQDN) or IP address of the syslog server.
- 3
- The port number to connect on. Defaults to514.
- 4
- The name of the syslog server.
- 5
- Removes the prefix from the tag. Defaults to''(empty).
- 6
- The field to set the syslog key.
- 7
- The syslog log facility or source.
- 8
- The syslog log severity.
- 9
- Determines whether to use the severity and facility from the record if available.
- 10
- The key to set the payload of the syslog message. Defaults tomessage.
Sample syslog ConfigMap based on the sample syslog.conf
Procedure
To configure OpenShift Container Platform to forward logs using the syslog protocol:
- Create a configuration file named - syslog.confthat contains the following parameters within the- <store>stanza:- Specify the syslog protocol type: - @type syslog_buffered - @type syslog_buffered- 1 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify the protocol to use, either:syslogorsyslog_buffered.
 
- Configure the name, host, and port for your external syslog server: - remote_syslog <remote> port <number> hostname <name> - remote_syslog <remote>- 1 - port <number>- 2 - hostname <name>- 3 - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - remote_syslog syslogserver.openshift-logging.svc.cluster.local port 514 hostname fluentd-server - remote_syslog syslogserver.openshift-logging.svc.cluster.local port 514 hostname fluentd-server- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Configure the other syslog variables as needed: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Add this parameter to remove thetagfield from the syslog prefix.
- 2
- Specify the field to set the syslog key.
- 3
- Specify the syslog log facility or source. For values, see RTF 3164.
- 4
- Specify the syslog log severity. For values, see link:RTF 3164.
- 5
- Specifytrueto use the severity and facility from the record if available. Iftrue, thecontainer_name,namespace_name, andpod_nameare included in the output content.
- 6
- Specify the key to set the payload of the syslog message. Defaults tomessage.
 - For example: - facility local0 severity info - facility local0 severity info- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The configuration file appears similar to the following: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Create a ConfigMap named - syslogin the- openshift-loggingnamespace from the configuration file:- oc create configmap syslog --from-file=syslog.conf -n openshift-logging - $ oc create configmap syslog --from-file=syslog.conf -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The Cluster Logging Operator redeploys the Fluentd Pods. If the Pods do not redeploy, you can delete the Fluentd Pods to force them to redeploy. - oc delete pod --selector logging-infra=fluentd - $ oc delete pod --selector logging-infra=fluentd- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
7.10.3. Forwarding logs using the Log Forwarding API
The Log Forwarding API enables you to configure custom pipelines to send container and node logs to specific endpoints within or outside of your cluster. You can send logs by type to the internal OpenShift Container Platform Elasticsearch logstore and to remote destinations not managed by OpenShift Container Platform cluster logging, such as an existing logging service, an external Elasticsearch cluster, external log aggregation solutions, or a Security Information and Event Management (SIEM) system.
The Log Fowarding API is currently a Technology Preview feature. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend to use them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
See the Red Hat Technology Preview features support scope for more information.
You can send different types of logs to different systems allowing you to control who in your organization can access each type. Optional TLS support ensures that you can send logs using secure communication as required by your organization.
Using the Log Forwarding API is optional. If you want to forward logs to only the internal OpenShift Container Platform Elasticsearch instance, do not configure the Log Forwarding API.
7.10.3.1. Understanding the Log Forwarding API
Forwarding cluster logs using the Log Forwarding API requires a combination of outputs and pipelines to send logs to specific endpoints inside and outside of your OpenShift Container Platform cluster.
If you want to use only the default internal OpenShift Container Platform Elasticsearch logstore, do not configure the Log Forwarding feature.
						By default, the Cluster Logging Operator sends logs to the default internal Elasticsearch logstore, as defined in the Cluster Logging Custom Resource. To use the Log Forwarding feature, you create a custom logforwarding configuration file to send logs to endpoints you specify.
					
An output is the destination for log data and a pipeline defines simple routing for one source to one or more outputs.
An output can be either:
- 
								elasticsearchto forward logs to an external Elasticsearch v5.x cluster and/or the internal OpenShift Container Platform Elasticsearch instance.
- 
								forwardto forward logs to an external log aggregation solution. This option uses the Fluentd forward protocols.
The endpoint must be a server name or FQDN, not an IP Address, if the cluster-wide proxy using the CIDR annotation is enabled.
A pipeline associates the source of the data to an output. The source of the data is one of the following:
- 
								logs.app- Container logs generated by user applications running in the cluster, except infrastructure container applications.
- 
								logs.infra- Logs generated by infrastructure components running in the cluster and OpenShift Container Platform nodes, such as journal logs. Infrastructure components are pods that run in theopenshift*,kube*, ordefaultprojects.
- 
								logs.audit- Logs generated by the node audit system (auditd), which are stored in the /var/log/audit/audit.log file, and the audit logs from the Kubernetes apiserver and the OpenShift apiserver.
Note the following:
- The internal OpenShift Container Platform Elasticsearch instance does not provide secure storage for audit logs. We recommend you ensure that the system to which you forward audit logs is compliant with your organizational and governmental regulations and is properly secured. OpenShift Container Platform cluster logging does not comply with those regulations.
- An output supports TLS communication using a secret. Secrets must have keys of: tls.crt, tls.key, and ca-bundler.crt which point to the respective certificates for which they represent. Secrets must have the key shared_key for use when using forward in a secure manner.
- You are responsible to create and maintain any additional configurations that external destinations might require, such as keys and secrets, service accounts, port opening, or global proxy configuration.
The following example creates three outputs:
- the internal OpenShift Container Platform Elasticsearch instance,
- an unsecured externally-managed Elasticsearch instance,
- a secured external log aggregator using the forward protocols.
Three pipelines send:
- the application logs to the internal OpenShift Container Platform Elasticsearch,
- the infrastructure logs to an external Elasticsearch instance,
- the audit logs to the secured device over the forward protocols.
Sample log forwarding outputs and pipelines
- 1
- The name of the log forwarding CR must beinstance.
- 2
- Parameter to disable the default log forwarding behavior.
- 3
- Configuration for the outputs.
- 4
- A name to describe the output.
- 5
- The type of output, eitherelasticsearchorforward.
- 6
- Enter the endpoint, either the server name, FQDN, or IP address. If the cluster-wide proxy using the CIDR annotation is enabled, the endpoint must be a server name or FQDN, not an IP Address. For the internal OpenShift Container Platform Elasticsearch instance, specifyelasticsearch.openshift-logging.svc:9200.
- 7
- Optional name of the secret required by the endpoint for TLS communication. The secret must exist in theopenshift-loggingproject.
- 8
- Optional setting if the endpoint does not use a secret, resulting in insecure communication.
- 9
- Configuration for the pipelines.
- 10
- A name to describe the pipeline.
- 11
- The data source:logs.app,logs.infra, orlogs.audit.
- 12
- The name of one or more outputs configured in the CR.
7.10.3.2. Enabling the Log Forwarding API
You must enable the Log Forwarding API before you can forward logs using the API.
Procedure
To enable the Log Forwarding API:
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Add the - clusterlogging.openshift.io/logforwardingtechpreviewannotation and set to- enabled:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
7.10.3.3. Configuring log forwarding using the Log Forwarding API
						To configure the Log Forwarding, edit the Cluster Logging Custom Resource (CR) to add the clusterlogging.openshift.io/logforwardingtechpreview: enabled annotation and create a Log Forwarding Custom Resource to specify the outputs, pipelines, and enable log forwarding.
					
						If you enable Log Forwarding, you should define a pipeline all for three source types: logs.app, logs.infra, and logs.audit. The logs from any undefined source type are dropped. For example, if you specify a pipeline for the logs.app and log-audit types, but do not specify a pipeline for the logs.infra type, logs.infra logs are dropped.
					
Procedure
To configure log forwarding using the API:
- Create a Log Forwarding CR YAML file similar to the following: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- The name of the log forwarding CR must beinstance.
- 2
- The namespace for the log forwarding CR must beopenshift-logging.
- 3
- Set totruedisable the default log forwarding behavior.
- 4
- Add one or more endpoints:- 
												Specify the type of output, either elasticseachorforward.
- Enter a name for the output.
- 
												Enter the endpoint, either the server name, FQDN, or IP address. If the cluster-wide proxy using the CIDR annotation is enabled, the endpoint must be a server name or FQDN, not an IP Address. For the internal OpenShift Container Platform Elasticsearch instance, specify elasticsearch.openshift-logging.svc:9200.
- 
												Optional: Enter the name of the secret required by the endpoint for TLS communication. The secret must exist in the openshift-loggingproject.
- 
												Specify insecure: trueif the endpoint does not use a secret, resulting in insecure communication.
 
- 
												Specify the type of output, either 
- 5
- Add one or more pipelines:- Enter a name for the pipeline
- 
												Specify the source type: logs.app,logs.infra, orlogs.audit.
- Specify the name of one or more outputs configured in the CR. Note- If you set - disableDefaultForwarding: trueyou must configure a pipeline and output for all three types of logs, application, infrastructure, and audit. If you do not specify a pipeline and output for a log type, those logs are not stored and will be lost.
 
 
- Create the CR object: - oc create -f <file-name>.yaml - $ oc create -f <file-name>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
7.10.3.3.1. Example log forwarding custom resources
A typical Log Forwarding configuration would be similar to the following examples.
The following Log Forwarding custom resource sends all logs to a secured external Elasticsearch logstore:
Sample custom resource to forward to an Elasticsearch logstore
The following Log Forwarding custom resource sends all logs to a secured Fluentd instance using the Fluentd forward protocol.
Sample custom resource to use the forward protocol
7.10.3.4. Disabling the Log Forwarding API
						To disable the Log Forwarding API and to stop forwarding logs to the speified endpoints, remove the metadata.annotations.clusterlogging.openshift.io/logforwardingtechpreview:enabled parameter from the Cluster Logging CR and delete the Log Forwarding CR. The container and node logs will be forwarded to the internal OpenShift Container Platform Elasticsearch instance.
					
							Setting disableDefaultForwarding=false prevents cluster logging from sending logs to the specified endpoints and to default internal OpenShift Container Platform Elasticsearch instance.
						
Procedure
To disable the Log Forwarding API:
- Edit the Cluster Logging Custom Resource (CR) in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Remove the - clusterlogging.openshift.io/logforwardingtechpreviewannotation:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Remove this annotation.
 
- Delete the Log Forwarding Custom Resource: - oc delete LogForwarding instance -n openshift-logging - $ oc delete LogForwarding instance -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
7.11. Configuring systemd-journald and Fluentd
Because Fluentd reads from the journal, and the journal default settings are very low, journal entries can be lost because the journal cannot keep up with the logging rate from system services.
				We recommend setting RateLimitInterval=1s and RateLimitBurst=10000 (or even higher if necessary) to prevent the journal from losing entries.
			
7.11.1. Configuring systemd-journald for cluster logging
As you scale up your project, the default logging environment might need some adjustments.
For example, if you are missing logs, you might have to increase the rate limits for journald. You can adjust the number of messages to retain for a specified period of time to ensure that cluster logging does not use excessive resources without dropping logs.
You can also determine if you want the logs compressed, how long to retain logs, how or if the logs are stored, and other settings.
Procedure
- Create a - journald.conffile with the required settings:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Specify whether you want logs compressed before they are written to the file system. Specifyyesto compress the message ornoto not compress. The default isyes.
- 2
- Configure whether to forward log messages. Defaults tonofor each. Specify:- 
											ForwardToConsoleto forward logs to the system console.
- 
											ForwardToKsmgto forward logs to the kernel log buffer.
- 
											ForwardToSyslogto forward to a syslog daemon.
- 
											ForwardToWallto forward messages as wall messages to all logged-in users.
 
- 
											
- 3
- Specify the maximum time to store journal entries. Enter a number to specify seconds. Or include a unit: "year", "month", "week", "day", "h" or "m". Enter0to disable. The default is1month.
- 4
- Configure rate limiting. If, during the time interval defined byRateLimitIntervalSec, more logs than specified inRateLimitBurstare received, all further messages within the interval are dropped until the interval is over. It is recommended to setRateLimitInterval=1sandRateLimitBurst=10000, which are the defaults.
- 5
- Specify how logs are stored. The default ispersistent:- 
											volatileto store logs in memory in/var/log/journal/.
- 
											persistentto store logs to disk in/var/log/journal/. systemd creates the directory if it does not exist.
- 
											autoto store logs in in/var/log/journal/if the directory exists. If it does not exist, systemd temporarily stores logs in/run/systemd/journal.
- 
											noneto not store logs. systemd drops all logs.
 
- 
											
- 6
- Specify the timeout before synchronizing journal files to disk for ERR, WARNING, NOTICE, INFO, and DEBUG logs. systemd immediately syncs after receiving a CRIT, ALERT, or EMERG log. The default is1s.
- 7
- Specify the maximum size the journal can use. The default is8g.
- 8
- Specify how much disk space systemd must leave free. The default is20%.
- 9
- Specify the maximum size for individual journal files stored persistently in/var/log/journal. The default is10M.NoteIf you are removing the rate limit, you might see increased CPU utilization on the system logging daemons as it processes any messages that would have previously been throttled. For more information on systemd settings, see https://www.freedesktop.org/software/systemd/man/journald.conf.html. The default settings listed on that page might not apply to OpenShift Container Platform. 
 
- Convert the - journal.conffile to base64:- export jrnl_cnf=$( cat /journald.conf | base64 -w0 ) - $ export jrnl_cnf=$( cat /journald.conf | base64 -w0 )- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create a new MachineConfig for master or worker and add the - journal.confparameters:- For example: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Create the MachineConfig: - oc apply -f <filename>.yaml - $ oc apply -f <filename>.yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The controller detects the new MachineConfig and generates a new - rendered-worker-<hash>version.
- Monitor the status of the rollout of the new rendered configuration to each node: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Chapter 8. Viewing Elasticsearch status
You can view the status of the Elasticsearch Operator and for a number of Elasticsearch components.
8.1. Viewing Elasticsearch status
You can view the status of your Elasticsearch cluster.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Change to the - openshift-loggingproject.- oc project openshift-logging - $ oc project openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- To view the Elasticsearch cluster status: - Get the name of the Elasticsearch instance: - oc get Elasticsearch - $ oc get Elasticsearch NAME AGE elasticsearch 5h9m- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the Elasticsearch status: - oc get Elasticsearch <Elasticsearch-instance> -o yaml - $ oc get Elasticsearch <Elasticsearch-instance> -o yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc get Elasticsearch elasticsearch -n openshift-logging -o yaml - $ oc get Elasticsearch elasticsearch -n openshift-logging -o yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The output includes information similar to the following: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- In the output, the cluster status fields appear in thestatusstanza.
- 2
- The status of the Elasticsearch cluster:- The number of active primary shards.
- The number of active shards.
- The number of shards that are initializing.
- The number of Elasticsearch data nodes.
- The total number of Elasticsearch nodes.
- The number of pending tasks.
- 
												The Elasticsearch status: green,red,yellow.
- The number of unassigned shards.
 
- 3
- Any status conditions, if present. The Elasticsearch cluster status indicates the reasons from the scheduler if a pod could not be placed. Any events related to the following conditions are shown:- Container Waiting for both the Elasticsearch and proxy containers.
- Container Terminated for both the Elasticsearch and proxy containers.
- Pod unschedulable. Also, a condition is shown for a number of issues, see Example condition messages.
 
- 4
- The Elasticsearch nodes in the cluster, withupgradeStatus.
- 5
- The Elasticsearch client, data, and master pods in the cluster, listed under 'failed`,notReadyorreadystate.
 
 
8.1.1. Example condition messages
					The following are examples of some condition messages from the Status section of the Elasticsearch instance.
				
This status message indicates a node has exceeded the configured low watermark and no shard will be allocated to this node.
This status message indicates a node has exceeded the configured high watermark and shards will be relocated to other nodes.
This status message indicates the Elasticsearch node selector in the CR does not match any nodes in the cluster:
This status message indicates that the Elasticsearch CR uses a non-existent PVC.
This status message indicates that your Elasticsearch cluster does not have enough nodes to support your Elasticsearch redundancy policy.
This status message indicates your cluster has too many master nodes:
8.2. Viewing Elasticsearch component status
You can view the status for a number of Elasticsearch components.
- Elasticsearch indices
- You can view the status of the Elasticsearch indices. - Get the name of an Elasticsearch pod: - oc get pods --selector component=elasticsearch -o name - $ oc get pods --selector component=elasticsearch -o name pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the status of the indices: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Elasticsearch pods
- You can view the status of the Elasticsearch pods. - Get the name of a pod: - oc get pods --selector component=elasticsearch -o name - $ oc get pods --selector component=elasticsearch -o name pod/elasticsearch-cdm-1godmszn-1-6f8495-vp4lw pod/elasticsearch-cdm-1godmszn-2-5769cf-9ms2n pod/elasticsearch-cdm-1godmszn-3-f66f7d-zqkz7- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the status of a pod: - oc describe pod elasticsearch-cdm-1godmszn-1-6f8495-vp4lw - oc describe pod elasticsearch-cdm-1godmszn-1-6f8495-vp4lw- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The output includes the following status information: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Elasticsearch deployment configuration
- You can view the status of the Elasticsearch deployment configuration. - Get the name of a deployment configuration: - oc get deployment --selector component=elasticsearch -o name - $ oc get deployment --selector component=elasticsearch -o name deployment.extensions/elasticsearch-cdm-1gon-1 deployment.extensions/elasticsearch-cdm-1gon-2 deployment.extensions/elasticsearch-cdm-1gon-3- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the deployment configuration status: - oc describe deployment elasticsearch-cdm-1gon-1 - $ oc describe deployment elasticsearch-cdm-1gon-1- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The output includes the following status information: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
- Elasticsearch ReplicaSet
- You can view the status of the Elasticsearch ReplicaSet. - Get the name of a replica set: - oc get replicaSet --selector component=elasticsearch -o name - $ oc get replicaSet --selector component=elasticsearch -o name replicaset.extensions/elasticsearch-cdm-1gon-1-6f8495 replicaset.extensions/elasticsearch-cdm-1gon-2-5769cf replicaset.extensions/elasticsearch-cdm-1gon-3-f66f7d- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the status of the replica set: - oc describe replicaSet elasticsearch-cdm-1gon-1-6f8495 - $ oc describe replicaSet elasticsearch-cdm-1gon-1-6f8495- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The output includes the following status information: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
Chapter 9. Viewing cluster logging status
You can view the status of the Cluster Logging Operator and for a number of cluster logging components.
9.1. Viewing the status of the Cluster Logging Operator
You can view the status of your Cluster Logging Operator.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Change to the - openshift-loggingproject.- oc project openshift-logging - $ oc project openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- To view the cluster logging status: - Get the cluster logging status: - oc get clusterlogging instance -o yaml - $ oc get clusterlogging instance -o yaml- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The output includes information similar to the following: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
9.1.1. Example condition messages
					The following are examples of some condition messages from the Status.Nodes section of the cluster logging instance.
				
A status message similar to the following indicates a node has exceeded the configured low watermark and no shard will be allocated to this node:
A status message similar to the following indicates a node has exceeded the configured high watermark and shards will be relocated to other nodes:
A status message similar to the following indicates the Elasticsearch node selector in the CR does not match any nodes in the cluster:
A status message similar to the following indicates that the requested PVC could not bind to PV:
A status message similar to the following indicates that the Curator pod cannot be scheduled because the node selector did not match any nodes:
A status message similar to the following indicates that the Fluentd pods cannot be scheduled because the node selector did not match any nodes:
9.2. Viewing the status of cluster logging components
You can view the status for a number of cluster logging components.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
- Change to the - openshift-loggingproject.- oc project openshift-logging - $ oc project openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- View the status of the cluster logging deployment: - oc describe deployment cluster-logging-operator - $ oc describe deployment cluster-logging-operator- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The output includes the following status information: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- View the status of the cluster logging ReplicaSet: - Get the name of a ReplicaSet: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Get the status of the ReplicaSet: - oc describe replicaset cluster-logging-operator-574b8987df - $ oc describe replicaset cluster-logging-operator-574b8987df- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - The output includes the following status information: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
 
Chapter 10. Moving the cluster logging resources with node selectors
You use node selectors to deploy the Elasticsearch, Kibana, and Curator pods to different nodes.
10.1. Moving the cluster logging resources
You can configure the Cluster Logging Operator to deploy the pods for any or all of the Cluster Logging components, Elasticsearch, Kibana, and Curator to different nodes. You cannot move the Cluster Logging Operator pod from its installed location.
For example, you can move the Elasticsearch pods to a separate node because of high CPU, memory, and disk requirements.
You should set your MachineSet to use at least 6 replicas.
Prerequisites
- Cluster logging and Elasticsearch must be installed. These features are not installed by default.
Procedure
- Edit the Cluster Logging Custom Resource in the - openshift-loggingproject:- oc edit ClusterLogging instance - $ oc edit ClusterLogging instance- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Verification steps
					To verify that a component has moved, you can use the oc get pod -o wide command.
				
For example:
- You want to move the Kibana pod from the - ip-10-0-147-79.us-east-2.compute.internalnode:- oc get pod kibana-5b8bdf44f9-ccpq9 -o wide - $ oc get pod kibana-5b8bdf44f9-ccpq9 -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES kibana-5b8bdf44f9-ccpq9 2/2 Running 0 27s 10.129.2.18 ip-10-0-147-79.us-east-2.compute.internal <none> <none>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- You want to move the Kibana Pod to the - ip-10-0-139-48.us-east-2.compute.internalnode, a dedicated infrastructure node:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - Note that the node has a - node-role.kubernetes.io/infra: ''label:- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- To move the Kibana Pod, edit the Cluster Logging CR to add a node selector: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After you save the CR, the current Kibana pod is terminated and new pod is deployed: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- The new pod is on the - ip-10-0-139-48.us-east-2.compute.internalnode:- oc get pod kibana-7d85dcffc8-bfpfp -o wide - $ oc get pod kibana-7d85dcffc8-bfpfp -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES kibana-7d85dcffc8-bfpfp 2/2 Running 0 43s 10.131.0.22 ip-10-0-139-48.us-east-2.compute.internal <none> <none>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- After a few moments, the original Kibana pod is removed. - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Chapter 11. Manually rolling out Elasticsearch
OpenShift Container Platform supports the Elasticsearch rolling cluster restart. A rolling restart applies appropriate changes to the Elasticsearch cluster without down time (if three masters are configured). The Elasticsearch cluster remains online and operational, with nodes taken offline one at a time.
11.1. Performing an Elasticsearch rolling cluster restart
				Perform a rolling restart when you change the elasticsearch configmap or any of the elasticsearch-* deployment configurations.
			
Also, a rolling restart is recommended if the nodes on which an Elasticsearch pod runs requires a reboot.
Prerequisite
- Cluster logging and Elasticsearch must be installed.
Procedure
To perform a rolling cluster restart:
- Change to the - openshift-loggingproject:- oc project openshift-logging - $ oc project openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the following command to extract the CA certificate from Elasticsearch and write to the admin-ca file: - oc extract secret/elasticsearch --to=. --keys=admin-ca - $ oc extract secret/elasticsearch --to=. --keys=admin-ca admin-ca- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Perform a shard synced flush to ensure there are no pending operations waiting to be written to disk prior to shutting down: - oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- curl -s --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key -XPOST 'https://localhost:9200/_flush/synced' - $ oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- curl -s --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key -XPOST 'https://localhost:9200/_flush/synced'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc exec -c elasticsearch-cdm-5ceex6ts-1-dcd6c4c7c-jpw6 -- curl -s --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key -XPOST 'https://localhost:9200/_flush/synced' - oc exec -c elasticsearch-cdm-5ceex6ts-1-dcd6c4c7c-jpw6 -- curl -s --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key -XPOST 'https://localhost:9200/_flush/synced'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Prevent shard balancing when purposely bringing down nodes using the OpenShift Container Platform es_util tool: - oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- es_util --query=_cluster/settings -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "none" } }'- $ oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- es_util --query=_cluster/settings -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "none" } }'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Once complete, for each deployment you have for an ES cluster: - By default, the OpenShift Container Platform Elasticsearch cluster blocks rollouts to their nodes. Use the following command to allow rollouts and allow the pod to pick up the changes: - oc rollout resume deployment/<deployment-name> - $ oc rollout resume deployment/<deployment-name>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc rollout resume deployment/elasticsearch-cdm-0-1 - $ oc rollout resume deployment/elasticsearch-cdm-0-1 deployment.extensions/elasticsearch-cdm-0-1 resumed- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - A new pod is deployed. Once the pod has a ready container, you can move on to the next deployment. - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Once complete, reset the pod to disallow rollouts: - oc rollout pause deployment/<deployment-name> - $ oc rollout pause deployment/<deployment-name>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - oc rollout pause deployment/elasticsearch-cdm-0-1 - $ oc rollout pause deployment/elasticsearch-cdm-0-1 deployment.extensions/elasticsearch-cdm-0-1 paused- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Check that the Elasticsearch cluster is in - greenstate:- oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- es_util --query=_cluster/health?pretty=true - $ oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- es_util --query=_cluster/health?pretty=true- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow Note- If you performed a rollout on the Elasticsearch pod you used in the previous commands, the pod no longer exists and you need a new pod name here. - For example: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - 1
- Make sure this parameter isgreenbefore proceeding.
 
 
- If you changed the Elasticsearch configuration map, repeat these steps for each Elasticsearch pod.
- Once all the deployments for the cluster have been rolled out, re-enable shard balancing: - oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- es_util --query=_cluster/settings -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "none" } }'- $ oc exec <any_es_pod_in_the_cluster> -c elasticsearch -- es_util --query=_cluster/settings -XPUT 'https://localhost:9200/_cluster/settings' -d '{ "transient": { "cluster.routing.allocation.enable" : "none" } }'- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - For example: - Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Chapter 12. Troubleshooting Kibana
Using the Kibana console with OpenShift Container Platform can cause problems that are easily solved, but are not accompanied with useful error messages. Check the following troubleshooting sections if you are experiencing any problems when deploying Kibana on OpenShift Container Platform.
12.1. Troubleshooting a Kubernetes login loop
The OAuth2 proxy on the Kibana console must share a secret with the master host’s OAuth2 server. If the secret is not identical on both servers, it can cause a login loop where you are continuously redirected back to the Kibana login page.
Procedure
To fix this issue:
- Run the following command to delete the current OAuthClient: - oc delete oauthclient/kibana-proxy - $ oc delete oauthclient/kibana-proxy- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
12.2. Troubleshooting a Kubernetes cryptic error when viewing the Kibana console
When attempting to visit the Kibana console, you may receive a browser error instead:
{"error":"invalid_request","error_description":"The request is missing a required parameter,
 includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."}
{"error":"invalid_request","error_description":"The request is missing a required parameter,
 includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed."}This can be caused by a mismatch between the OAuth2 client and server. The return address for the client must be in a whitelist so the server can securely redirect back after logging in.
Fix this issue by replacing the OAuthClient entry.
Procedure
To replace the OAuthClient entry:
- Run the following command to delete the current OAuthClient: - oc delete oauthclient/kibana-proxy - $ oc delete oauthclient/kibana-proxy- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
If the problem persists, check that you are accessing Kibana at a URL listed in the OAuth client. This issue can be caused by accessing the URL at a forwarded port, such as 1443 instead of the standard 443 HTTPS port. You can adjust the server whitelist by editing the OAuth client:
oc edit oauthclient/kibana-proxy
$ oc edit oauthclient/kibana-proxy12.3. Troubleshooting a Kubernetes 503 error when viewing the Kibana console
If you receive a proxy error when viewing the Kibana console, it could be caused by one of two issues:
- Kibana might not be recognizing pods. If Elasticsearch is slow in starting up, Kibana may timeout trying to reach it. Check whether the relevant service has any endpoints: - oc describe service kibana - $ oc describe service kibana Name: kibana [...] Endpoints: <none>- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow - If any Kibana pods are live, endpoints are listed. If they are not, check the state of the Kibana pods and deployment. You might have to scale the deployment down and back up again. 
- The route for accessing the Kibana service is masked. This can happen if you perform a test deployment in one project, then deploy in a different project without completely removing the first deployment. When multiple routes are sent to the same destination, the default router will only route to the first created. Check the problematic route to see if it is defined in multiple places: - oc get route --all-namespaces --selector logging-infra=support - $ oc get route --all-namespaces --selector logging-infra=support- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
Chapter 13. Exported fields
			These are the fields exported by the logging system and available for searching from Elasticsearch and Kibana. Use the full, dotted field name when searching. For example, for an Elasticsearch /_search URL, to look for a Kubernetes Pod name, use /_search/q=kubernetes.pod_name:name-of-my-pod.
		
The following sections describe fields that may not be present in your logging store. Not all of these fields are present in every record. The fields are grouped in the following categories:
- 
					exported-fields-Default
- 
					exported-fields-systemd
- 
					exported-fields-kubernetes
- 
					exported-fields-pipeline_metadata
- 
					exported-fields-ovirt
- 
					exported-fields-aushape
- 
					exported-fields-tlog
13.1. Default exported fields
				These are the default fields exported by the logging system and available for searching from Elasticsearch and Kibana. The default fields are Top Level and collectd*
			
Top Level Fields
				The top level fields are common to every application, and may be present in every record. For the Elasticsearch template, top level fields populate the actual mappings of default in the template’s mapping section.
			
| Parameter | Description | 
|---|---|
| 
								 | 
								The UTC value marking when the log payload was created, or when the log payload was first collected if the creation time is not known. This is the log processing pipeline’s best effort determination of when the log payload was generated. Add the  | 
| 
								 | This is geo-ip of the machine. | 
| 
								 | 
								The  | 
| 
								 | The IP address V4 of the source server, which can be an array. | 
| 
								 | The IP address V6 of the source server, if available. | 
| 
								 | 
								The logging level as provided by rsyslog (severitytext property), python’s logging module. Possible values are as listed at  
								. You should only use  
								Numeric values from  Log levels and priorities from other logging systems should be mapped to the nearest match. See python logging for an example. | 
| 
								 | A typical log entry message, or payload. It can be stripped of metadata pulled out of it by the collector or normalizer, that is UTF-8 encoded. | 
| 
								 | This is the process ID of the logging entity, if available. | 
| 
								 | 
								The name of the service associated with the logging entity, if available. For example, the  | 
| 
								 | Optionally provided operator defined list of tags placed on each log by the collector or normalizer. The payload can be a string with whitespace-delimited string tokens, or a JSON list of string tokens. | 
| 
								 | 
								Optional path to the file containing the log entry local to the collector  | 
| 
								 | The offset value can represent bytes to the start of the log line in the file (zero or one based), or log line numbers (zero or one based), as long as the values are strictly monotonically increasing in the context of a single log file. The values are allowed to wrap, representing a new version of the log file (rotation). | 
| 
								 | 
								Associate this record with the  | 
| 
								 | 
								This is the  | 
collectd Fields
The following fields represent namespace metrics metadata.
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								The  | 
| 
								 | type: string 
								The  | 
| 
								 | type: string 
								The  | 
| 
								 | type: string 
								The  | 
| 
								 | type: string 
								The  | 
| 
								 | type: string 
								The  | 
collectd.processes Fields
				The following field corresponds to the collectd processes plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | 
								type: integer The  | 
collectd.processes.ps_disk_ops Fields
				The collectd ps_disk_ops type of processes plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
collectd.processes.ps_cputime Fields
				The collectd ps_cputime type of processes plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.processes.ps_count Fields
				The collectd ps_count type of processes plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: integer 
								 | 
| 
								 | type: integer 
								 | 
collectd.processes.ps_pagefaults Fields
				The collectd ps_pagefaults type of processes plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.processes.ps_disk_octets Fields
				The collectd ps_disk_octets type of processes plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
| 
								 | type: float 
								The  | 
collectd.disk Fields
				Corresponds to collectd disk plug-in.
			
collectd.disk.disk_merged Fields
				The collectd disk_merged type of disk plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.disk.disk_octets Fields
				The collectd disk_octets type of disk plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.disk.disk_time Fields
				The collectd disk_time type of disk plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.disk.disk_ops Fields
				The collectd disk_ops type of disk plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
| 
								 | type: integer 
								The  | 
collectd.disk.disk_io_time Fields
				The collectd disk_io_time type of disk plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.interface Fields
				Corresponds to the collectd interface plug-in.
			
collectd.interface.if_octets Fields
				The collectd if_octets type of interface plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.interface.if_packets Fields
				The collectd if_packets type of interface plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.interface.if_errors Fields
				The collectd if_errors type of interface plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.interface.if_dropped Fields
				The collectd if_dropped type of interface plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.virt Fields
				Corresponds to collectd virt plug-in.
			
collectd.virt.if_octets Fields
				The collectd if_octets type of virt plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.virt.if_packets Fields
				The collectd if_packets type of virt plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.virt.if_errors Fields
				The collectd if_errors type of virt plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.virt.if_dropped Fields
				The collectd if_dropped type of virt plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.virt.disk_ops Fields
				The collectd disk_ops type of virt plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.virt.disk_octets Fields
				The collectd disk_octets type of virt plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
| 
								 | type: float 
								The  | 
| 
								 | type: float 
								The  | 
| 
								 | type: float 
								The  | 
collectd.CPU Fields
				Corresponds to the collectd CPU plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								The  | 
collectd.df Fields
				Corresponds to the collectd df plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								The  | 
| 
								 | type: float 
								The  | 
collectd.entropy Fields
				Corresponds to the collectd entropy plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: integer 
								The  | 
collectd.memory Fields
				Corresponds to the collectd memory plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								The  | 
| 
								 | type: float 
								The  | 
collectd.swap Fields
				Corresponds to the collectd swap plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
collectd.load Fields
				Corresponds to the collectd load plug-in.
			
collectd.load.load Fields
				The collectd load type of load plug-in
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
| 
								 | type: float 
								 | 
collectd.aggregation Fields
				Corresponds to collectd aggregation plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: float 
								 | 
collectd.statsd Fields
				Corresponds to collectd statsd plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
collectd.postgresql Fields
				Corresponds to collectd postgresql plug-in.
			
| Parameter | Description | 
|---|---|
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
| 
								 | type: integer 
								The  | 
13.2. systemd exported fields
				These are the systemd fields exported by the OpenShift Container Platform cluster logging available for searching from Elasticsearch and Kibana.
			
				Contains common fields specific to systemd journal. Applications may write their own fields to the journal. These will be available under the systemd.u namespace. RESULT and UNIT are two such fields.
			
systemd.k Fields
				The following table contains systemd kernel-specific metadata.
			
| Parameter | Description | 
|---|---|
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								  | 
systemd.t Fields
				systemd.t Fields are trusted journal fields, fields that are implicitly added by the journal, and cannot be altered by client code.
			
| Parameter | Description | 
|---|---|
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
systemd.u Fields
				systemd.u Fields are directly passed from clients and stored in the journal.
			
| Parameter | Description | 
|---|---|
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | 
								 | 
| 
								 | For private use only. | 
| 
								 | For private use only. | 
13.3. Kubernetes exported fields
These are the Kubernetes fields exported by the OpenShift Container Platform cluster logging available for searching from Elasticsearch and Kibana.
				The namespace for Kubernetes-specific metadata. The kubernetes.pod_name is the name of the pod.
			
kubernetes.labels Fields
				Labels attached to the OpenShift object are kubernetes.labels. Each label name is a subfield of labels field. Each label name is de-dotted, meaning dots in the name are replaced with underscores.
			
| Parameter | Description | 
|---|---|
| 
								 | Kubernetes ID of the pod. | 
| 
								 | The name of the namespace in Kubernetes. | 
| 
								 | ID of the namespace in Kubernetes. | 
| 
								 | Kubernetes node name. | 
| 
								 | The name of the container in Kubernetes. | 
| 
								 | The deployment associated with the Kubernetes object. | 
| 
								 | The deploymentconfig associated with the Kubernetes object. | 
| 
								 | The component associated with the Kubernetes object. | 
| 
								 | The provider associated with the Kubernetes object. | 
kubernetes.annotations Fields
				Annotations associated with the OpenShift object are kubernetes.annotations fields.
			
13.4. Container exported fields
These are the Docker fields exported by the OpenShift Container Platform cluster logging available for searching from Elasticsearch and Kibana. Namespace for docker container-specific metadata. The docker.container_id is the Docker container ID.
pipeline_metadata.collector Fields
This section contains metadata specific to the collector.
| Parameter | Description | 
|---|---|
| 
								 | FQDN of the collector. It might be different from the FQDN of the actual emitter of the logs. | 
| 
								 | Name of the collector. | 
| 
								 | Version of the collector. | 
| 
								 | IP address v4 of the collector server, can be an array. | 
| 
								 | IP address v6 of the collector server, can be an array. | 
| 
								 | How the log message was received by the collector whether it was TCP/UDP, or imjournal/imfile. | 
| 
								 | Time when the message was received by the collector. | 
| 
								 | The original non-parsed log message, collected by the collector or as close to the source as possible. | 
pipeline_metadata.normalizer Fields
This section contains metadata specific to the normalizer.
| Parameter | Description | 
|---|---|
| 
								 | FQDN of the normalizer. | 
| 
								 | Name of the normalizer. | 
| 
								 | Version of the normalizer. | 
| 
								 | IP address v4 of the normalizer server, can be an array. | 
| 
								 | IP address v6 of the normalizer server, can be an array. | 
| 
								 | how the log message was received by the normalizer whether it was TCP/UDP. | 
| 
								 | Time when the message was received by the normalizer. | 
| 
								 | The original non-parsed log message as it is received by the normalizer. | 
| 
								 | The field records the trace of the message. Each collector and normalizer appends information about itself and the date and time when the message was processed. | 
13.5. oVirt exported fields
These are the oVirt fields exported by the OpenShift Container Platform cluster logging available for searching from Elasticsearch and Kibana.
Namespace for oVirt metadata.
| Parameter | Description | 
|---|---|
| 
								 | The type of the data source, hosts, VMS, and engine. | 
| 
								 | The oVirt host UUID. | 
ovirt.engine Fields
				Namespace for oVirt engine related metadata. The FQDN of the oVirt engine is ovirt.engine.fqdn
			
13.6. Aushape exported fields
These are the Aushape fields exported by the OpenShift Container Platform cluster logging available for searching from Elasticsearch and Kibana.
Audit events converted with Aushape. For more information, see Aushape.
| Parameter | Description | 
|---|---|
| 
								 | Audit event serial number. | 
| 
								 | Name of the host where the audit event occurred. | 
| 
								 | The error aushape encountered while converting the event. | 
| 
								 | An array of JSONPath expressions relative to the event object, specifying objects or arrays with the content removed as the result of event size limiting. An empty string means the event removed the content, and an empty array means the trimming occurred by unspecified objects and arrays. | 
| 
								 | An array log record strings representing the original audit event. | 
aushape.data Fields
Parsed audit event data related to Aushape.
| Parameter | Description | 
|---|---|
| 
								 | type: nested | 
| 
								 | type: string | 
| 
								 | type: nested | 
| 
								 | type: nested | 
| 
								 | type: nested | 
13.7. Tlog exported fields
These are the Tlog fields exported by the OpenShift Container Platform cluster logging system and available for searching from Elasticsearch and Kibana.
Tlog terminal I/O recording messages. For more information see Tlog.
| Parameter | Description | 
|---|---|
| 
								 | Message format version number. | 
| 
								 | Recorded user name. | 
| 
								 | Terminal type name. | 
| 
								 | Audit session ID of the recorded session. | 
| 
								 | ID of the message within the session. | 
| 
								 | Message position in the session, milliseconds. | 
| 
								 | Distribution of this message’s events in time. | 
| 
								 | Input text with invalid characters scrubbed. | 
| 
								 | Scrubbed invalid input characters as bytes. | 
| 
								 | Output text with invalid characters scrubbed. | 
| 
								 | Scrubbed invalid output characters as bytes. | 
Chapter 14. Uninstalling Cluster Logging
You can remove cluster logging from your OpenShift Container Platform cluster.
14.1. Uninstalling cluster logging from OpenShift Container Platform
You can remove cluster logging from your cluster.
Prerequisites
- Cluster logging and Elasticsearch must be installed.
Procedure
To remove cluster logging:
- Use the following command to remove everything generated during the deployment. - oc delete clusterlogging instance -n openshift-logging - $ oc delete clusterlogging instance -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
- Use the following command to remove the Persistent Volume Claims that remain after the Operator instances are deleted: - oc delete pvc --all -n openshift-logging - $ oc delete pvc --all -n openshift-logging- Copy to Clipboard Copied! - Toggle word wrap Toggle overflow 
        Legal Notice
        
          
            
          
        
      
 
Copyright © 2025 Red Hat
OpenShift documentation is licensed under the Apache License 2.0 (https://www.apache.org/licenses/LICENSE-2.0).
Modified versions must remove all Red Hat trademarks.
Portions adapted from https://github.com/kubernetes-incubator/service-catalog/ with modifications by Red Hat.
Red Hat, Red Hat Enterprise Linux, the Red Hat logo, the Shadowman 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 Software Collections 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.