Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AliyunContainerService/kube-eventer
kube-eventer emit kubernetes events to sinks
https://github.com/AliyunContainerService/kube-eventer
Last synced: about 2 months ago
JSON representation
kube-eventer emit kubernetes events to sinks
- Host: GitHub
- URL: https://github.com/AliyunContainerService/kube-eventer
- Owner: AliyunContainerService
- License: apache-2.0
- Created: 2019-06-14T09:13:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-22T09:38:24.000Z (4 months ago)
- Last Synced: 2024-08-22T10:56:32.625Z (4 months ago)
- Language: Go
- Homepage:
- Size: 19.8 MB
- Stars: 993
- Watchers: 26
- Forks: 275
- Open Issues: 42
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ops - AliyunContainerService/kube-eventer - 2.0|998|2019-06-14|2024-08-22 | 一个 K8S 事件同步工具,支持将事件同步到 DingDing, ES, Kafka,MySQL,Webhook 等 | (K8S-Tools)
README
## kube-eventer
kube-eventer emit kubernetes events to sinks
### Overview
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![Build Status](https://travis-ci.org/AliyunContainerService/kube-eventer.svg?branch=master)](https://travis-ci.org/AliyunContainerService/kube-eventer)
[![Codecov](https://codecov.io/gh/AliyunContainerService/kube-eventer/branch/master/graph/badge.svg)](https://codecov.io/gh/AliyunContainerService/kube-eventer)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
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.0. Get dingtalk token
Add a chatbot in a dingtalk group and get bot token.
1. 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
```
2. 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.mdYou 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.