Commit Graph
87 Commits
Author SHA1 Message Date
Mustafa Akin 077bb6654c Namespace support to work without cluster scope, fixes #42 2020-06-22 18:28:11 +03:00
Mustafa Akin fee89514e8 better default config to log to stdout, debug log added for involved object capturing 2020-06-22 18:17:18 +03:00
Mustafa Akin 336fa39c4c Go mod vendor fixes #19 2020-06-22 17:37:29 +03:00
Mustafa Akin d262b1f7c7 Treat all 2xx succesful in webhook, fixes #57 2020-06-22 17:36:56 +03:00
Mustafa Akin c4a5dd0857 Merge branch 'master' of github.com:opsgenie/kubernetes-event-exporter into multiple-fixes-for-issues 2020-06-22 17:35:36 +03:00
Mustafa Akin 1a24caeeeb Log format support, fixes #52 2020-06-22 17:31:01 +03:00
Mustafa Akin 0499da9706 Go mod vendor fixes #54 2020-06-22 17:10:52 +03:00
Mustafa Akin 1ff1f121db Test for issue #51 2020-06-22 17:04:25 +03:00
Mustafa Akin 823662b2a9 Fixes #48, Elasticsearch is not taking layout although documented to do so 2020-06-22 16:55:17 +03:00
Mustafa AkınandGitHub ae8bfb579d Merge pull request #53 from jaydp17/webhook-return-err
return err in webhook sink
2020-06-22 16:44:54 +03:00
Mustafa AkınandGitHub 112e224047 Merge pull request #49 from lesh366/master
New ms teams support
2020-06-22 16:44:32 +03:00
Mustafa AkınandGitHub 9d8c746d1b Merge pull request #45 from youyongsong/patch/support-rotate-in-file-sink
Add file rolling function in file sink.
2020-06-22 16:44:01 +03:00
Mustafa AkınandGitHub d48d8a95f1 Merge pull request #44 from youyongsong/patch/exit-after-leader-lost
fix leader election bug introduced by #37.
2020-06-22 16:43:34 +03:00
Mustafa AkınandGitHub b0edf7ca99 Merge pull request #50 from njegosrailic/webhook_status_code
Handle HTTP Status code 201 in the webhook sink
2020-06-22 16:43:14 +03:00
Jaydeep Solanki 18bdae4d23 return err in webhook sink 2020-06-01 16:40:09 +05:30
80f904e39f Update pkg/sinks/webhook.go
Co-authored-by: Heinz N. Gies <heinz@licenser.net>
2020-05-29 13:09:43 +02:00
Njegos Railic 8aae6e0d9a Handle HTTP Status code 201 in the webhook sink 2020-05-29 12:32:21 +02:00
lesh366andGitHub 72eb5b6087 readme for ms teams 2020-05-27 12:47:24 +03:00
elads 00bd85193c Merge branch 'master' of https://github.com/lesh366/kubernetes-event-exporter-1 2020-05-27 05:30:35 -04:00
elads 6036993217 update vendor modules 2020-05-27 05:30:23 -04:00
lesh366andGitHub 62b1c4cae2 format alligment 2020-05-27 12:18:09 +03:00
elads bbdecb204e new microsoft teams support 2020-05-27 05:15:33 -04:00
youyongsong 15f2feb28f Add file rolling function in file sink.
I known File Sink is currently mostly used in local development, but we also tend to use it in our production environment with fluentd, because this combination is very stable and reliable.

Currently File Sink lacks the file rolling function, which is very important for the production environment. So I want to add file rolling function to File Sink through this pr without breaking changes.

file rolling is disabled by default, and can be enabled by adding the following arguments:

```yaml
- receivers:
  file:
    path: ./test.log
    maxsize: 20    // if ./test.log is larger than 20MB, it will be renamed to ./test-<datetime>.log as a backup file,
    and create a new file named test.log to receive events. It defaults to 100 megabytes.
    maxage: 20     // if backup files ./test-<datetime>.log are created 20 days ago, they will be deleted. The default
    is not to remove old log files based on age.
    maxbackups: 3  // if backup files are more than 3, older backup files will be removed.
```

