Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from TannerGilbert/patch/added-slack-service
Browse files Browse the repository at this point in the history
Added slack service
  • Loading branch information
TannerGilbert committed Oct 12, 2021
2 parents d9b22ae + c59d976 commit 0857b00
Show file tree
Hide file tree
Showing 22 changed files with 166 additions and 25 deletions.
2 changes: 1 addition & 1 deletion argo/0.8.4/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Argo Service
createdAt: 2021-06-21T00:00:00Z
description: Keptn service for Argo CD - Declarative GitOps CD for Kubernetes.
logoURL: https://raw.githubusercontent.com/cncf/artwork/master/projects/argo/stacked/color/argo-stacked-color.svg
digest: 2021-10-08T00:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down
3 changes: 2 additions & 1 deletion artillery/0.3.1/artifacthub-pkg.yml
Expand Up @@ -6,13 +6,14 @@ displayName: Artillery Service
createdAt: 2021-07-06T00:00:00Z
description: Keptn service for artillery.io load testing tool.
logoURL: https://artillery.io/images/artillery-logo-square.png
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
- keptn
- artillery
- load-testing
- testing
- sandbox
links:
- name: Source
Expand Down
3 changes: 2 additions & 1 deletion dynatrace/0.16.0/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Dynatrace Service
createdAt: 2021-08-09T00:00:00Z
description: Keptn service that forwards Keptn events - occurring during a delivery workflow - to Dynatrace.
logoURL: https://avatars.githubusercontent.com/u/6412311
digest: 2021-10-08T00:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down Expand Up @@ -185,4 +185,5 @@ recommendations:
- url: https://artifacthub.io/packages/helm/keptn/keptn
annotations:
keptn/kind: "sli-provider"
keptn/org: "contrib"
keptn/version: "0.8.4-0.8.7"
4 changes: 2 additions & 2 deletions dynatrace/0.17.0/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Dynatrace Service
createdAt: 2021-09-27T00:00:00Z
description: Keptn service that forwards Keptn events - occurring during a delivery workflow - to Dynatrace.
logoURL: https://avatars.githubusercontent.com/u/6412311
digest: 2021-10-08T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down Expand Up @@ -187,4 +187,4 @@ recommendations:
annotations:
keptn/kind: "sli-provider"
keptn/org: "contrib"
keptn/version: "0.8.4-0.9.2"
keptn/version: "0.8.4-0.9.2"
3 changes: 2 additions & 1 deletion grafana/0.1.0/artifacthub-pkg.yml
Expand Up @@ -6,14 +6,15 @@ displayName: Grafana Service
createdAt: 2021-08-21T21:00:00Z
description: Service that automates the generation of dashboards based on the SRE files of Keptn.
logoURL: https://grafana.com/static/img/about/grafana_logo_swirl_fullcolor.jpg
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
deprecated: true
keywords:
- keptn
- grafana
- sandbox
- dashboard
links:
- name: Source
url: https://github.com/keptn-sandbox/grafana-service
Expand Down
2 changes: 1 addition & 1 deletion jira/0.8.5/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Jira Service
createdAt: 2021-07-02T00:00:00Z
description: Keptn service for creating JIRA tickets upon problems and quality gate evaluations.
logoURL: https://cdn.icon-icons.com/icons2/2699/PNG/512/atlassian_jira_logo_icon_170511.png
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down
4 changes: 3 additions & 1 deletion job-executor/0.1.3/artifacthub-pkg.yml
Expand Up @@ -6,12 +6,13 @@ displayName: Job Executor Service
createdAt: 2021-07-16T00:00:00Z
description: Keptn service to run any container as a Kubernetes Job orchestrated by keptn.
logoURL: https://raw.githubusercontent.com/cncf/artwork/master/projects/keptn/stacked/color/keptn-stacked-color.svg
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
- keptn
- kubernetes
- sandbox
links:
- name: Source
url: https://github.com/keptn-sandbox/job-executor-service
Expand Down Expand Up @@ -55,4 +56,5 @@ install: |
recommendations:
- url: https://artifacthub.io/packages/helm/keptn/keptn
annotations:
keptn/org: "sandbox"
keptn/version: "0.8.6-0.8.7"
2 changes: 1 addition & 1 deletion job-executor/0.1.4/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Job Executor Service
createdAt: 2021-09-14T00:00:00Z
description: Keptn service to run any container as a Kubernetes Job orchestrated by keptn.
logoURL: https://raw.githubusercontent.com/cncf/artwork/master/projects/keptn/stacked/color/keptn-stacked-color.svg
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down
2 changes: 1 addition & 1 deletion litmus/0.2.1/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Litmus Service
createdAt: 2021-07-06T00:00:00Z
description: Keptn service to perform chaos tests on your applications triggered by Keptn using the LitmusChaos framework.
logoURL: https://raw.githubusercontent.com/cncf/artwork/master/projects/litmus/stacked/color/litmus-stacked-color.svg
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down
2 changes: 1 addition & 1 deletion locust/0.1.5/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Locust Service
createdAt: 2021-08-04T00:00:00Z
description: Keptn service to perform performance test on your application triggered by Keptn using the Locust performance testing tool.
logoURL: https://pbs.twimg.com/profile_images/1867636195/locust-logo-orignal_400x400.png
digest: 2021-10-05T16:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down
3 changes: 2 additions & 1 deletion monaco/0.8.4/artifacthub-pkg.yml
Expand Up @@ -5,11 +5,12 @@ name: monaco-service
displayName: Monaco service
createdAt: 2021-06-21T00:00:00Z
description: Keptn Services that enables calling the Dynatrace Monaco (Monitoring as Code) toolset for individual Keptn Events.
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
- keptn
- monitoring
links:
- name: Source
url: https://github.com/keptn-sandbox/monaco-service
Expand Down
3 changes: 2 additions & 1 deletion monaco/0.9.1/artifacthub-pkg.yml
Expand Up @@ -5,12 +5,13 @@ name: monaco-service
displayName: Monaco service
createdAt: 2021-09-28T00:00:00Z
description: Keptn Services that enables calling the Dynatrace Monaco (Monitoring as Code) toolset for individual Keptn Events.
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
- keptn
- sandbox
- monitoring
links:
- name: Source
url: https://github.com/keptn-sandbox/monaco-service
Expand Down
3 changes: 2 additions & 1 deletion neoload/0.8.0/artifacthub-pkg.yml
Expand Up @@ -6,13 +6,14 @@ displayName: NeoLoad Service
createdAt: 2021-07-16T00:00:00Z
description: Keptn service for the NeoLoad load testing tool.
logoURL: https://www.neotys.com/wp-content/uploads/2020/02/Logo_NeoLoad_2017_LegacyColor.png
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
prerelease: true
keywords:
- keptn
- neoload
- testing
- load testing
- contrib
links:
Expand Down
2 changes: 1 addition & 1 deletion notification/0.3.1/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Notification Service
createdAt: 2020-10-15T00:00:00Z
description: Keptn service responsible for sending specific events as a notification to MS Teams, Slack and Webex Teams
logoURL: https://raw.githubusercontent.com/cncf/artwork/master/projects/keptn/stacked/color/keptn-stacked-color.svg
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
deprecated: true
Expand Down
3 changes: 2 additions & 1 deletion onechart/0.0.1/artifacthub-pkg.yml
Expand Up @@ -5,13 +5,14 @@ name: onechart-service
displayName: OneChart Service
createdAt: 2021-04-01T00:00:00Z
description: This is a Keptn Service that provides a default Helm Chart template that can be used to deploy a service. The default Helm chart is OneChart from the Gimlet project.
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
- keptn
- helm
- sandbox
- deployment
links:
- name: Source
url: https://github.com/keptn-sandbox/onechart-service
Expand Down
4 changes: 2 additions & 2 deletions prometheus/0.6.1/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Prometheus Service
createdAt: 2021-06-18T00:00:00Z
description: Keptn service for utilizing Prometheus monitoring and alerting in keptn
logoURL: https://raw.githubusercontent.com/cncf/artwork/master/projects/prometheus/stacked/color/prometheus-stacked-color.svg
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down Expand Up @@ -36,5 +36,5 @@ install: |
recommendations:
- url: https://artifacthub.io/packages/helm/keptn/keptn
annotations:
keptn/kind: "sli-provider,prometheus"
keptn/kind: "prometheus"
keptn/version: "0.8.4-0.8.7"
4 changes: 2 additions & 2 deletions prometheus/0.6.2/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: Prometheus Service
createdAt: 2021-09-03T00:00:00Z
description: Keptn service for utilizing Prometheus monitoring and alerting in keptn
logoURL: https://raw.githubusercontent.com/cncf/artwork/master/projects/prometheus/stacked/color/prometheus-stacked-color.svg
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down Expand Up @@ -37,6 +37,6 @@ install: |
recommendations:
- url: https://artifacthub.io/packages/helm/keptn/keptn
annotations:
keptn/kind: "sli-provider,prometheus"
keptn/kind: "prometheus"
keptn/org: "contrib"
keptn/version: "0.9.0"
2 changes: 1 addition & 1 deletion servicenow/0.3.0/artifacthub-pkg.yml
Expand Up @@ -6,7 +6,7 @@ displayName: ServiceNow Service
createdAt: 2021-08-10T21:00:00Z
description: Keptn service to implement self-healing capabilities
logoURL: https://upload.wikimedia.org/wikipedia/commons/thumb/5/57/ServiceNow_logo.svg/2560px-ServiceNow_logo.svg.png
digest: 2021-10-05T15:00:00Z
digest: 2021-10-12T00:00:00Z
license: Apache-2.0
homeURL: https://keptn.sh/docs/integrations/
keywords:
Expand Down
106 changes: 106 additions & 0 deletions slack/0.2.0/README.md
@@ -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.
26 changes: 26 additions & 0 deletions slack/0.2.0/artifacthub-pkg.yml
@@ -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"

0 comments on commit 0857b00

Please sign in to comment.