Guide to configuring an Argo Events webhook EventSource in Kubernetes, converting HTTP requests into CloudEvents envelopes, exposing and testing the service, and troubleshooting deployment and networking
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.
When the webhook receives an HTTP request, the event payload typically includes the request headers and body:
Copy
{ "context": { "type": "type_of_event_source", "specversion": "cloud_events_version", "source": "name_of_the_event_source", "id": "unique_event_id", "time": "event_time", "datacontenttype": "type_of_data", "subject": "name_of_the_configuration_within_event_source" }, "data": { "header": { /* headers from the received HTTP request */ }, "body": { /* payload received in the HTTP request body */ } }}
Note: the exact structure may vary depending on how the EventSource is configured (e.g., static payloads, custom converters, or secret mappings).
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.).
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.
Use this pattern as a base to extend the webhook EventSource with authentication, custom converters, static payloads, or multiple endpoints per EventSource.