You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-15Lines changed: 16 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# flux-webhook-autoreconciler
2
2
3
-
This project aims to solve the problem of having to manually setup webhooks for each repository in a cluster to reconcile Flux sources.
3
+
This project aims to solve the problem of having to manually setup webhooks for each repository in a cluster to reconcile Flux sources.
4
4
5
-
Normally, you'd need to set up a Receiver for each source, then a webhook for that receiver ([official docs](https://fluxcd.io/flux/guides/webhook-receivers/)).
5
+
Normally, you'd need to set up a Receiver for each source, then a webhook for that receiver ([official docs](https://fluxcd.io/flux/guides/webhook-receivers/)).
6
6
This can get pretty annoying and it's easy to mess up, especially when you have tons of repos you want to deploy with Flux.
7
7
8
-
This project tackles this by giving you a single webhook receiver. You hook it up to your entire GitHub organization,
8
+
This project tackles this by giving you a single webhook receiver. You hook it up to your entire GitHub organization,
9
9
and it'll automatically keep the Flux sources in sync across all your repos.
10
10
11
11
## How it works
@@ -15,7 +15,7 @@ This project has two main parts:
15
15
-`Server`: It gets the webhooks, reconciles the sources, and tells the clients about what happened.
16
16
-`Client`: (Optional) It listens to the server and reconciles the sources. You can run just the server if you want, but having a client is handy if you have multiple clusters. You send one webhook to the server, and it’ll reconcile the sources in all your clusters through their clients.
17
17
18
-
Basically, the server waits for webhooks on the `/webhook` endpoint, and the client connects to the server on the `/subscribe` endpoint using WebSockets. You can have as many clients as you want (like, one client for each Kubernetes cluster). Both the server and client take care of reconciling the sources.
18
+
Basically, the server waits for webhooks on the `/webhook` endpoint, and the client connects to the server on the `/subscribe` endpoint using WebSockets. You can have as many clients as you want (like, one client for each Kubernetes cluster). Both the server and client take care of reconciling the sources.
19
19
20
20
To figure out which sources need reconciling when a webhook comes in, the reconciler takes the package name from the webhook data, checks out all the sources, and then matches it up with the package name in each source. If there's a match, that source gets reconciled.
21
21
@@ -25,7 +25,7 @@ There is helm chart available published as OCI artifact in GitHub Packages [here
25
25
You can install it using [Helm CLI](https://helm.sh/docs/topics/registries/) or by using Flux itself:
version: '1.0.0'# replace with the latest version from here https://github.com/codex-team/flux-webhook-autoreconciler/pkgs/container/flux-webhook-autoreconciler%2Fchart%2Fflux-webhook-autoreconciler
47
+
version: '2.0.0'# replace with the latest version from here https://github.com/codex-team/flux-webhook-autoreconciler/pkgs/container/flux-webhook-autoreconciler%2Fchart%2Fflux-webhook-autoreconciler
48
48
sourceRef:
49
49
kind: HelmRepository
50
50
name: flux-webhook-autoreconciler
@@ -67,22 +67,23 @@ The configuration is done via YAML file that is passed to the container via `--c
67
67
68
68
You can find the example configuration in [config](./config) folder both for `server` and `client` modes.
69
69
70
-
You'll also need to set up a GitHub webhook. You have the choice to do this for your whole organization or on a per-repo basis. For the how-to, check out the [official docs](https://docs.github.com/en/webhooks/using-webhooks/creating-webhooks).
70
+
You'll also need to set up a GitHub webhook. You have the choice to do this for your whole organization or on a per-repo basis. For the how-to, check out the [official docs](https://docs.github.com/en/webhooks/using-webhooks/creating-webhooks).
71
71
To get the webhook working, you'll need to sort out a few things:
72
72
73
73
- Payload URL: `https://<your-domain>/webhook`
74
74
- Content type: `application/json`
75
75
- Secret (optional but recommended)
76
-
- In the section "Which events would you like to trigger this webhook?", go for "Let me select individual events." and then tick the box for the "Registry packages" event.
76
+
- In the section "Which events would you like to trigger this webhook?", go for "Let me select individual events." and then tick the boxes for the "Registry packages" and "Pushes" events.
77
77
78
-
And that’s it! Now you can push a new package to your GitHub registry and it will be automatically reconciled by Flux.
78
+
And that’s it! Now when you push a new package to your GitHub registry or push commits to a GitHub repository, the matching Flux `OCIRepository` and `GitRepository` resources will be automatically reconciled.
79
79
80
-
## Todo
80
+
## Limitations
81
81
82
-
- [ ] Add support for other kinds of sources. Right now, it’s just `OCIRepository`.
83
-
- [ ] Make it work with other types of webhook data. For now, it’s only set up for GitHub-like payloads.
84
-
- [ ] Add different filtering abilities, like filtering by package name or repo labels.
82
+
- It only supports GitHub webhooks.
83
+
- It only supports `OCIRepository` and `GitRepository` resources.
84
+
- It only supports `published` events for `OCIRepository` resources.
85
+
- It only supports `push` events for `GitRepository` resources.
85
86
86
87
# Contribute
87
88
88
-
Feel free to contribute to this project by creating issues and pull requests.
89
+
Feel free to contribute to this project by creating issues and pull requests.
description: A Helm chart for a Flux webhook auto-reconciler that exposes a single GitHub webhook endpoint and automatically reconciles matching Flux sources across clusters.
0 commit comments