forked from opsgenie/kubernetes-event-exporter
-
Notifications
You must be signed in to change notification settings - Fork 162
/
config.example.yaml
124 lines (124 loc) · 3.45 KB
/
config.example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
logLevel: debug
logFormat: json
maxEventAgeSeconds: 10
kubeQPS: 60
kubeBurst: 60
# namespace: my-namespace-only # Omitting it defaults to all namespaces.
route:
# Main route
routes:
# This route allows dumping all events because it has no fields to match and no drop rules.
- match:
- receiver: "dump"
# This starts another route, drops all the events in *test* namespaces and Normal events
# for capturing critical events
- match:
- receiver: "alert"
- receiver: "pipe"
drop:
- namespace: "*test*"
- type: "Normal"
minCount: 5
apiVersion: "*beta*"
# This a final route for user messages
- match:
- kind: "Pod|Deployment|ReplicaSet"
labels:
version: "dev"
receiver: "slack"
- match:
- receiver: "firehose"
drop:
- type: "Normal"
receivers:
- name: "dump"
elasticsearch:
hosts:
- "http://localhost:9200"
indexFormat: "kube-events-{2006-01-02}"
apiKey: ${ELASTIC_API_KEY}
- name: "opensearch-dump"
opensearch:
hosts:
- "http://localhost:9200"
indexFormat: "kube-events-{2006-01-02}"
- name: "alert"
opsgenie:
apiKey: ""
priority: "P3"
message: "Event {{ .Reason }} for {{ .InvolvedObject.Namespace }}/{{ .InvolvedObject.Name }} on K8s cluster"
alias: "{{ .UID }}"
description: "<pre>{{ toPrettyJson . }}</pre>"
tags:
- "event"
- "{{ .Reason }}"
- "{{ .InvolvedObject.Kind }}"
- "{{ .InvolvedObject.Name }}"
- name: "slack"
slack:
token: ""
channel: "#mustafa-test"
message: "Received a Kubernetes Event {{ .Message}}"
fields:
message: "{{ .Message }}"
namespace: "{{ .Namespace }}"
reason: "{{ .Reason }}"
object: "{{ .Namespace }}"
- name: "pipe"
webhook:
endpoint: "http://localhost:3000"
headers:
X-API-KEY: "123-456-OPSGENIE-789-ABC"
User-Agent: "kube-event-exporter 1.0"
streamName: "applicationMetric"
layout:
endpoint: "localhost2"
eventType: "kube-event"
createdAt: "{{ .GetTimestampMs }}"
details:
message: "{{ .Message }}"
reason: "{{ .Reason }}"
tip: "{{ .Type }}"
count: "{{ .Count }}"
kind: "{{ .InvolvedObject.Kind }}"
name: "{{ .InvolvedObject.Name }}"
namespace: "{{ .Namespace }}"
component: "{{ .Source.Component }}"
host: "{{ .Source.Host }}"
labels: "{{ toJson .InvolvedObject.Labels}}"
- name: "kafka"
kafka:
topic: "kube-event"
brokers:
- "localhost:9092"
tls:
enable: false
certFile: "kafka-client.crt"
keyFile: "kafka-client.key"
caFile: "kafka-ca.crt"
- name: "pubsub"
pubsub:
gcloud_project_id: "my-project"
topic: "kube-event"
create_topic: False
- name: "eventbridge"
eventbridge:
detailType: "deployment"
source: "cd"
eventBusName: "default"
region: "ap-southeast-1"
details:
message: "{{ .Message }}"
namespace: "{{ .Namespace }}"
reason: "{{ .Reason }}"
object: "{{ .Namespace }}"
- name: "syslog"
syslog:
network: "tcp"
address: "127.0.0.1:11514"
tag: "k8s.event"
- name: "firehose"
firehose:
deliveryStreamName: "kubernetes-events"
region: "us-east-1"
deDot: true