tencent cloud

Tencent Kubernetes Engine

tke-event-collector Description

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-10-23 16:19:16
Diterjemahkan oleh AI

Component Introduction

tke-event-collector listens for cluster events and reports them to CLS to achieve cluster event persistence. This component is hosted on TKE as a Deployment.

Scenarios

You can use tke-event-collector to collect cluster events and report them to CLS. In the TKE console, go to Cluster ID > Logs > Event Logs to view the event overview and aggregated search of exception events on the event search page. You can also search events in the global search page as needed.

Usage

1. Log in to the TKE console and select Clusters in the left sidebar.
2. In the cluster list, click the target cluster ID to go to the cluster details page.
3. Select Logs in the left sidebar, and click Enable next to Event Logs on the Log Collection tab.
4. In the Enable Event Log dialog box, select the log region and configure a logset and a log topic.
Region: CLS supports cross-region log shipping. You can select the target region for log shipping.
Logset: Based on the selected region, the system displays logsets you have created. If no existing logset is suitable, you can create a new one in the CLS console. For more information, see Creating a Logset.
Attention:
Up to 500 log topics and metric topics can be created for each logset.
Log Topic: Select the corresponding log topic under the logset. A log topic can be automatically created or an existing log topic can be selected.
5. Click OK to enable the event log feature.
6. Select Logs in the left sidebar, and click Search Analysis next to Event Logs on the Log Collection tab.
7. On the Event Logs page, click Global Search, configure fields to display as needed, and perform search and analysis.

Updating Terraform Configuration

When managing the tke-event-collector component with Terraform, we recommend that you use the tencentcloud_kubernetes_addon_config resource to update the component configuration.

Resource Selection Notes

Scenario
Recommended Resource
Install or manage component lifecycle
tencentcloud_kubernetes_addon
Update configuration parameters of installed components
tencentcloud_kubernetes_addon_config

raw_values Parameter Description

raw_values accepts a string in JSON format, which contains the Values configuration of the corresponding Helm Chart for the component.

Configuration Example

resource "tencentcloud_kubernetes_addon_config" "tke_event_collector" {
cluster_id = "cls-xxxxxxxx" # Replace it with your cluster ID.
addon_name = "tke-event-collector"
raw_values = jsonencode({
replicaCount = 1
resources = {
requests = {
cpu = "100m"
memory = "128Mi"
}
limits = {
cpu = "200m"
memory = "256Mi"
}
}
})
}
Attention:
In raw_values, enter the Helm Values content in JSON format. Specify only the parameters that you want to modify. Unspecified parameters will retain their default values.
To view the complete list of configurable parameters, see the parameter description of the corresponding component in the TKE console.

Updating Component Configuration via Terraform

You can use the Tencent Cloud Terraform Provider to update the configuration of the installed tke-event-collector component.
Note:
To update the configuration parameters of an installed component, we recommend that you use the tencentcloud_kubernetes_addon_config resource.
To install or uninstall a component, use the tencentcloud_kubernetes_addon_attachment resource.

Prerequisites

You have installed Terraform and configured the Tencent Cloud Provider.
A TKE cluster has been created, the cluster ID has been obtained (format: cls-xxxxxxxx), and the tke-event-collector component has been installed in the cluster.
You have created a logset and a log topic in the CLS console and recorded their IDs.

Operation Example

The following example demonstrates how to use Terraform to update the CLS destination configuration and resource quotas of tke-event-collector:
resource "tencentcloud_kubernetes_addon_config" "event_collector" {
cluster_id = "cls-xxxxxxxx" # Replace it with your cluster ID.
addon_name = "kube-event-collector"
raw_values_type = "json"
raw_values = jsonencode({
global = {
# CLS Logset and Log Topic Configuration
clsLogSetRegion = "ap-guangzhou" # The region where the CLS logset is stored.
clsLogSetId = "logset-xxxxxxxx" # Logset ID.
clsTopicId = "topic-xxxxxxxx" # Log topic ID.
}
resources = {
requests = {
cpu = "50m"
memory = "64Mi"
}
limits = {
cpu = "100m"
memory = "128Mi"
}
}
})
}
Attention:
In the addon_name field, the Terraform addon name for tke-event-collector is kube-event-collector. Note the distinction.

raw_values Description

The raw_values field accepts a string in JSON format, which contains the configurable parameters of the component.
Parameter Path
Type
Description
global.clsLogSetRegion
string
Region where the CLS logset resides, for example, "ap-guangzhou"
global.clsLogSetId
string
CLS logset ID, for example, "logset-xxxxxxxx"
global.clsTopicId
string
CLS log topic ID, for example, "topic-xxxxxxxx"
resources.requests.cpu
string
CPU request of the container, for example, "50m"
resources.requests.memory
string
Memory request of the container, for example, "64Mi"
resources.limits.cpu
string
CPU limit of the container, for example, "100m"
resources.limits.memory
string
Memory limit of the container, for example, "128Mi"
Note:
The configurable parameters vary depending on the component version. Use the parameters displayed on the Component Management > tke-event-collector > Parameter Configuration page in the TKE console as the standard. After modifying raw_values, run terraform apply. Terraform will automatically compare and apply the changes without recreating resources.

References



Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan