Skip to content

Commit

Permalink
add proposal
Browse files Browse the repository at this point in the history
Signed-off-by: May Zhang <may_zhang@intuit.com>
  • Loading branch information
mayzhang2000 committed Aug 23, 2023
1 parent b3504f9 commit 4e08919
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
Binary file modified docs/proposals/images/self-service-notifications.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
38 changes: 25 additions & 13 deletions docs/proposals/self-service-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,32 @@ last-updated: 2023-08-22

## Summary
This proposal is to enable application teams to have their own configurations of ArgoCD notifications aka self-service notification.
Application team will be able to receive notifications from the default configuration of notifications as well as their own configuration of notifications.
Application team will be able to receive notifications from the default (using the configuration from the namespace of the notification controller) as well as their own configuration of notifications.

## Motivation
As of now the configuration for ArgoCD notification is centrally managed. Only ArgoCD admin can make notification configuration changes.

When application teams use PagerDutyV2 for their notification service, every application team needs to create an integration key for each service in Pager Duty.
ArgoCD amin needs to add the integration key to kubernete's secret `argocd-notifications-secret`,
ArgoCD admin needs to add the integration key to kubernete's secret `argocd-notifications-secret`,
also needs to modify configmap `argocd-notifications-cm` to add the reference to the integration key stored in above secret under the list of `serviceKeys`

When there are many application teams want to use PagerDutyV2 for their notification service, they all have to go to ArgoCD admin team. This does not scale.

We need to enable application team to configure their own notification configurations.
Teams also want to control the notification templates and triggers independently of what ArgoCD admin configured.

We need to enable application team's the ability to configure their own notification configurations.

## Proposal
Deploy app-specific notification configuration resources in the same namespace where ArgoCD application is in.
ArgoCD applications are in any namespaces.
Deploy notification configuration resources (configmap, secret) in the same namespace where the ArgoCD application is at.
ArgoCD applications are in any namespace using apps in any namespace feature.

Enhance notification controller to support app in any namespace so that it sends notifications for apps in any namespaces.
Notification controller knows the set of namespaces to monitor by using `--application-namespaces` startup parameter.
Enhance ArgoCD notification controller to support app in any namespace.
Notification controller will know the namespaces to monitor by using `--application-namespaces` startup parameter.
It can also be conveniently set up and kept in sync by specifying the application.namespaces settings in the argocd-cmd-params-cm ConfigMap.

Enhance notification controller to create notification-engine controller using function `NewControllerWithNamespaceSupport`. This sets flag `namespaceSupport = true`.
When this flag is on, notification-engine controller calls apiFactory to creates apis from both the default configuration and also configuration in the application's namespace.
Enhance ArgoCD notification controller to use notification-engine's function `NewControllerWithNamespaceSupport()`.
This function uses the application's `metadata.namespace` field to find the location of the configmap and secret.
This controller uses both the self-service configuration and the admin defined default configuration.

![img.png](images/self-service-notifications.png)

Expand All @@ -55,13 +58,14 @@ When this flag is on, notification-engine controller calls apiFactory to creates
Add a list of detailed use cases this enhancement intends to take care of.

#### Use case 1: application team wants to configure ArgoCD notification using pager duty V2.
I want to receive Pager Duty notification when my application is degraded, but our default ArgoCD notification is using slack.
I want to receive Pager Duty notification when my application is syncing, but our default ArgoCD notification is using slack.

* Create two additional resources `argocd-notifications-secret` and `argocd-notifications-cm`.
In these resources I used PagerDutyV2 as service type.
* Deploy these two additional resources to the same namespace as my ArgoCD application.

### Detailed examples

#### Use case 1 Detailed example

```yaml
apiVersion: argoproj.io/v1alpha1
Expand Down Expand Up @@ -120,13 +124,21 @@ metadata:
type: Opaque
```
#### Use case 2: application team wants to configure custom template
ArgoCD admin has configured basic templates, as end user, I want to receive more detailed information that only pertains to my team.
#### Use case 3: application team wants to configure custom trigger
ArgoCD admin has configured basic triggers, as end user, I want to receive a notification based on a trigger that pertains to my team.
### Security Considerations
### Risks and Mitigations
### Considerations
This adds a new configuration pattern to ArgoCD. Today, ArgoCD has a few different patterns for configuration.
This proposal aligns itself with apps in any namespace pattern.
## Drawbacks
## Alternatives
![img.png](images/self-service-notifications2.png)

0 comments on commit 4e08919

Please sign in to comment.