This PR is all about trying out a new way of getting events from HelmReleases. Instead of the old way where we used webhooks to get notified when something happened, we're going for a pull-based model.
The big idea here is to make our Pipeline configuration simpler. That means no more messing around with setting up notification-controller providers and alerts.
What's going on
Our controller keeps an eye out for changes in GitopsCluster CRs. When it spots something, it creates clients for leaf clusters.
When a Pipeline is being sorted out, the controller identifies the app and labels all targets in each cluster. These labels help us know which pipeline we're dealing with when a HelmRelease event comes in.
The controller then starts a watch on all HelmRelease targets to catch any events that happen.
When an actual version update pops up, the controller moves the app to the next environment. It's like a promotion for the app!
sequenceDiagram
actor U as operator
U->>+API Server: creates Pipeline
participant PC as Pipeline Controller
participant PS as Promotion Strategy
API Server->>+PC: notifies
participant dt1 as dev/target 1
rect rgb(67, 207, 250)
note right of PC: setup phase
note right of PC: pipelines.wego.weave.works/name<br/>pipelines.wego.weave.works/env<br/>pipelines.wego.weave.works/target
PC->>+dt1: label AppRef with metadata
participant dt2 as dev/target 2
PC->>+dt2: label AppRef with metadata
participant pt1 as prod/target 1
PC->>+pt1: label AppRef with metadata
end
rect rgb(50, 227, 221)
note right of PC: promotion phase
PC-->>+dt1: watches HelmRelease and Kustomizations changes
PC-->>+dt2: watches HelmRelease and Kustomizations changes
PC-->>+pt1: watches HelmRelease and Kustomizations changes
end
dt1->>+PC: update events from AppRef
PC ->>PC: filter upgrade events
PC ->>PC: extract metadata
PC->>+PS: kicks off
This PR is all about trying out a new way of getting events from HelmReleases. Instead of the old way where we used webhooks to get notified when something happened, we're going for a pull-based model.
The big idea here is to make our Pipeline configuration simpler. That means no more messing around with setting up notification-controller providers and alerts.
What's going on