This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from TannerGilbert/patch/added-slack-service
Added slack service
- Loading branch information
Showing
22 changed files
with
166 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,106 @@ | ||
# Keptn Notification service | ||
|
||
This is a Keptn service that listens to Keptn Cloud Events and sends a notification about the event to a chat app. (currently Slack but extendable) | ||
|
||
--- | ||
|
||
# notification-service | ||
|
||
This implements a notification-service for Keptn. If you want to learn more about Keptn visit us on [keptn.sh](https://keptn.sh) | ||
|
||
## Installation | ||
|
||
### Deploy in your Kubernetes cluster | ||
|
||
To deploy the current version of the *notification-service* in your Keptn Kubernetes cluster, apply the [`deploy/service.yaml`](https://github.com/keptn-sandbox/slack-service/blob/main/deploy/service.yaml) file: | ||
|
||
```console | ||
kubectl apply -f deploy/service.yaml | ||
``` | ||
This should install the `notification-service` together with a Keptn `distributor` into the `keptn` namespace, which you can verify using: | ||
|
||
```console | ||
kubectl -n keptn get deployment notification-service -o wide | ||
kubectl -n keptn get pods -l run=notification-service | ||
``` | ||
|
||
### Uninstall | ||
|
||
To delete a deployed *notification-service*, use the file `deploy/*.yaml` files from this repository and delete the Kubernetes resources: | ||
|
||
```console | ||
kubectl delete -f deploy/service.yaml | ||
``` | ||
|
||
## Usage | ||
|
||
The goal of the *notification-service* is to inform the user about a new event via a notification in a chat app. (currently Slack but extendable) | ||
|
||
It needs the following configuration: | ||
|
||
### Kubernetes secrets | ||
|
||
* for Slack Environment | ||
|
||
The Kubernetes secret `slack-access` containing the values `SLACK_TOKEN` and `SLACK_CHANNEL` is needed. | ||
|
||
* for Keptn Environment | ||
|
||
The Kubernetes secret `keptn-access` containing the value `KEPTN_BRIDGE_DOMAIN` is needed. | ||
|
||
These variables can be set in the `service.yaml` file, but their name must not be changed! | ||
|
||
```yaml | ||
- name: SLACK_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
key: SLACK_TOKEN | ||
name: slack-access | ||
- name: SLACK_CHANNEL | ||
valueFrom: | ||
secretKeyRef: | ||
key: SLACK_CHANNEL | ||
name: slack-access | ||
- name: KEPTN_BRIDGE_DOMAIN | ||
valueFrom: | ||
secretKeyRef: | ||
key: KEPTN_BRIDGE_DOMAIN | ||
name: keptn-access | ||
``` | ||
|
||
### Slack app installation | ||
|
||
To use the *notification-service* with Slack a Slack Application has to be created. The app needs write permissions | ||
in chats. To add this permission, click `OAuth & Permissions` in the *Features* menu on the left and scroll down to `Scopes`. | ||
Add `chat:write` to the *Bot Token Scopes*. | ||
|
||
The next step is to install the Slack app to you Slack workspace. This can be done by navigating to `Basic Information` | ||
in the *Settings* menu on the left. To install the app click `Install to Workspace` and allow the requested | ||
permissions. | ||
|
||
To use interactive messages, navigate to `Interactivity & Shortcuts` in the *Features* menu on the left. | ||
Turn `Interactivity` on and add `http://<ip-address>:<port>/quarkus/sendEvent` to the `Request Url` of | ||
*Interactivity*. `<ip-address>` and `<port>` have to be the ip and port used to reach the service deployed in your | ||
Kubernetes cluster. | ||
|
||
## Development | ||
|
||
This is an open source project, so I welcome any contributions to make it even better! | ||
|
||
### Build yourself | ||
|
||
* Build the binary: `./mvnw package -Pnative` (with GraalVM) `./mvnw package -Pnative -Dquarkus.native.container-build=true` (without GraalVM) | ||
* Build not a binary: `./mvnw package` | ||
* Run tests: `` | ||
* Build the docker image: `docker build -f src/main/docker/Dockerfile.native -t <your_docker_user>/notification-service .` | ||
* Run the docker image locally: `docker run -i --rm -p 8080:8080 <your_docker_user>/notification-service` | ||
* Push the docker image to DockerHub: `docker push <your_docker_user>/notification-service` | ||
* Deploy the service using `kubectl`: `kubectl apply -f deploy/` | ||
* Delete/undeploy the service using `kubectl`: `kubectl delete -f deploy/` | ||
* Watch the deployment using `kubectl`: `kubectl -n keptn get deployment notification-service -o wide` | ||
* Get logs using `kubectl`: `kubectl -n keptn logs deployment/notification-service -c notification-service -f` | ||
* Watch the deployed pods using `kubectl`: `kubectl -n keptn get pods -l run=notification-service` | ||
|
||
## License | ||
|
||
Please find more information in the [LICENSE](https://github.com/keptn-sandbox/slack-service/blob/main/LICENSE) file. |
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,26 @@ | ||
# Artifact Hub package metadata file | ||
# https://github.com/artifacthub/hub/blob/master/docs/metadata/artifacthub-pkg.yml | ||
version: 0.2.0 | ||
name: slack-service | ||
displayName: Slack Service | ||
createdAt: 2020-08-26T00:00:00Z | ||
description: Keptn service that listens to Keptn Cloud Events and sends a notification about the event to a chat app. | ||
logoURL: https://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Slack_Technologies_Logo.svg/2560px-Slack_Technologies_Logo.svg.png | ||
digest: 2021-10-12T00:00:00Z | ||
license: Apache-2.0 | ||
homeURL: https://keptn.sh/docs/integrations/ | ||
deprecated: true | ||
keywords: | ||
- keptn | ||
- slack | ||
- sandbox | ||
- notification | ||
links: | ||
- name: Source | ||
url: https://github.com/keptn-sandbox/slack-service | ||
recommendations: | ||
- url: https://artifacthub.io/packages/helm/keptn/keptn | ||
annotations: | ||
keptn/kind: "notification" | ||
keptn/org: "sandbox" | ||
keptn/version: "0.9.x" |
Oops, something went wrong.