This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better default config to log to stdout, debug log added for involved …
…object capturing
- Loading branch information
1 parent
336fa39
commit fee8951
Showing
7 changed files
with
102 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
logLevel: debug | ||
logFormat: json | ||
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 | ||
- drop: | ||
- namespace: "*test*" | ||
- type: "Normal" | ||
match: | ||
- receiver: "alert" | ||
- receiver: "pipe" | ||
# This a final route for user messages | ||
- match: | ||
- kind: "Pod|Deployment|ReplicaSet" | ||
labels: | ||
version: "dev" | ||
receiver: "slack" | ||
receivers: | ||
- name: "dump" | ||
elasticsearch: | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,10 @@ | ||
logLevel: debug | ||
logLevel: error | ||
logFormat: json | ||
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 | ||
- drop: | ||
- namespace: "*test*" | ||
- type: "Normal" | ||
match: | ||
- receiver: "alert" | ||
- receiver: "pipe" | ||
# This a final route for user messages | ||
- match: | ||
- kind: "Pod|Deployment|ReplicaSet" | ||
labels: | ||
version: "dev" | ||
receiver: "slack" | ||
receivers: | ||
- name: "dump" | ||
elasticsearch: | ||
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 | ||
file: | ||
path: "/tmp/deneme1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters