Skip to content

Commit 26f84f1

Browse files
committed
docs: Add the API spec for Receivers v1beta2
Signed-off-by: Stefan Prodan <[email protected]>
1 parent cca289d commit 26f84f1

File tree

3 files changed

+452
-76
lines changed

3 files changed

+452
-76
lines changed

docs/spec/README.md

Lines changed: 4 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ events are processed and where to dispatch them.
3434

3535
Notification API:
3636

37-
* [Provider](v1beta1/provider.md)
38-
* [Alert](v1beta1/alert.md)
39-
* [Event](v1beta1/event.md)
37+
* [Alerts](v1beta2/alerts.md)
38+
* [Providers](v1beta2/providers.md)
39+
* [Git Commit Status Updates](v1beta2/statusupdates.md)
4040

4141
The alert delivery method is **at-most once** with a timeout of 15 seconds.
4242
The controller performs automatic retries for connection errors and 500-range response code.
@@ -52,7 +52,7 @@ to be accessed by GitHub, GitLab, Bitbucket, Harbor, DockerHub, Jenkins, Quay, e
5252

5353
Receiver API:
5454

55-
* [Receiver](v1beta1/receiver.md)
55+
* [Receivers](v1beta2/receivers.md)
5656

5757
When a `Receiver` is created, the controller sets the `Receiver`
5858
status to Ready and generates a URL in the format `/hook/sha256sum(token+name+namespace)`.
@@ -64,74 +64,3 @@ When the controller receives a POST request:
6464
* validates the signature using the `token` secret
6565
* extract the event type from the payload
6666
* triggers a reconciliation for `spec.resources` if the event type matches one of the `spec.events` items
67-
68-
## Example
69-
70-
After installing notification-controller, we can configure alerting for events issued
71-
by source-controller and kustomize-controller.
72-
73-
Create a notification provider for Slack:
74-
75-
```yaml
76-
apiVersion: notification.toolkit.fluxcd.io/v1beta1
77-
kind: Provider
78-
metadata:
79-
name: slack
80-
spec:
81-
type: slack
82-
channel: prod-alerts
83-
secretRef:
84-
name: slack-url
85-
---
86-
apiVersion: v1
87-
kind: Secret
88-
metadata:
89-
name: slack-url
90-
data:
91-
address: <encoded-url>
92-
```
93-
94-
Create an alert for a list of GitRepositories and Kustomizations:
95-
96-
```yaml
97-
apiVersion: notification.toolkit.fluxcd.io/v1beta1
98-
kind: Alert
99-
metadata:
100-
name: on-call-webapp
101-
spec:
102-
providerRef:
103-
name: slack
104-
eventSeverity: info
105-
eventSources:
106-
- kind: GitRepository
107-
name: '*'
108-
- kind: Kustomization
109-
name: webapp-frontend
110-
- kind: Kustomization
111-
name: webapp-backend
112-
```
113-
114-
Based on the above configuration, the controller will post messages on Slack every time there is an event
115-
issued for the webapp Git repository and Kustomizations.
116-
117-
Kustomization apply event example:
118-
119-
```json
120-
{
121-
"severity": "info",
122-
"ts": "2020-09-17T07:27:11.921Z",
123-
"reportingController": "kustomize-controller",
124-
"reason": "ApplySucceed",
125-
"message": "Kustomization applied in 1.4s, revision: master/a1afe267b54f38b46b487f6e938a6fd508278c07",
126-
"involvedObject": {
127-
"kind": "Kustomization",
128-
"name": "webapp-backend",
129-
"namespace": "default"
130-
},
131-
"metadata": {
132-
"service/backend": "created",
133-
"deployment.apps/backend": "created",
134-
"horizontalpodautoscaler.autoscaling/backend": "created"
135-
}
136-
}
137-
```

docs/spec/v1beta2/providers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ stringData:
233233
When set to `true`, the controller will stop sending events to this provider.
234234
When the field is set to `false` or removed, it will resume.
235235

236-
## Provider guids
236+
## Provider guides
237237

238238
### Generic webhook
239239

0 commit comments

Comments
 (0)