Skip to main content

TKE Event Log Alerts

Kubernetes Event Logs

Kubernetes resources generate event logs, divided into Normal and Warning types. Normal type logs are general event logs, such as Pod scheduling success, image pulling, etc. Warning type logs are abnormal event logs, such as Pod startup failure, Node disk pressure, etc.

Event logs are standard interfaces provided by Kubernetes. Besides Kubernetes components generating event logs, other components can also send event logs to Kubernetes clusters in the same way, such as cert-manager:

Collecting Event Logs

TKE supports one-click enabling of event log collection, collecting Kubernetes event logs to CLS for storage, retrieval, and alerting. For details, refer to Cluster Operations: Event Logs.

Configuring Event Log Alerts

Usually we focus on Warning type logs and can configure unified event log alerts.

Operation steps:

  1. Click Create on the Alert Policy page.
  2. Monitoring Object selects the log topic of TKE cluster event logs.
  3. Execution Statement fills in event.type:Warning.
  4. Additional Notification Content:
{{- range .QueryLog }}
Cluster cls-xxxxxxxx has abnormal events:
{{- range . }}
{{.content.event.reason}} {{ .content.event.involvedObject.kind }}/{{ .content.event.involvedObject.name }} {{ .content.event.message }}
{{- end}}
{{- end}}

Note to replace the cluster ID.

Other configuration items can be configured as needed.

Alert Effects

Email Alert

WeChat Alert

References