-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added documentation to enable Slack notification post deploymen…
- Loading branch information
Showing
2 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
docs/content/en/docs/tasks/implement-slack-notification/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: Implement Slack Notification | ||
description: Learn how to implement Slack notification as a post deployment task. | ||
icon: concepts | ||
layout: quickstart | ||
weight: 24 | ||
hidechildren: true # this flag hides all sub-pages in the sidebar-multicard.html | ||
--- | ||
|
||
# Overview | ||
This section describes how to **prepare and enable** post-deployment tasks to send notifications to slack using webhooks. | ||
|
||
## Create Slack Webhook | ||
|
||
At first, create an incoming slack webhook. Necessary information is available in the [slack api page](https://api.slack.com/messaging/webhooks). | ||
Once you create the webhook, you will get a URL similar to below example. | ||
|
||
`https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX` | ||
|
||
`T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX` is the secret part of the webhook which we would need in the next step. | ||
|
||
## Create slack-secret | ||
|
||
Create a `slack-secret.yaml` definition using the following command. | ||
This will create a kubernetes secret named `slack-secret.yaml` in the `examples/sample-app/base` directory. Before running | ||
this command change your current directory into `examples/sample-app`. | ||
|
||
```bash | ||
kubectl create secret generic slack-secret --from-literal=SECURE_DATA='{"slack_hook":<YOUR_HOOK_SECRET>,"text":"Deployed PodTatoHead Application"}' -n podtato-kubectl -oyaml --dry-run=client > base/slack-secret.yaml | ||
``` | ||
## Enable post deployment task | ||
|
||
To enable Slack notification add `post-deployment-notification` in as a postDeploymentTasks in the | ||
[examples/sample-app/base/app.yaml](https://github.com/keptn/lifecycle-toolkit/blob/main/examples/sample-app/base/app.yaml) file as shown below. | ||
|
||
```yaml | ||
postDeploymentTasks: | ||
- post-deployment-notification | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters