This guide shows how to create an Argo Events EventSource that exposes an HTTP webhook, how the webhook maps to CloudEvents-style payloads, and how to verify the EventSource and Service inside your Kubernetes cluster. Use this tutorial to receive webhooks from external systems (GitHub, GitLab, CI/CD tools, custom services) and forward them into Argo’s eventing pipeline. Argo Events supports many sources (AWS SNS, SQS, Azure services, calendar events, GCP Pub/Sub, GitHub, GitLab, Bitbucket, MinIO, Kafka, and more). For this demo we use the webhook EventSource, which runs an HTTP server and transforms incoming requests into CloudEvents-style envelopes.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
CloudEvents envelope examples
A typical CloudEvents-style envelope produced by Argo Events contains a context and data section:The webhook EventSource listens on the configured port and endpoint. By default, Argo Events will create a Kubernetes Service that exposes the same port. If you want traffic from outside the cluster to reach the webhook, expose the Service using a suitable type for your environment (LoadBalancer, NodePort, Ingress, etc.).
Prerequisites
- A Kubernetes cluster with kubectl configured to access it.
- Argo Events (controller, eventbus, etc.) installed into a namespace (commonly argo-events).
- Optional: an Ingress or LoadBalancer if you need external, public endpoints.
Install Argo Events (if needed)
Apply the upstream manifests to install Argo Events and an example Sensor. Adjust URLs if you use local manifests:Example EventSource manifest (webhook)
Below is an example EventSource that creates:- A webhook listener on port 13000.
- An endpoint at /push which accepts only POST requests.
- A generated ClusterIP Service exposing port 13000.
| Field | Purpose | Example |
|---|---|---|
| spec.service.ports.port | Port exposed by the generated Kubernetes Service | 13000 |
| spec.webhook.<name>.port | Port the webhook server listens on (string) | “13000” |
| spec.webhook.<name>.endpoint | HTTP path to accept events on | /push |
| spec.webhook.<name>.method | Restrict allowed HTTP methods (POST, GET, etc.) | ”POST” |
Verify the EventSource and Service
List resources in the argo-events namespace to confirm the EventSource pod and Service are running:- The webhook EventSource pod is running.
- A ClusterIP Service (service/webhook-eventsource-svc) exposes port 13000.
-
Inspect the EventSource resource:
-
View cluster events:
Test the webhook locally (port-forward)
If you don’t have a LoadBalancer or Ingress, port-forward to the Service/pod and test with curl:-
Port-forward the Service (or pod) to localhost:
-
In another terminal, POST a test payload:
-
Check the EventSource logs to see the incoming request being wrapped into a CloudEvents-style envelope:
How the flow works
- External systems POST to http://<cluster-ip-or-loadbalancer>:13000/push (or your public ingress URL).
- The EventSource receives the request, wraps it into a CloudEvents-like envelope (context + data), and forwards the event onto the configured EventBus.
- Sensors in Argo Events consume these events and trigger Argo Workflows, notifications, or other actions.
Quick troubleshooting
| Symptom | Check |
|---|---|
| No Service on expected port | kubectl -n argo-events get svc - check service/webhook-eventsource-svc ports |
| POST returns 404 | Confirm endpoint path (endpoint: /push) and HTTP method allowed |
| Events not triggering Sensors | Check EventBus health and Sensor configurations in the same namespace |
| External webhooks can’t reach cluster | Verify Ingress/LoadBalancer, firewall rules, and DNS routing |
If you expose a webhook endpoint to the public internet, secure it: use TLS, require authentication or tokens, validate payloads, and restrict source IPs where possible. An unprotected webhook can be abused or flood your cluster with requests.
Links and references
- Argo Events Documentation
- Argo Workflows UI
- CloudEvents Specification
- Kubernetes Services
- GitHub Webhooks