T4K Integration with Slack using BotKube
This section provides step by step instructions to install and configure BotKube to monitor T4K resources from Slack along with other native Kubernetes resources.
Introduction
In today's world, it's imperative to be able to receive notifications for your Kubernetes environments into communication and notification tools of choice. Slack is a new-age communication tool leveraged by a lot of different teams and organizations today. In order to keep a consistent user experience across ecosystem tools leveraged by T4K users, notifications can be supported within Slack for T4K resources through BotKube.
This page guides you with detailed instructions to install BotKube on a Kubernetes cluster, configure it to integrate with Slack, and monitor T4K resources to provide notifications around T4K activity within Slack channels directly.
What is BotKube
BotKube is a messaging bot for monitoring and debugging Kubernetes clusters. It can be integrated with multiple messaging platforms like - Slack, Mattermost, Microsoft Teams, Discord to help you monitor T4K resources and other Kubernetes resources.
Install and configure BotKube with Slack
Install BotKube App to Slack workspace
Search for the BotKube application in the Apps section on Slack, install the application using the Add to Slack button provided.
After you authorize the application, you will get a BOT Access token. Note down this token as it will be required during deployment of BotKube backend on Kubernetes cluster.
Add BotKube App as a user to Slack Channel
Once the BotKube application is installed to the Slack workspace, you can see BotKube user (@Botkube) present. Add this Botkube user to your slack channel from where you want to monitor the T4K resources.
Install BotKube backend in Kubernetes Cluster
Add infracloudio chart repository to the Kubernetes cluster
2. Install BotKube backend with required input parameters to configure Slack communication
3. Verify that the botkube controller pod is in running
state
After the above installation with default configuration, BotKube will watch all the resources in all the namespaces for create, delete and error events for configured Kubernetes cluster.
Configure T4K Resource Monitoring
Along with default configurations, we will update the botkube-configmap with T4K custom resources for monitoring
2. Add T4K custom resources to the BotKube configmap
The above configuration is for the Cluster scoped installation of T4K. We have specified to include all namespaces for notifications using the following syntax namespaces: -> include: -> -all
In the case of namespace scoped installation of T4K, you can include only the specific namespace where T4K is installed.
3. This update will start populating any operations done on the T4K resources.
Configure T4K Resource Commands to execute from Slack
You can expand the list of commands that can be executed from slack directly onto the Kubernetes resources and T4K resources.
2. Add the commands that can be executed on the T4K resources along with the verbs under settings.kubectl.commands.resources
and settings.kubectl.commands.verbs
section
3. Once the Botkube configmap is updated, you can see the updated commands list from slack
Usage of commands and verbs
You can execute above commands directly from slack to monitor the T4K resources
Remove BotKube from Kubernetes cluster
We installed BotKube using helm, execute the following command to completely remove BotKube and related resources.
For integrations with other tools such as Mattermost, Microsoft Teams, Discord, Elastic Search configurations, users can follow BotKube documentations.
Last updated