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 contenido no está disponible en el idioma seleccionado.
Chapter 5. Working with Event Router
The Event Router communicates with the OpenShift Container Platform and prints OpenShift Container Platform events to log of the pod where the event occurs.
If Cluster Logging is deployed, you can view the OpenShift Container Platform events in Kibana.
5.1. Deploying and Configuring the Event Router Copiar enlaceEnlace copiado en el portapapeles!
Use the following steps to deploy Event Router into your cluster.
The following Template object creates the Service Account, ClusterRole, and ClusterRoleBinding required for the Event Router.
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.
Set
TRANSFORM_EVENTS=true
in order to process and store event router events in Elasticsearch.- Set cluster logging to the unmanaged state.
Enable the
TRANSFORM_EVENTS
feature.oc set env ds/fluentd TRANSFORM_EVENTS=true
$ oc set env ds/fluentd TRANSFORM_EVENTS=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
Create a template for the Event Router:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Creates a Service Account for the Event Router.
- 2
- Creates a cluster role to monitor for events in the cluster.
- 3
- Allows the
get
,watch
, andlist
permissions for theevents
resource. - 4
- Creates a ClusterRoleBinding to bind the ClusterRole to the ServiceAccount.
- 5
- Specify the image version for the Event Router.
- 6
- Specify the memory limit for the Event Router pods. Defaults to '128Mi'.
- 7
- Specify the minimum amount of CPU to allocate to the Event Router. Defaults to '100m'.
- 8
- Specify the namespace where eventrouter is deployed. Defaults to
openshift-logging
. The value must be the same as specified for the ServiceAccount and ClusterRoleBinding. The project indicates where in Kibana you can locate events:-
If the event router pod is deployed in a default project, such as
kube-*
andopenshift-*
, you can find the events under the .operation index. - If the event router pod is deployed in other projects, you can find the event under the index using the project namespace.
-
If the event router pod is deployed in a default project, such as
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:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Validate that the Event Router installed:
oc get pods --selector component=eventrouter -o name
$ oc get pods --selector component=eventrouter -o name pod/logging-eventrouter-d649f97c8-qvv8r
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc logs logging-eventrouter-d649f97c8-qvv8r
$ oc logs logging-eventrouter-d649f97c8-qvv8r {"verb":"ADDED","event":{"metadata":{"name":"elasticsearch-operator.v0.0.1.158f402e25397146","namespace":"openshift-operators","selfLink":"/api/v1/namespaces/openshift-operators/events/elasticsearch-operator.v0.0.1.158f402e25397146","uid":"37b7ff11-4f1a-11e9-a7ad-0271b2ca69f0","resourceVersion":"523264","creationTimestamp":"2019-03-25T16:22:43Z"},"involvedObject":{"kind":"ClusterServiceVersion","namespace":"openshift-operators","name":"elasticsearch-operator.v0.0.1","uid":"27b2ca6d-4f1a-11e9-8fba-0ea949ad61f6","apiVersion":"operators.coreos.com/v1alpha1","resourceVersion":"523096"},"reason":"InstallSucceeded","message":"waiting for install components to report healthy","source":{"component":"operator-lifecycle-manager"},"firstTimestamp":"2019-03-25T16:22:43Z","lastTimestamp":"2019-03-25T16:22:43Z","count":1,"type":"Normal"}}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow