Skip to content

Commit

Permalink
chore: Update notifications engine to 7a06976 (#3384)
Browse files Browse the repository at this point in the history
* Run: go get github.com/argoproj/notifications-engine@7a069766e95476e1074eeed6145085160e2fec63

Updating and fetch latest notifications-engine dependencies

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

* Run: go get github.com/argoproj/notifications-engine/pkg/[email protected]

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

* Replace telegram-bot-api and run go mod tidy

- Update go.mod: github.com/go-telegram-bot-api/telegram-bot-api/v5 => github.com/OvyFlash/telegram-bot-api/v5 v5.0.0-20240108230938-63e5c59035bf
  - Ref: argoproj/notifications-engine#265
- Could also be done via go replace --edit
- go mod tidy also ran

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

* Add strReplaceDocFiles to update strings from default docs

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

* Run: make docs

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

* replace <config-map-name> with argo-rollouts-notification-configmap and also replace secret with argocd-notifications-secret

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

* add Ada company to USERS.md

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

* chore: update contributing docs with notifications engine section

Signed-off-by: Andre Marcelo-Tanner <[email protected]>

---------

Signed-off-by: Andre Marcelo-Tanner <[email protected]>
  • Loading branch information
kzap authored Feb 27, 2024
1 parent 1099f88 commit d06cc34
Show file tree
Hide file tree
Showing 24 changed files with 167 additions and 70 deletions.
3 changes: 2 additions & 1 deletion USERS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Who uses Argo Rollouts?
Organizations below are **officially** using Argo Rollouts. Please send a PR with your organization name if you are using Argo Rollouts.

1. [Ada](https://www.ada.cx)
1. [ADP](https://www.adp.com)
1. [Akuity](https://akuity.io/)
1. [Alibaba Group](https://www.alibabagroup.com/)
Expand All @@ -19,6 +20,7 @@ Organizations below are **officially** using Argo Rollouts. Please send a PR wit
1. [Flipkart](https://flipkart.com)
1. [GetYourGuide](https://www.getyourguide.com)
1. [Gllue](https://gllue.com)
1. [HashiCorp](https://www.hashicorp.com/)
1. [Ibotta](https://home.ibotta.com/)
1. [Intuit](https://www.intuit.com/)
1. [New Relic](https://newrelic.com/)
Expand Down Expand Up @@ -48,4 +50,3 @@ Organizations below are **officially** using Argo Rollouts. Please send a PR wit
1. [WeLab Bank](https://www.welab.bank/)
1. [Yotpo](https://www.yotpo.com/)
1. [VGS](https://www.vgs.io)
1. [HashiCorp](https://www.hashicorp.com/)
17 changes: 17 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,23 @@ pushed into the other kubernetes repositories yet. In order to import the kubern
associated repos have to pinned to the correct version specified by the kubernetes/kubernetes release. The
`./hack/update-k8s-dependencies.sh` updates all the dependencies to the those correct versions.

## Upgrading Notifications Engine
Argo Rollouts has a dependency on the [argoproj/notifications-engines](https://github.com/argoproj/notifications-engine) repo
for the notifications functionality and related documentation.

This is updated by upgrading the Go library in `go.mod` by running the commands:

```shell
go get github.com/argoproj/notifications-engine@LATEST_COMMIT_HASH
go mod tidy
```

Next the latest notifications documentation can be imported by running:

```shell
make docs
```

## Documentation Changes

Modify contents in `docs/` directory.
Expand Down
10 changes: 5 additions & 5 deletions docs/generated/notification-services/alertmanager.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You should turn off "send_resolved" or you will receive unnecessary recovery not
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.alertmanager: |
targets:
Expand All @@ -58,7 +58,7 @@ If your alertmanager has changed the default api, you can customize "apiPath".
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.alertmanager: |
targets:
Expand All @@ -70,7 +70,7 @@ data:
### Send high availability alertmanager with auth
Store auth token in `argocd-notifications-secret` Secret and use configure in `argocd-notifications-cm` ConfigMap.
Store auth token in `argo-rollouts-notification-secret` Secret and use configure in `argo-rollouts-notification-configmap` ConfigMap.

```yaml
apiVersion: v1
Expand All @@ -89,7 +89,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.alertmanager: |
targets:
Expand All @@ -110,7 +110,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.alertmanager: |
targets:
Expand Down
23 changes: 18 additions & 5 deletions docs/generated/notification-services/awssqs.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AWS SQS
# AWS SQS

## Parameters

This notification service is capable of sending simple messages to AWS SQS queue.
This notification service is capable of sending simple messages to AWS SQS queue.

* `queue` - name of the queue you are intending to send messages to. Can be overridden with target destination annotation.
* `region` - region of the sqs queue can be provided via env variable AWS_DEFAULT_REGION
Expand Down Expand Up @@ -30,7 +30,7 @@ metadata:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.awssqs: |
region: "us-east-2"
Expand Down Expand Up @@ -63,7 +63,7 @@ stringData:
### Minimal configuration using AWS Env variables
Ensure following list of environment variables are injected via OIDC, or other method. And assuming SQS is local to the account.
Ensure the following list of environment variables are injected via OIDC, or another method. And assuming SQS is local to the account.
You may skip usage of secret for sensitive data and omit other parameters. (Setting parameters via ConfigMap takes precedent.)
Variables:
Expand All @@ -89,7 +89,7 @@ metadata:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.awssqs: |
queue: "myqueue"
Expand All @@ -104,3 +104,16 @@ data:
- oncePer: obj.metadata.annotations["generation"]
```
## FIFO SQS Queues
FIFO queues require a [MessageGroupId](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessage.html#SQS-SendMessage-request-MessageGroupId) to be sent along with every message, every message with a matching MessageGroupId will be processed one by one in order.
To send to a FIFO SQS Queue you must include a `messageGroupId` in the template such as in the example below:

```yaml
template.deployment-ready: |
message: |
Deployment {{.obj.metadata.name}} is ready!
messageGroupId: {{.obj.metadata.name}}-deployment
```
6 changes: 3 additions & 3 deletions docs/generated/notification-services/email.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The following snippet contains sample Gmail service configuration:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.email.gmail: |
username: $email-username
Expand All @@ -36,7 +36,7 @@ Without authentication:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.email.example: |
host: smtp.example.com
Expand All @@ -52,7 +52,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
template.app-sync-succeeded: |
email:
Expand Down
7 changes: 4 additions & 3 deletions docs/generated/notification-services/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ The GitHub notification service changes commit status using [GitHub Apps](https:
3. Generate a private key, and download it automatically
![3](https://user-images.githubusercontent.com/18019529/108397926-d4a36300-725b-11eb-83fe-74795c8c3e03.png)
4. Install app to account
5. Store privateKey in `argocd-notifications-secret` Secret and configure GitHub integration
in `argocd-notifications-cm` ConfigMap
5. Store privateKey in `argo-rollouts-notification-secret` Secret and configure GitHub integration
in `argo-rollouts-notification-configmap` ConfigMap

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.github: |
appID: <app-id>
Expand Down Expand Up @@ -76,6 +76,7 @@ template.app-deployed: |
logURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
requiredContexts: []
autoMerge: true
transientEnvironment: false
pullRequestComment:
content: |
Application {{.app.metadata.name}} is now running new version of deployments manifests.
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/notification-services/googlechat.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ The Google Chat notification service send message notifications to a google chat
3. Under **Incoming Webhooks**, click **Add Webhook**
4. Give a name to the webhook, optionally add an image and click **Save**
5. Copy the URL next to your webhook
6. Store the URL in `argocd-notification-secret` and declare it in `argocd-notifications-cm`
6. Store the URL in `argocd-notification-secret` and declare it in `argo-rollouts-notification-configmap`

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.googlechat: |
webhooks:
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/notification-services/grafana.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Available parameters :
3. Click "Add API Key"
4. Fill the Key with name `ArgoCD Notification`, role `Editor` and Time to Live `10y` (for example)
5. Click on Add button
6. Store apiKey in `argocd-notifications-secret` Secret and Copy your API Key and define it in `argocd-notifications-cm` ConfigMap
6. Store apiKey in `argo-rollouts-notification-secret` Secret and Copy your API Key and define it in `argo-rollouts-notification-configmap` ConfigMap

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.grafana: |
apiUrl: https://grafana.example.com/api
Expand Down
6 changes: 3 additions & 3 deletions docs/generated/notification-services/mattermost.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
![1](https://user-images.githubusercontent.com/18019529/111499520-62ed0500-8786-11eb-88b0-d0aade61fed4.png)
2. Invite team
![2](https://user-images.githubusercontent.com/18019529/111500197-1229dc00-8787-11eb-98e5-587ee36c94a9.png)
3. Store token in `argocd-notifications-secret` Secret and configure Mattermost integration
in `argocd-notifications-cm` ConfigMap
3. Store token in `argo-rollouts-notification-secret` Secret and configure Mattermost integration
in `argo-rollouts-notification-configmap` ConfigMap

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.mattermost: |
apiURL: <api-url>
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/notification-services/newrelic.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
## Configuration

1. Create a NewRelic [Api Key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#user-api-key)
2. Store apiKey in `argocd-notifications-secret` Secret and configure NewRelic integration in `argocd-notifications-cm` ConfigMap
2. Store apiKey in `argo-rollouts-notification-secret` Secret and configure NewRelic integration in `argo-rollouts-notification-configmap` ConfigMap

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.newrelic: |
apiURL: <api-url>
Expand Down
48 changes: 42 additions & 6 deletions docs/generated/notification-services/opsgenie.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,58 @@ To be able to send notifications with argocd-notifications you have to create an
3. Click "Teams" in the Menu on the left
4. Select the team that you want to notify
5. In the teams configuration menu select "Integrations"
6. click "Add Integration" in the top right corner
6. Click "Add Integration" in the top right corner
7. Select "API" integration
8. Give your integration a name, copy the "API key" and safe it somewhere for later
9. Make sure the checkboxes for "Create and Update Access" and "enable" are selected, disable the other checkboxes to remove unnecessary permissions
10. Click "Safe Integration" at the bottom
11. Check your browser for the correct server apiURL. If it is "app.opsgenie.com" then use the US/international api url `api.opsgenie.com` in the next step, otherwise use `api.eu.opsgenie.com` (European API).
12. You are finished with configuring opsgenie. Now you need to configure argocd-notifications. Use the apiUrl, the team name and the apiKey to configure the Opsgenie integration in the `argocd-notifications-secret` secret.
9. Click "Edit" in the integration settings
10. Make sure the checkbox for "Create and Update Access" is selected, disable the other checkboxes to remove unnecessary permissions
11. Click "Save" at the bottom
12. Click "Turn on integration" in the top right corner
13. Check your browser for the correct server apiURL. If it is "app.opsgenie.com" then use the US/international api url `api.opsgenie.com` in the next step, otherwise use `api.eu.opsgenie.com` (European API).
14. You are finished with configuring Opsgenie. Now you need to configure argocd-notifications. Use the apiUrl, the team name and the apiKey to configure the Opsgenie integration in the `argo-rollouts-notification-secret` secret.
15. You can find the example `argo-rollouts-notification-configmap` configuration at the below.

| **Option** | **Required** | **Type** | **Description** | **Example** |
| ------------- | ------------ | -------- | -------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `description` | True | `string` | Description field of the alert that is generally used to provide a detailed information about the alert. | `Hello from Argo CD!` |
| `priority` | False | `string` | Priority level of the alert. Possible values are P1, P2, P3, P4 and P5. Default value is P3. | `P1` |
| `alias` | False | `string` | Client-defined identifier of the alert, that is also the key element of Alert De-Duplication. | `Life is too short for no alias` |
| `note` | False | `string` | Additional note that will be added while creating the alert. | `Error from Argo CD!` |

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.opsgenie: |
apiUrl: <api-url>
apiKeys:
<your-team>: <integration-api-key>
template.opsgenie: |
message: |
[Argo CD] Application {{.app.metadata.name}} has a problem.
opsgenie:
description: |
Application: {{.app.metadata.name}}
Health Status: {{.app.status.health.status}}
Operation State Phase: {{.app.status.operationState.phase}}
Sync Status: {{.app.status.sync.status}}
priority: P1
alias: {{.app.metadata.name}}
note: Error from Argo CD!
trigger.on-a-problem: |
- description: Application has a problem.
send:
- opsgenie
when: app.status.health.status == 'Degraded' or app.status.operationState.phase in ['Error', 'Failed'] or app.status.sync.status == 'Unknown'
```
16. Add annotation in application yaml file to enable notifications for specific Argo CD app.
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
notifications.argoproj.io/subscribe.on-a-problem.opsgenie: <your-team>
```
4 changes: 2 additions & 2 deletions docs/generated/notification-services/overview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The notification services represent integration with services such as slack, email or custom webhook. Services are configured in `argocd-notifications-cm` ConfigMap
using `service.<type>.(<custom-name>)` keys and might reference sensitive data from `argocd-notifications-secret` Secret. Following example demonstrates slack
The notification services represent integration with services such as slack, email or custom webhook. Services are configured in `argo-rollouts-notification-configmap` ConfigMap
using `service.<type>.(<custom-name>)` keys and might reference sensitive data from `argo-rollouts-notification-secret` Secret. Following example demonstrates slack
service configuration:

```yaml
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/notification-services/pagerduty.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.pagerduty: |
token: $pagerdutyToken
Expand All @@ -41,7 +41,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
template.rollout-aborted: |
message: Rollout {{.rollout.metadata.name}} is aborted.
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/notification-services/pagerduty_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.pagerdutyv2: |
serviceKeys:
Expand All @@ -43,7 +43,7 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
template.rollout-aborted: |
message: Rollout {{.rollout.metadata.name}} is aborted.
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/notification-services/pushover.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Pushover

1. Create an app at [pushover.net](https://pushover.net/apps/build).
2. Store the API key in `<secret-name>` Secret and define the secret name in `<config-map-name>` ConfigMap:
2. Store the API key in `<secret-name>` Secret and define the secret name in `argo-rollouts-notification-configmap` ConfigMap:

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.pushover: |
token: $pushover-token
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/notification-services/rocketchat.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ stringData:
apiVersion: v1
kind: ConfigMap
metadata:
name: <config-map-name>
name: argo-rollouts-notification-configmap
data:
service.rocketchat: |
email: $rocketchat-email
Expand Down
Loading

0 comments on commit d06cc34

Please sign in to comment.