the rolling function is powered by [lumberjack](https://github.com/natefinch/lumberjack). Becasue `lumberjack.Logger` implmented `io.WriteCloser` interface, so it is easy to replace `file *os.file` with `writer &lumberjack.Logger`.

run kubernetes-event-exporter with following config:
```yaml
logLevel: debug
route:
  match:
    - receiver: "file"
receivers:
  - name: "file"
    file:
      path: "./event.log"
      maxsize: 1
      maxbackups: 4
```
run following script to generate events and output `./event*.log` status:
```shell
while true
do
  kubectl run nginx --image nginx || kubectl delete deployment nginx
  ls -lh event*.log
  sleep 2
done
```
the result is:
```
deployment.apps "nginx" deleted
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:03 event-2020-03-04T10-03-30.271.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:15 event-2020-03-04T10-15-52.496.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:28 event-2020-03-04T10-28-27.334.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:41 event-2020-03-04T10-41-11.316.log
-rw-r--r-- 1 ysyou staff 1023K Mar  4 18:54 event.log
deployment.apps/nginx created
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:15 event-2020-03-04T10-15-52.496.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:28 event-2020-03-04T10-28-27.334.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:41 event-2020-03-04T10-41-11.316.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:54 event-2020-03-04T10-54-11.451.log
-rw-r--r-- 1 ysyou staff 2.0K Mar  4 18:54 event.log
```
when `event.log` reaches 1M, it is renamed to `event-2020-03-04T10-54-11.451.log`, because backup files are more than 4, the oldest one `event-2020-03-04T10-03-30.271.log` is deleted.
2020-05-06 16:07:36 +08:00
youyongsong 2d8f6bc324 fix leader election bug introduced by #37.
I just found a bug in #37. When the leader is lost(mainly due to apiserver timeout), the program will stop watch events but will not exit,it will always hung there.
I modified this part of the logic in this pr. After the leader is lost, the program will exit the same as it received exit signal. Then a new pod will be scheduled to participate in the election.
Sorry for introducing this bug in # 37, hope this pr will fix it.
2020-05-06 15:11:51 +08:00
Mustafa Akin d6b6842ceb Updated Dockerfile for 1.14 and the deployment YAML 2020-05-02 02:03:37 +03:00
Mustafa Akın 8c06aa38c4 Bump Go version 2020-05-02 01:55:10 +03:00
Mustafa Akın f669926f8d Vendor changes v0.7 2020-05-02 01:50:36 +03:00
Mustafa AkınandGitHub 2d407677a8 Merge pull request #36 from mheck136/elasticsearch-tls-config
Update README to match elasticsearch TLS settings
2020-05-02 01:27:24 +03:00
Mustafa AkınandGitHub b3695e478d Merge pull request #37 from youyongsong/feature/support-leader-election
feature: support leader election
2020-05-02 01:25:27 +03:00
Mustafa AkınandGitHub 6eb781cfd6 Merge pull request #39 from ameyajoshi99/feature/annotations-filter
Feature/annotations filter
2020-05-02 01:24:59 +03:00
Mustafa AkınandGitHub 588609ee21 Merge pull request #40 from brianterry/OpsCenter
Add OpsCenter as a receiver
2020-05-02 01:23:30 +03:00
Brian Terry 83a8bbb38c Update readme 2020-04-22 13:50:01 -04:00
Brian Terry 5361316cf4 Update readme 2020-04-22 13:48:04 -04:00
Brian Terry 8c0bc19a25 Add receiver 2020-04-22 13:39:42 -04:00
Brian Terry 16fb7846c3 Revert "Add Opscenter to receiver"
This reverts commit 5104e4c878.
2020-04-22 13:38:04 -04:00
Brian Terry 23a1cacfec Update readme 2020-04-22 13:26:11 -04:00
Brian Terry 6ab3c6cee9 Update readme 2020-04-22 13:24:18 -04:00
Brian Terry a8c2a69c2e Update readme 2020-04-22 13:19:11 -04:00
Brian Terry 5104e4c878 Add Opscenter to receiver 2020-04-22 12:47:00 -04:00
Brian Terry f30e730a25 Add testing 2020-04-22 12:42:06 -04:00
Brian Terry d722fe1c67 Add testing 2020-04-21 15:14:17 -04:00
Brian Terry b87d2c392d Add testing 2020-04-21 15:14:10 -04:00
Brian Terry 6bcef23d1a Update Priority to int64 2020-04-21 10:40:21 -04:00
Brian Terry c9162036fb Add OpsCenter Sink 2020-04-21 10:29:11 -04:00
Brian Terry e5f113b386 Add OpsCenter Sink 2020-04-21 10:29:02 -04:00
Ameya Joshi 122836c1d0 go fmt 2020-04-20 16:20:00 +05:30
Ameya Joshi 6108bad882 Adding Annotations in Rules 2020-04-20 16:13:52 +05:30
youyongsong 5dca26ee8c feature: support leader election
leader election function is disabled by default, and could be enabled by adding the
following section in `config.yaml`:

```yaml
leaderElection:
  enabled: true
  leaderElectionID: kubernetes-event-exporter  // this field can be omited, default value is kubernetes-event-exporter
```
2020-04-14 19:35:23 +08:00
Martin Heck 5039d04629 Update README to match elasticsearch TLS settings
#31 introduced advanced configuration options regarding the TLS settings
of the elasticsearch connection. The configuration example in README now
reflects those.
2020-04-13 15:42:49 +02:00
Mustafa AkınandGitHub fbcefefc80 Merge pull request #31 from mheck136/elasticsearch-tls-config
Add support for TLS configuration of elasticsearch sink
2020-04-11 12:11:32 +03:00