Socket Slack for Botkube Cloud
Prerequisites​
- Botkube Cloud account which you can create here for free.
Install Socket Slack App in Your Slack workspace​
Botkube uses interactive messaging to provide better experience. Interactive messaging needs a Slack App with Socket Mode enabled and currently this is not suitable for Slack App Directory listing. For this reason, you need to create a Slack App in your own Slack workspace and use it for Botkube deployment.
Multi-cluster caveat: The architecture of socket-based Slack apps has a limitation on the routing of executor commands. If you would like to use Botkube executors (e.g. kubectl commands) and have multiple Kubernetes clusters, you need to create and install a Botkube Slack app for each cluster. This is required so that the Slack to Botkube connections go to the right place. We recommend you set the name of each app to reflect the cluster it will connect to in the next steps.
To learn more about the Slack Socket API limitation, see the comment in the official Slack bot framework repository.
The Botkube Cloud Slack App does not have this limitation.
Follow the steps below to create and install Botkube Slack app to your Slack workspace.
Create Slack app​
Go to Slack App console to create an application.
Click Create New App and select From an app manifest in the popup to create application from manifest.
Select a workspace where you want to create application and click Next.
Select YAML tab, copy & paste one of the following manifests, and click Next, and then Create.
- Public channels only
- Private channels only
- Public and private channels
display_information:
name: Botkube
description: Botkube
background_color: "#a653a6"
features:
bot_user:
display_name: Botkube
always_online: false
oauth_config:
scopes:
bot:
- channels:read
- app_mentions:read
- reactions:write
- chat:write
- files:write
- users:read # Remote configuration only: Used to get Real Name for audit reporting
settings:
event_subscriptions:
bot_events:
- app_mention
interactivity:
is_enabled: true
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false
display_information:
name: Botkube
description: Botkube
background_color: "#a653a6"
features:
bot_user:
display_name: Botkube
always_online: false
oauth_config:
scopes:
bot:
- groups:read
- app_mentions:read
- reactions:write
- chat:write
- files:write
- users:read # Remote configuration only: Used to get Real Name for audit reporting
settings:
event_subscriptions:
bot_events:
- app_mention
interactivity:
is_enabled: true
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false
display_information:
name: Botkube
description: Botkube
background_color: "#a653a6"
features:
bot_user:
display_name: Botkube
always_online: false
oauth_config:
scopes:
bot:
- channels:read
- groups:read
- app_mentions:read
- reactions:write
- chat:write
- files:write
- users:read # Remote configuration only: Used to get Real Name for audit reporting
settings:
event_subscriptions:
bot_events:
- app_mention
interactivity:
is_enabled: true
org_deploy_enabled: false
socket_mode_enabled: true
token_rotation_enabled: false
Install Botkube to the Slack workspace​
Once the application is created, you will be redirected to application details page. Press the Install your app button, select the workspace and click Allow to finish installation.
Obtain Bot Token​
Select OAuth & Permissions section on the left sidebar. On this page you can copy the bot token which starts with
xoxb...
.Note down the
Bot User OAuth Token
. You will use the value when creating a Botkube Cloud instance.
Generate and obtain App-Level Token​
Slack App with Socket Mode requires an App-Level Token for the websocket connection.
Follow the steps to generate an App-Level Token:
Select Basic Information link from the left sidebar and scroll down to section App-Level Token. Click on the Generate Token and Scopes button.
Enter a Name, select
connections:write
scope, and click Generate.Note down the
Token
. You will use the value when creating a Botkube Cloud instance.
Create a Botkube Cloud Instance​
Go to Botkube Cloud Web App and click on
New Instance
button.Fill in the
Instance Display Name
and clickNext
button.Click
Add platform
dropdown, and selectSlack
option.In the popup, select
Custom Slack app
option and clickSelect
button.Provide the Slack app details as described follows and click
Next
button.- Display Name: This is the name of the Slack app which will be displayed in your platform list.
- App Token: Use the app token noted down in one of the previous steps.
- Bot Token: Use the bot user token noted down in one of the previous steps.
- Channel Name: Provide Slack channel name(s) where you can execute Botkube commands and receive notifications. This will be configured in the next step.
Add plugins you want to enable in your Botkube instance and click
Next
button.Include optional
default aliases
anddefault actions
and clickCreate
button to create Botkube Cloud instance.Follow the instructions on the summary page to deploy Botkube into your environment.
Clean up​
Go to Botkube Cloud instances page and click
Manage
button of the instance you want to remove.Click
Delete instance
button, type the instance name in the popup and clickDelete instance
.cautionRemember to execute the displayed command to completely remove Botkube and related resources from your cluster.