Skip to content

Commit

Permalink
feat: add flux webhook to utility
Browse files Browse the repository at this point in the history
  • Loading branch information
joryirving committed Jan 28, 2025
1 parent 186749d commit 6d38b2c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ kind: Kustomization
resources:
- ./helmrelease.yaml
- ./prometheusrule.yaml
- ./webhook
configMapGenerator:
- name: flux-instance-helm-values
files:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# yaml-language-server: $schema=https://kube-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: &name github-webhook-token
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword
target:
name: *name
template:
data:
token: "{{ .FLUX_UTILITY_GITHUB_WEBHOOK_TOKEN }}"
dataFrom:
- extract:
key: flux
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: webhook-receiver
spec:
ingressClassName: external
rules:
- host: flux-webhook-utility.jory.dev
http:
paths:
- path: /hook/
pathType: Prefix
backend:
service:
name: webhook-receiver
port:
number: 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./externalsecret.yaml
- ./ingress.yaml
- ./receiver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# yaml-language-server: $schema=https://kube-schemas.pages.dev/notification.toolkit.fluxcd.io/receiver_v1.json
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata:
name: home-ops
spec:
type: github
events:
- ping
- push
secretRef:
name: github-webhook-token
resources:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
name: flux-system
namespace: flux-system
- apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
name: flux-system
namespace: flux-system

0 comments on commit 6d38b2c

Please sign in to comment.