Notifying Kubernetes events to Slack using Kubewatch

In this post i’ll show how to notify kubernetes events to our slack channel using bitnami-labs/kubewatch.

kubewatch repo can be accessed using this link.
We need to create slackbot.I created new bot named kubewatch-webischia.

Then i copied this token.
After that we need to install kubewatch. Kubewatch can be installed with helm or using yaml files. Im using yaml files in this example.

kubewatch-configmap.yaml
In handler scope we define our slack configuration such as bot token and resource scope we define which events we should notify on kubernetes.

kubewatch-service-account.yaml
Using rbac give permission to kubewatch for listing events.

kubewatch.yaml
Thats our pod yaml. Defining image from bitnami/tuna.
We shouldnt forget serviceAccountName: kubewatch on spec scope.

Testing our kubewatch. I created new service and kubewatch notify us on our slack channel.
Creating pod

Deleting pod

This entry was posted in Kubernetes and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *