githubEdit

Kube Eventer

kube-eventer

Collecting K8S Cluster Events with kube-eventer

1. Background

Overview

  • What are events: Kubernetes architecture is designed based on a state machine. State transitions generate corresponding events. Transitions between normal states generate Normal-level events, while transitions between normal and abnormal states generate Warning-level events.

  • kube-eventer component: An open-source component by Alibaba Cloud, used to collect event messages from K8S clusters and store them in custom middleware or storage. (K8S clusters only retain events for 1 hour by default)

  • Official repository: https://github.com/AliyunContainerService/kube-eventer

Prerequisites and Software

Name
Function
Notes

K8S Cluster

Application cluster

Using minikube test cluster

kube-eventer

Collect K8S cluster events

Third-party cluster component

Kafka / Elasticsearch / influxDB

Middleware: store event messages

Storage component (Kafka selected)

kube-eventer-py

Retrieve event messages from queue and send to Telegram alert group

Event consumer

2. Installation and Deployment Steps

a) minikube Cluster Deployment

Reference: https://minikube.sigs.k8s.io/docs/start/

b) Storage Middleware Deployment

Kafka

Deploy Kafka using Helm

elasticsearch

c) kube-eventer Deployment

  • Deploy using official YAML resource files

d) Retrieve Events from Message Queue and Send to Telegram

  • Create Telegram bot and alert group

References

  1. Bot creation: https://cloud.tencent.com/developer/article/1835051

  2. Telegram Python SDK: https://github.com/python-telegram-bot/python-telegram-bot

  • Python script details

  • Dockerfile Configuration

  • Build Image and Verify Startup

  • Event Message Reception Verification

Last updated