Skip to content

Commit

Permalink
Initial working example
Browse files Browse the repository at this point in the history
  • Loading branch information
HrithikKanugula committed Jan 15, 2025
1 parent a7ea0e2 commit 26d1a60
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
11 changes: 11 additions & 0 deletions event-sensor-workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This folder contains artifacts and instructions for spinnaker-type pipelines such as github-triggered and webhook-triggered deployments

The set-up is in srini-strix. Argo-events is setup in argo-events, argo-workflows in argo and argocd in argocd namespaces.

Document link: https://docs.google.com/document/d/1BVMmq7AV0MPmIREjYv2_gIyJaapM2ransW9EszBxw1w/edit?tab=t.0

Webhook strigger command:
```curl -vvv -d '{"message":"test"}' https://webhook-events.srini-striks.opsmx.co/webhook -H "content-type: application/json"```


TODO: pod-logs are not showing up in sensor-created workflow pods. Looks like authentication is the issue?
22 changes: 22 additions & 0 deletions event-sensor-workflows/eventsource-webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
annotations:
name: webhook
namespace: argo-events
spec:
service:
metadata:
annotations:
foo: bar
labels:
foo: bar
ports:
- port: 12000
targetPort: 12000
webhook:
webhook:
endpoint: /webhook
method: POST
port: "12000"
url: ""
47 changes: 47 additions & 0 deletions event-sensor-workflows/sensor-webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
annotations:
name: webhook
namespace: argo-events
spec:
dependencies:
- eventName: webhook
eventSourceName: webhook
name: webhook-generic
loggingFields: null
template:
serviceAccountName: operate-workflow-sa
triggers:
- template:
k8s:
operation: create
parameters:
- dest: spec.arguments.parameters.0.value
src:
dataKey: body.message
dependencyName: webhook-generic
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: webhook-
spec:
arguments:
parameters:
- name: message
value: WILLBEREPLACED
entrypoint: whalesay
templates:
- container:
args:
- '{{inputs.parameters.message}}'
command:
- cowsay
image: docker/whalesay:latest
inputs:
parameters:
- name: message
name: whalesay
name: webhook-workflow-trigger
25 changes: 25 additions & 0 deletions event-sensor-workflows/webhook-events-ing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-isd-argo-argocd
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/backend-protocol: HTTP
name: webhook-ingress
namespace: argo-events
spec:
rules:
- host: webhook-events.srini-striks.opsmx.co
http:
paths:
- backend:
service:
name: webhook-eventsource-svc
port:
number: 12000
path: /
pathType: Prefix
tls:
- hosts:
- webhook-events.srini-striks.opsmx.co
secretName: webhook-events-tls-certificate

0 comments on commit 26d1a60

Please sign in to comment.