Slack
The Slack notification service uses either Slack Webhooks or the Bot API to send messages.
| Field | Description | Scheme |
|---|---|---|
channel* | The channel to send messages to, in | |
token* | Your Slack app's API bot token. | |
botName | Bot name | |
color | Message left-hand border color |
|
icon | emoji or URL | |
threadTS | ts value of the parent message (to send message as reply in thread) | |
title | Prepended text above the message |
Create a Slack bot
-
Create a new app
Visit https://api.slack.com/apps and create a new app. Use the "From an app manifest" option.

-
Set up OAuth permission
After creating the app, you should be navigated to the app's homepage. On the left panel menu, go to Features->OAuth & Permissions. Scroll down and you should see the "Scopes" section

Set
chat:writepermission -
Install the Slack app
While still on the same page, scroll up to the "OAuth Tokens for Your Workspace" section. Install the newly created app on your Slack workspace.

Once you install the app you should see the OAuth token

-
Create kubernetes secret
You will need to create a new kubernetes secret using the OAuth token created above
slack-secret.yaml---
apiVersion: v1
kind: Secret
metadata:
name: slack-credentials
namespace: default
stringData:
BOT_TOKEN: xoxb-910094966996-6596865117477-n7iujSYWmHtnTLMmITdm8z06 -
Create Connection
Create a new Slack connection using that kubernetes secret.
slack-connection.yamlapiVersion: mission-control.flanksource.com/v1
kind: Connection
metadata:
name: slack
namespace: default
spec:
slack:
token:
valueFrom:
secretKeyRef:
name: slack-credentials
key: BOT_TOKEN
channel: C0123456789
botName: Mission Control
icon: ":robot_face:" -
Create the notification CRD
notification.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: http-check-alerts
namespace: default
spec:
events:
- check.failed
to:
# use the slack connection as the recipient for this notification
connection: connection://default/slack
filter: check.type == 'http' -
Apply the notification
kubectl apply -f notification.yaml`