vmware-archive/kubewatch

Add support for discord webhook

GuillaumeOuint opened this issue · 9 comments

And it will be cool if we can modify the slack webhook URL in order to support discord slack webhook endpoint or add a new service hook called discord.

Also Kubewatch doesn't work with Kubernetes 1.16 api (searching for v1beta1 ressources instead of v1)

Even with the r161, doesn't work.

mkmik commented

1.16 api has been merged (see #200) but not yet released.

1.16 api has been merged (see #200) but not yet released.

That's why, I was bamboozled by the fact that the CI Robot has uploaded the r161 after the merge.
Did Discord webhook is planned ?
Thanks for the reply ;)

mkmik commented

Is as simple as just overriding the API endpoint url? (And otherwise uses the samrlnslack API?

Is as simple as just overriding the API endpoint url? (And otherwise uses the samrlnslack API?

Discord is compatible with slack webhook "protocol" (with the /slack at the end of the discord webhook url) so yes it's as simple that is. But if you want full compatibility (and rich messages), I think it's better to fully implement it with discord specs (post form, etc...)

mkmik commented

hmm; turns out kubewatch is not using the new slack webhook API, but instead the old legacy client API, so it's not just a matter of exposing the base URL; we'd first have to implement the new slack "app" handler (and preserve backward compat with existing users), which is a good idea anyway.

Is there any strong reason to add a native discord handler instead of just using the '/slack' webhook?

hmm; turns out kubewatch is not using the new slack webhook API, but instead the old legacy client API, so it's not just a matter of exposing the base URL; we'd first have to implement the new slack "app" handler (and preserve backward compat with existing users), which is a good idea anyway.

Is there any strong reason to add a native discord handler instead of just using the '/slack' webhook?

I forgot that with slack, it's more a bot than a notifications publisher (my bad sorry)
For discord, it's simple, we can have the same function as for slack (a bot) with the API client. But for webhooks, using the endpoint /slack does not do the same thing as without this endpoint (https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook)
And for now, using the discord webhook with /slack at the end in the kubewatch's "webhook" config doesn't work (Error on post even if I can't really test it because my cluster is 1.16 but I still have this error in logs without 1.16 k8s's api resources supported).
I'd like to have minimum notifications on my discord channel as I already have some tools to alert me when something happen on my cluster. Having k8s events will be a great thing without having to switch all existings alert to slack (and it's simpler to have only one chat app for customers and technicians than two)
Sorry for my bad english (if it is) I'm french.

mkmik commented

soon I'm going to completely redesign the "handler" API; it's unnecessarily complicated and there is tons of code duplication; once that's done it will be easy to add other notification handlers.

soon I'm going to completely redesign the "handler" API; it's unnecessarily complicated and there is tons of code duplication; once that's done it will be easy to add other notification handlers.

Nice! Good luck for that. I stay on the lookout for the next updates.
And thanks you for considering my demand ;)