K8s Event Center records the status changes of Kubernetes clusters. For example, K8s Event Center records a status change when you create, run, or delete a pod, or when a component exception occurs. K8s Event Center aggregates all the events in Kubernetes clusters in real time. This allows you to perform various operations on the events. For example, you can store, query, analyze, and visualize event data and configure alerts for the events. This topic describes how to create and use an event center in K8s Event Center.
Prerequisites
Billing
- The data retention period of the Logstore that is associated with your event center is 90 days, which is the default value.
- The amount of data that is written to your event center per day is less than 256 MB, which is equivalent to approximately 250,000 events.
- If the default data retention period is specified for the associated Logstore and 1,000 events are generated in your Kubernetes cluster per day, you can use your event center for free.
- If you change the data retention period to 105 days and 1,000 events are generated in your Kubernetes cluster per day, you are charged only for the data that is stored in the associated Logstore for a period that exceeds 90 days. The fee is calculated based on the billable item of the storage space occupied by log data. For more information about the billable item, see Billable items.
Step 1: Create an event center
Step 2: Deploy the eventer and node-problem-detector components
Before you can use an event center, you must deploy the eventer and node-problem-detector components in your Kubernetes cluster.
Deploy the eventer and node-problem-detector components in an ACK cluster
The ack-node-problem-detector component that is provided by ACK is integrated with the features of the eventer and node-problem-detector components. Therefore, to deploy the eventer and node-problem-detector components in an ACK cluster, you need to only deploy the ack-node-problem-detector component. For more information, see Event monitoring. If you use an ASK cluster, you must deploy the kube-eventer component.
In this example, an ACK cluster is used.
Deploy the eventer and node-problem-detector components in a self-managed Kubernetes cluster
Step 3: Use an event center
After you create an event center in K8s Event Center and deploy the eventer and node-problem-detector components, you can use the event center. For example, you can use the event center to view event statistics, query event details, view the lifecycle of a pod, view node events, view core component events, configure alerts, perform custom queries, and update the version of K8s Event Center.
In the left-side navigation pane of the K8s Event Center page, find the event center that you want to manage and click the icon. Then, you can perform the following operations.
Operation | Description |
---|---|
View event statistics | The Event Overview tab displays the statistics of core events. The statistics include the total number
of events, the difference between the number of error events within the current day
and the preceding day, statistics of alert items, trends of error events, and details
of pod OOM events.
Note If a pod OOM event is recorded, you can view only the node on which the event occurs,
process name, and process ID. The pod in which the event occurs cannot be located.
However, you can query the pod restart event that occurs around the time of the pod
OOM event. This way, you can locate the pod.
|
Query event details | The Event Details tab displays the details about the events that are returned by using different filter conditions, such as the event type, event destination, host, namespace, and name. |
View the lifecycle of a pod | The Pod Lifecycle tab displays the details about the events that occur within the lifecycle of a pod. You can filter important pod events by event level. |
View node events | The Node Event tab displays the details about node events. You can view the lifecycle of a node and the events that occur on the node. |
View core component events | The Event Core tab displays the details about core component events. The events include NLC.Task.RestartECS.Fail and NLC.Task.URL.Mode.Unimplemented. |
Configure alerts | On the page that appears after you click Alert Configuration, you can configure alerts for your event center. For more information, see Configure alerts. |
Perform custom queries | On the page that appears after you click Custom Query, you can customize query statements.
All events in an event center are stored in a Logstore. You can use all features of the Logstore. For example, you can perform custom queries, consume event data, create custom reports, or configure custom alerts. For more information, see Query and analyze logs. If you want to access a project that is specified for an event center, you can obtain
the name of the project by using one of the following methods:
|
Update the version of K8s Event Center | On the page that appears after you click Version Update, you can update the version of K8s Event Center. |
Delete an event center
On the icon in the Actions column.
FAQ
- Why does no data exist in my event center?
After you deploy an event center, new events are automatically collected to the event center. You can click Custom Query to search for the events. We recommend that you set the time range in the upper-right corner to 1 Day. Data may not be found in the event center due to the following reasons:
- After you deploy the event center, no events are generated in the associated Kubernetes
cluster.
You can run the
kubectl get events --all-namespaces
command to check whether new events are generated in a cluster. - Invalid values are specified for the parameters that are used to deploy the eventer
and node-problem-detector components.
- If you are using an ACK cluster, perform the following steps:
- Log on to the ACK console.
- On the Clusters page, find the cluster that you want to manage and click the name of the cluster.
- In the left-side navigation pane, choose .
- On the Helm page, find ack-node-problem-detector and click Update in the Actions column.
- Check and modify the parameter settings. For more information, see Step 2: Deploy the eventer and node-problem-detector components.
- If you are using a self-managed Kubernetes cluster, check the configurations based on the descriptions in Collect Kubernetes events.
- If you are using an ACK cluster, perform the following steps:
- After you deploy the event center, no events are generated in the associated Kubernetes
cluster.
- How do I view the logs of a container in which an event occurs?
- If you are using an ACK cluster, perform the following steps:
- Log on to the ACK console.
- On the Clusters page, find the cluster that you want to manage and click the name of the cluster.
- In the left-side navigation pane, choose .
- Set the Namespace parameter to kube-system.
- On the Pods page, find the pod that you want to manage and click Logs in the Actions column.
- If you are using a self-managed Kubernetes cluster, filter the kube-system namespace and find the file whose name is prefixed with eventer-sls to view the pod logs.
- If you are using an ACK cluster, perform the following steps: