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.
Apply the manifest (for example save as webhook-eventsource.yaml):
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
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