When operating a cluster, different teams may wish to receive notifications about
the status of their GitOps pipelines.
For example, the on-call team would receive alerts about reconciliation
failures in the cluster, while the dev team may wish to be alerted when a new version
failures in the cluster, while the dev team may wish to be alerted when a new version
of an app was deployed and if the deployment is healthy.
## Prerequisites
To follow this guide you'll need a Kubernetes cluster with the GitOps
To follow this guide you'll need a Kubernetes cluster with the GitOps
toolkit controllers installed on it.
Please see the [get started guide](../get-started/index.md)
or the [installation guide](installation.md).
@ -48,8 +48,8 @@ spec:
The provider type can be `slack`, `msteams`, `discord`, `rocket` or `generic`.
When type `generic` is specified, the notification controller will post the incoming
[event](../components/notification/event.md) in JSON format to the webhook address.
This way you can create custom handlers that can store the events in
[event](../components/notification/event.md) in JSON format to the webhook address.
This way you can create custom handlers that can store the events in
Elasticsearch, CloudWatch, Stackdriver, etc.
## Define an alert
@ -63,7 +63,7 @@ metadata:
name: on-call-webapp
namespace: gitops-system
spec:
providerRef:
providerRef:
name: slack
eventSeverity: info
eventSources:
@ -102,3 +102,58 @@ When the verbosity is set to `info`, the controller will alert if:
* an error occurs
![info alert](../diagrams/slack-info-alert.png)
## GitHub commit status
The GitHub provider is a special kind of notification provider that based on the
state of a Kustomization resource, will update the
[commit status](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-status-checks) for the currently reconciled commit id.
The resulting status will contain information from the event in the format `{{ .Kind }}/{{ .Name }} - {{ .Reason }}`.
The secret referenced in the provider is expected to contain a [personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)