Commit Graph

35 Commits

Author SHA1 Message Date
Prasad Ghangal
bcd48cd8ca
Fix notification timestsamp in Discord (#442)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY

Use correct timestamp in Discord event notification 

Fixes #441 

##### Test plan

![image](https://user-images.githubusercontent.com/7098659/103475090-43be1880-4dd0-11eb-9a5c-2406d2d4f954.png)
2021-01-03 09:44:18 +00:00
Kartik Moolya
5ad31edb4b
[ES] indices to be created with daywise timestamp (#430)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Elasticsearch Indices will be created with timestamp suffix
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->

<!--- Please list dependencies added with your change also -->
2020-11-09 13:21:36 +00:00
Aananth K
ad9a738cdd
Add Discord support (#268)
#### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->

**Add support for Discord:**

This PR,
- adds discord bot
- adds discord notifier
- adds required discord configurations into comm_config.yaml
- adds discordgo module into go.mod
- adds discord configs into all yaml files

<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->

<!--- Please list dependencies added with your change also -->

Fixes #97 


### Steps For Creation and Integration:

1. Reach https://discordapp.com/developers/applications 

2. Create New Application named Botkube and add a bot named **Botkube** into the Application

3. Copy the Application **CLIENT ID** and place it under _Dischord.botid_ in comm-config.yaml

4. Copy Bot **TOKEN** and place it under _Dischord.token_ in comm-config.yaml
 
5. Generate the URL with suitable permissions using the OAuth2 URL Generator available under OAuth2 section to the add bot to your Discord server
```
https://discordapp.com/oauth2/authorize?&client_id=<YOUR_CLIENT_ID>&scope=bot&permissions=<SET_OF_PERMISSIONS>
```
6. Paste the generated URL in a new tab, select the discord sever to which you want to add the bot and Authorise Bot addition.
7. Create a new channel and/or copy the  **CHANNEL ID** of an existing one that you want to use and place it under _Dischord.channel_

```yaml
  # Settings for Discord
  discord:
    enabled: true
    token: 'DISCORD_TOKEN'	    # BotKube Bot Token 
    botid: 'DISCORD_BOT_ID'         # BotKube Application Client ID 
    channel: 'DISCORD_CHANNEL_ID'   # Discord Channel id for receiving BotKube alerts 
    notiftype: short                # Change notification type short/long you want to receive. notiftype is optional and Default notification type is short (if not specified)
```

####  Note: Follow the first 4 mins of this [Video Tutorial](https://youtu.be/8o25pRbXdFw) to understand the process visually.

### Preview:

![ping](https://user-images.githubusercontent.com/30741615/80600577-3931cf00-8a4a-11ea-9215-a725a0b17256.png)
![pod-create-short](https://user-images.githubusercontent.com/30741615/80600638-55357080-8a4a-11ea-976f-b91e823c93bd.png)
![pod-error-long](https://user-images.githubusercontent.com/30741615/80600803-8dd54a00-8a4a-11ea-90e4-a205e93aba5f.png)
![file-attachment](https://user-images.githubusercontent.com/30741615/80600724-75fdc600-8a4a-11ea-9b10-1b5ac0e79548.png)
2020-10-06 04:37:49 +00:00
Aananth K
b087f94804
Bug Fix e2e tests (#389)
This Commit, 
- Fixes build failure due to e2e tests

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->

<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->

<!--- Please list dependencies added with your change also -->

Fixes #384
2020-10-05 04:11:09 +00:00
Prasad Ghangal
c6db9526a3
Add MS Teams support (#242)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request


##### SUMMARY

- Add support for Microsoft Teams
- Multicluster support not available yet for Teams

Integration tests will be addressed with a separate issue. Blocked by https://github.com/infracloudio/msbotbuilder-go/issues/46

Fixes #60
2020-08-11 06:12:09 +00:00
Prasad Ghangal
b887214b6c
Refactor notifier to use Bot interface to send notifications (#309)
##### ISSUE TYPE

 - Feature Pull Request

##### SUMMARY

In the notifier, we send events by creating a new connection to the communication medium on every new event. We can reduce the number of connections by sending messages via the Bot interface.

Fixes #270
2020-07-13 12:06:27 +00:00
Kartik Moolya
4f1d87239e
allow using AWS role or EC2 Instance role for Elasticsearch Auth (#306)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
Allow using AWS role or EC2 Instance role to generate session tokens for AWS credentials.
<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->

<!--- Please list dependencies added with your change also -->
2020-07-02 17:01:01 +00:00
kartik-moolya
57491857fc
adding feature to support AWS Signing and creating new index per day (#302)
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->

Allows user to specify if Elasticsearch is hosted on AWS
- configuration fields have been added to specify if Elasticsearch is hosted on AWS

<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->
Includes feature which would allow botkube to send Kubernetes events to Elasticsearch hosted on AWS
* Uses AWS V4 signature to sign the http request
* Uses environment variables to pick AWS configurations

Secondly creates new index per day with index name suffixed as -DD-MM-YYYY
<!--- Please list dependencies added with your change also -->

Fixes #299 
Fixes #283
2020-07-01 12:27:38 +00:00
Harshit mahjan
fc0e324055
Refactor logging package (#262) (#285)
##### ISSUE TYPE

 - Refactor Pull Request  (#262)


##### SUMMARY
Refactor logging package to make log statements simpler. Current format logging.Logger.Info() doesn't look good. We can embed Logrus into pkg/log to import and use it as log.Info()


Fixes #
- Embed Logrus into pkg/log 
- Update the reference to new log package
- Change the reference everywhere form 
    `logging.Logger.Function() --> log.Function()`
2020-06-16 04:43:56 +00:00
Prasad Ghangal
8dce65a7ad
Refactor notifier and bot to pass config
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Pull Request


##### SUMMARY

Refactor notifier and bot to pass config
Simplify ElasticSearch client creation
2020-05-01 13:47:37 +00:00
Prasad Ghangal
ecde3184e3
Add license headers to source files (#266)
Update copyright years t0 2019-2020 in license

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2020-04-27 09:20:16 +05:30
Aananth K
b016f060a1
Fix Node getting ready is reported as an error (#261)
This Commit,
- changes the event type created during NodeReady as InfoEvent.
- adds corresponding InfoEvent case in the notify package.
2020-04-22 16:22:43 +05:30
Prasad Ghangal
34a209e7a3
Add colors to Mattermost notification attachments (#223)
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2019-11-25 13:56:47 +05:30
Prasad Ghangal
46b12e484c Move message formatting function to notif package
Fix previews in Slack & Mattermost notifications

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2019-11-23 17:33:35 +05:30
Prasad Ghangal
4872cfaeb1
Make notification messages more readable (#175)
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2019-09-09 12:31:50 +05:30
Aananth K
9800db7fe6 Add support for Webhooks
This commit,
- Adds support for event notifications through `Wehbook` 
- updates configs in all yaml files
- updated helm charts
- adds unit tests for webhook notifier
- adds integration test webhook notifier
- adds test/webhook package to enable integration testing.
2019-09-02 13:18:51 +05:30
Prasad Ghangal
7cc76cfbf2 Refactor Bot implementations to work with mocked Slack
Add CommandRunner interface and fake_executor to mock kubectl command execution
Add warnings field to the Event struct
Update filter recommendation message format

Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2019-08-26 17:35:47 +05:30
Prasad Ghangal
ab813afe59 Refactor Slack notifier to use latest nlopes/slack
Signed-off-by: Prasad Ghangal <prasad.ghangal@gmail.com>
2019-08-26 17:35:47 +05:30
coder
a0e49d5bc2 Add Cluster name in event sent to ElasticSearch (#164)
This Commit,
- Fixes cluster filed not being populated in ES.
- adds  `ClusterName` to `ElasticSearch` type.
2019-08-24 22:34:16 +05:30
coder
72f2f19842 [feature] Add Object Annotation filter, Fixes #132, #133 (#138)
* Add Object Annotation filter

This commit, 
- enables filtering of events based on annotations present in objects at run time.
- annotation `botkube.io/disable: true` disables event notifications for the annotated object
- annotation `botkube.io/channel: <channel_name>` sends events notifications of the annotated object to the mentioned channel.
- adds func `ExtractAnnotations()`. It extract annotations from Event.InvolvedObject and adds them to event.Metadata.Annotations
- implements individual actions using internal functions.
- adds unit tests for internal functions.
- replaces Init() with InitialiseKubeClient() to decouple config.yaml and KubeClinet dependencies from unit testing

* Add build completion message
2019-08-12 22:38:50 +05:30
coder
be5fade9a1 Enhance Notification : short/long notification type (#127)
This commit,
- enables sending short/long event notifications to channels
- adds a optional filed "notiftype" under channel config to change between short (default) and long notif types
- adds Message() method to event object for creating brief messages (to use across handlers)
- BugFix: enable/disable recommendations through config file
2019-07-26 11:59:15 +05:30
mugdha-adhav
77e7ca4103 Mattermost implementation changes for botkube channel.
Removed CreateChannel support from Mattermost.
Formatted postMessage output.
Updated README for adding channel in Mattermost.
Removed Fatal log calls in Controller
Modified log messages to print additional error information
Added comments for Mattermost config parameters.
2019-04-04 16:31:53 +05:30
mugdha-adhav
84ccf1288d Added support for Mattermost 2019-04-04 16:31:53 +05:30
Prasad Ghangal
3f7a88e772 Add new env var LOG_LEVEL to set logging levels 2019-04-04 16:31:53 +05:30
Prasad Ghangal
083fd3c5cf Add support for elasticsearch interface 2019-04-04 16:31:53 +05:30
Prasad Ghangal
46d6f9b825 Add support for multiple clusters 2019-01-15 14:14:16 +05:30
Prasad Ghangal
f6a389ab64 Rename kubeops to botkube 2019-01-03 17:37:20 +05:30
Prasad Ghangal
5a4430ee79 Fixes #2: Send bot start/stop messages to slack channel
- Fix timestamps in delete notifications
2019-01-02 14:12:57 +05:30
Prasad Ghangal
9126c83431 Add timestamp to slack notifications 2018-12-31 16:22:27 +05:30
Prasad Ghangal
c3bfc46dde Run golint on source code 2018-12-31 11:11:48 +05:30
Prasad Ghangal
62e05383b4 Add ping command, support for nodes, pvcs resources 2018-12-28 15:11:24 +05:30
Prasad Ghangal
51a2ead830 Support 2-way communication with slack bot to exec kubectl commands 2018-12-27 14:12:52 +05:30
Prasad Ghangal
ec1c5f76d9 Fix event maps and build script 2018-12-26 16:18:55 +05:30
Prasad Ghangal
7b930f46ed Send slack notification for event 2018-12-26 13:11:28 +05:30
Prasad Ghangal
5f61821baa Add controller, filterengine and notifier for kubeops 2018-12-24 15:06:31 +05:30