MCPcopy Index your code
hub / github.com/AliyunContainerService/kube-eventer

github.com/AliyunContainerService/kube-eventer @1.2.14

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.2.14 ↗ · + Follow
531 symbols 1,412 edges 74 files 70 documented · 13% updated 2mo ago1.2.14 · 2026-01-06★ 1,08531 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

kube-eventer

<img src="https://github.com/AliyunContainerService/kube-eventer/raw/1.2.14/docs/logo/kube-eventer.png" width="150px" />



kube-eventer emit kubernetes events to sinks

Overview

License Build Status Codecov

kube-eventer is an event emitter that sends kubernetes events to sinks(.e.g, dingtalk,sls,kafka and so on). The core design concept of kubernetes is state machine. So there will be Normal events when transfer to desired state and Warning events occur when to unexpected state. kube-eventer can help to diagnose, analysis and alarm problems.

Architecture diagram

<img src="https://github.com/AliyunContainerService/kube-eventer/raw/1.2.14/docs/images/arch.png" width="500px" />



Architecture diagram of kube-eventer

Usage

Here is a demo of kube-eventer with dingtalk sink. Dingtalk is an All-in-one Mobile Workplace like slack. Dingtalk sink can get kubernetes events from eventer. You can do chatops with it. Try it following the steps below.

  1. Get dingtalk token Add a chatbot in a dingtalk group and get bot token.

  2. Install eventer and configure sink

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: kube-eventer
  name: kube-eventer
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kube-eventer
  template:
    metadata:
      labels:
        app: kube-eventer
      annotations:  
        scheduler.alpha.kubernetes.io/critical-pod: ''
    spec:
      dnsPolicy: ClusterFirstWithHostNet
      serviceAccount: kube-eventer
      containers:
        - image: registry.aliyuncs.com/acs/kube-eventer:v1.2.7-ca03be0-aliyun
          name: kube-eventer
          command:
            - "/kube-eventer"
            - "--source=kubernetes:https://kubernetes.default"
            ## .e.g,dingtalk sink demo
            - --sink=dingtalk:[your_webhook_url]&label=[your_cluster_id]&level=[Normal or Warning(default)]
          env:
          # If TZ is assigned, set the TZ value as the time zone
          - name: TZ
            value: "Asia/Shanghai" 
          volumeMounts:
            - name: localtime
              mountPath: /etc/localtime
              readOnly: true
            - name: zoneinfo
              mountPath: /usr/share/zoneinfo
              readOnly: true
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 500m
              memory: 250Mi
      volumes:
        - name: localtime
          hostPath:
            path: /etc/localtime
        - name: zoneinfo
          hostPath:
            path: /usr/share/zoneinfo
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kube-eventer
rules:
  - apiGroups:
      - ""
    resources:
      - configmaps
      - events
    verbs:
      - get
      - list
      - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kube-eventer
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: kube-eventer
subjects:
  - kind: ServiceAccount
    name: kube-eventer
    namespace: kube-system
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: kube-eventer
  namespace: kube-system
  1. View events in dingtalk

Sink Configure

Supported Sinks:

Sink Name Description
dingtalk sink to dingtalk bot
sls sink to alibaba cloud sls service
elasticsearch sink to elasticsearch
honeycomb sink to honeycomb
influxdb sink to influxdb
kafka sink to kafka
mysql sink to mysql database
wechat sink to wechat
webhook sink to webhook
mongodb sink to mongodb

Contributing

Please check CONTRIBUTING.md

You can also ask for help in our Dingtalk group. dingtalk group1 (full): 30612594 dingtalk group2: 5605020816

License

This software is released under the Apache 2.0 license.

Extension points exported contracts — how you extend this code

EventSink (Interface)
(no doc) [14 implementers]
core/types.go
Filter (Interface)
All filter interface [1 implementers]
common/filters/filter.go
MetricsSource (Interface)
A place from where the metrics should be scraped.
metrics/core/types.go
SaveDataFunc (FuncType)
SaveDataFunc is a pluggable function to enforce limits on the object
sinks/mysql/mysql.go
SaveDataFunc (FuncType)
SaveDataFunc is a pluggable function to enforce limits on the object
sinks/elasticsearch/driver.go
KafkaClient (Interface)
(no doc) [2 implementers]
common/kafka/kafka.go
InfluxdbClient (Interface)
(no doc) [1 implementers]
common/influxdb/influxdb.go
Manager (Interface)
(no doc) [1 implementers]
manager/manager.go

Core symbols most depended-on inside this repo

String
called by 99
common/flags/flags.go
Error
called by 30
common/elasticsearch/elasticsearch.go
GetLastEventTimestamp
called by 20
util/common.go
Query
called by 15
common/influxdb/influxdb.go
ExportEvents
called by 13
core/types.go
Index
called by 12
common/elasticsearch/elasticsearch.go
Name
called by 11
core/types.go
Set
called by 11
common/flags/flags.go

Shape

Function 218
Method 200
Struct 86
Interface 15
TypeAlias 8
FuncType 4

Languages

Go100%

Modules by API surface

metrics/core/types.go24 symbols
metrics/core/historical_types.go18 symbols
common/elasticsearch/elasticsearch.go18 symbols
sinks/sls/sls.go15 symbols
sinks/wechat/wechat.go14 symbols
sinks/eventbridge/driver.go14 symbols
sinks/dingtalk/dingtalk.go14 symbols
common/kafka/kafka.go14 symbols
sinks/influxdb/influxdb.go13 symbols
metrics/prometheus/judge.go12 symbols
sinks/utils/aliyun_util.go11 symbols
common/elasticsearch/elastic7.go11 symbols

Datastores touched

eventCollection · 1 repos
(mongodb)Database · 1 repos
k8sDatabase · 1 repos

For agents

$ claude mcp add kube-eventer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact