Closed manno closed 2 weeks ago
An MVP will need to include:
GitRepo
ready across all target clustersGitRepo
-level configuration: triggers, destination URL, template, credentials (eg. sending notifications to different URLs, with different bodies, from dev/staging/prod clusters)Notifications should be sent:
Each notification should store the latest date/time when it was sent, to ease tracking (for users, and later on automated retries) and troubleshooting.
Notifications must be configurable at 3 distinct levels:
fleet-controller
config map to limit risks of involuntary edits to working Fleet config), which could be reconciled by the existing config reconciler or by a new one.GitRepo
and its targets. Configuration set here would override global settings.
Notifications
field to GitRepo
s. Predicates could be updated to enable that field to be updated without triggering reconcile loops, as notifications config has nothing to do with altering the state of the cluster.GitRepo
, target customizations) to determine whether or not to run a reconcile loop?
I don't see any indication of the desired guarantees around notification delivery, e.g. "at least once" or "at most once" or "exactly once"?
For example, GitHub webhooks are not retried (but you can do this manually).
A lot of care needs to be taken to not send notifications out-of-order.
Imagine reporting the deployment of 2dd90c5
before 468c517
when they are ordered differently on main
because the original attempt to delivery 468c517
failed the first time.
Some decisions could be made around translating events into hook notifications to upstream services (e.g. Slack, GitHub etc) assuming that in the longer term, Rancher components will all be sending notifications.
We want to notify external services about events in Fleet, so users can build workflows around Fleet as a deployer.
For now we are focusing on one type of outgoing notification, a http request, e.g targeted at a webhook endpoint.
Notifications are configured by creating a new custom resource, with fields like: URL, template for request body, credential references, which events to react to A new controller will watch for notification configs and then generate requests from that config when an event happens.
Research
What events should generate a notification?
Do we need logic to combine events, e.g. only notify if A and B happened? How do other projects deal with notifications? Are there "generic" notifiers we can use, besides http requests?