/gitops-argo-skills:argo-events-and-event-driven-automationfrom gitops-argo-skills
Sets up Argo Events EventSource, Sensor, and EventBus CRDs to trigger Argo Workflows or Kubernetes resource changes from external events like webhooks, Kafka/NATS/SQS/RabbitMQ, and cron schedules.
Ships in gitops-argo-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Argo Events is a Kubernetes-native event framework that decouples event
sources (webhooks, message queues, cloud storage notifications, cron
schedules, and dozens of other emitters) from triggers (starting an Argo
Workflow, creating/patching a Kubernetes resource, calling another
webhook), connected through a Sensor's dependency/filter logic and an
EventBus for durable delivery between them. It exists so that
"kick off automation when X happens" doesn't require bespoke polling
scripts, a hand-rolled webhook receiver Deployment, or gluing together an
external broker's client libraries per language/team — the event
plumbing, retry, and filtering logic is declarative and lives in the same
GitOps-managed cluster as everything else. This matters operationally
because event-driven automation that's implemented as ad hoc scripts
tends to have no consistent retry/dedup/observability story; Argo Events
gives all three uniformly across every event source.
EventSource/Sensor pair.EventBus provisioned in the target namespace —
the default NATS-backed EventBus is sufficient for most setups;
Kafka-backed EventBus is available for higher-throughput/durability
needs.EventSources (GitHub, Gitlab, generic webhook), an
Ingress or LoadBalancer exposing the EventSource's Service publicly
(or within the org's network) with TLS terminated appropriately.EventSources (Kafka, NATS, SQS, RabbitMQ, Redis
Streams, etc.), network access and credentials (via a referenced
Secret, never inline) to the broker.Sensor's ServiceAccount granted RBAC to create
Workflow/WorkflowTemplate resources in the target namespace — Argo
Events triggers a Workflow by creating the CRD object directly via the
Kubernetes API, so ordinary RBAC applies.Provision an EventBus (once per namespace, shared by all
EventSource/Sensor pairs in it):
apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: default
namespace: automation
spec:
nats:
native:
replicas: 3
auth: token
Define an EventSource for the origin of events. Webhook example
(generic HTTP webhook — GitHub/GitLab have dedicated event source
types with signature verification):
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: upload-webhook
namespace: automation
spec:
service:
ports: [{ port: 12000, targetPort: 12000 }]
webhook:
upload-complete:
port: "12000"
endpoint: /upload-complete
method: POST
Message-queue example (SQS):
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: s3-notifications
namespace: automation
spec:
sqs:
upload-queue:
region: us-east-1
queue: <SQS_QUEUE_NAME>
accessKey:
name: aws-credentials
key: access-key
secretKey:
name: aws-credentials
key: secret-key
Credentials are referenced from an existing Secret
(aws-credentials) — never inlined as plaintext values in the
EventSource spec.
Cron example:
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: nightly-trigger
namespace: automation
spec:
calendar:
nightly:
schedule: "0 2 * * *"
timezone: "UTC"
Define a Sensor that depends on one or more EventSource
event names, filters them, and fires triggers:
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: upload-processor
namespace: automation
spec:
dependencies:
- name: upload-dep
eventSourceName: s3-notifications
eventName: upload-queue
filters:
data:
- path: body.detail.object.key
type: string
comparator: "="
value: ["*.parquet"]
triggers:
- template:
name: start-etl-workflow
argoWorkflow:
operation: submit
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: etl-from-upload-
spec:
workflowTemplateRef: { name: nightly-etl }
arguments:
parameters:
- name: object-key
value: "{{upload-dep.body.detail.object.key}}"
The filters.data block rejects events that don't match (e.g.,
non-.parquet uploads) before the trigger fires at all — filter as
early and specifically as possible rather than triggering broadly and
filtering downstream inside the Workflow.
Fan one event out to multiple independent triggers by adding
more entries to spec.triggers, each with its own template:
spec:
dependencies:
- { name: upload-dep, eventSourceName: s3-notifications, eventName: upload-queue }
triggers:
- template:
name: start-etl-workflow
argoWorkflow: { operation: submit, source: { resource: { ... } } }
- template:
name: notify-slack
http:
url: https://hooks.example.internal/notify
method: POST
payload:
- src: { dependencyName: upload-dep, dataKey: body.detail.object.key }
dest: object-key
- template:
name: patch-status-configmap
k8s:
operation: patch
source:
resource:
apiVersion: v1
kind: ConfigMap
metadata: { name: last-upload-status }
patchStrategy: merge
Require correlation across multiple events before triggering,
using multiple dependencies and a circuit expression:
spec:
dependencies:
- { name: upload-dep, eventSourceName: s3-notifications, eventName: upload-queue }
- { name: validate-dep, eventSourceName: validation-webhook, eventName: validation-complete }
triggers:
- template:
name: start-etl-workflow
conditions: "upload-dep && validate-dep"
argoWorkflow: { operation: submit, source: { resource: { ... } } }
eventBusName: default
conditions is a boolean expression over dependency names — the
trigger only fires once both named dependencies have each delivered
a matching event (within the Sensor's correlation window), not on
either alone.
Verify and debug:
kubectl get eventsource,sensor,eventbus -n automation
kubectl logs -n automation deploy/upload-webhook-eventsource -f
kubectl logs -n automation deploy/upload-processor-sensor -f
kubectl describe sensor upload-processor -n automation # trigger conditions/status
The Sensor's own logs show whether an event was received, which
filters it passed/failed, and whether the trigger action itself
succeeded or errored (e.g., RBAC denial creating the Workflow).
Sensor's dependencies.filters,
not downstream inside the triggered Workflow — a Sensor that fires
broadly and relies on the first Workflow step to check "is this event
actually relevant" wastes Pods and obscures why a Workflow ran at all.Sensor's triggering ServiceAccount to only the specific
namespace/resource kinds its triggers need to create — a Sensor
authorized to create arbitrary cluster resources is a lateral-movement
risk if the event source itself is ever spoofable.EventSource types (GitHub, GitLab, Stripe, etc.) with
their built-in signature/secret verification rather than the generic
webhook type whenever the origin supports it — the generic webhook type
has no built-in authenticity check, so anyone who can reach the
endpoint can forge events unless you add your own verification.EventBus sized (nats.native.replicas) for the actual event
throughput and durability needs — a single-replica EventBus is a
single point of failure for every Sensor depending on it in that
namespace.conditions (multi-dependency correlation) rather than chaining
separate Sensors with ad hoc state (a ConfigMap flag one Sensor sets
and another polls) when a trigger genuinely depends on multiple prior
events — the built-in correlation window is simpler and more reliable
than home-rolled coordination.EventSource/Sensor/EventBus manifests
the same as any other cluster resource — treat them as part of the
GitOps-tracked config repo, not a one-off kubectl apply nobody
remembers making.Symptom: An external webhook provider shows the delivery as
successful (200 response), but no Sensor trigger ever fires.
Fix: Check the Sensor's dependencies.filters first — a common
cause is a filter path/comparator that doesn't match the actual event
payload shape (e.g., expecting body.detail.object.key but the real
payload nests it under body.Records[0].s3.object.key). Inspect the
raw event via the EventSource Pod logs to confirm the actual payload
structure before assuming the Sensor itself is broken.
Symptom: A Sensor trigger fires but the target Workflow never
gets created, with no obvious error in the EventSource logs.
Fix: Check the Sensor Pod's own logs and kubectl describe sensor — this is almost always an RBAC denial (the Sensor's
ServiceAccount lacks permission to create Workflow resources in the
target namespace) or a malformed argoWorkflow.source.resource
template, both of which surface in the Sensor's logs, not the
EventSource's.
Symptom: A single upstream event (e.g., one S3 upload) triggers the downstream Workflow multiple times. Fix: Check whether the underlying message queue's delivery semantics are at-least-once (SQS, most Kafka configurations) — Argo Events does not deduplicate by default. Either make the triggered Workflow idempotent (safe to run twice on the same input) or add a dedup filter keyed on a stable event ID if true single-delivery semantics are required.
Symptom: A Sensor with a multi-dependency conditions expression
never fires even though both source events clearly occurred (visible in
each EventSource's logs).
Fix: Multi-dependency correlation has a bounded time window; if the
two events arrive further apart than the Sensor's correlation logic
tolerates (or across a Sensor Pod restart, since in-memory correlation
state may not survive it depending on version/config), the condition
never becomes true. Confirm event arrival timing and consider whether
the two events are actually expected to arrive close enough together
for correlation to be the right pattern versus a stateful Workflow
step that waits on both explicitly.
Symptom: A generic webhook EventSource is receiving forged/
spoofed events from outside the expected origin, triggering unwanted
Workflow runs.
Fix: The generic webhook EventSource type has no built-in
signature verification. Migrate to the origin's dedicated EventSource
type (e.g., github with a configured webhook secret) which validates
a signature header before the event is even considered, or add an
authenticating proxy/Ingress rule in front of the generic webhook
endpoint.
Scenario: A file landing in an S3 bucket should trigger the
nightly-etl WorkflowTemplate (from
argo-workflows-pipeline-design),
but only for .parquet files, and only after a separate validation
webhook confirms the file passed a checksum check.
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: s3-notifications
namespace: automation
spec:
sqs:
upload-queue:
region: us-east-1
queue: <SQS_QUEUE_NAME>
accessKey: { name: aws-credentials, key: access-key }
secretKey: { name: aws-credentials, key: secret-key }
---
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: validation-webhook
namespace: automation
spec:
service:
ports: [{ port: 12001, targetPort: 12001 }]
webhook:
validation-complete:
port: "12001"
endpoint: /validation-complete
method: POST
---
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: upload-processor
namespace: automation
spec:
eventBusName: default
dependencies:
- name: upload-dep
eventSourceName: s3-notifications
eventName: upload-queue
filters:
data:
- path: body.detail.object.key
type: string
comparator: "="
value: ["*.parquet"]
- name: validate-dep
eventSourceName: validation-webhook
eventName: validation-complete
filters:
data:
- path: body.status
type: string
comparator: "="
value: ["passed"]
triggers:
- template:
name: start-etl-workflow
conditions: "upload-dep && validate-dep"
argoWorkflow:
operation: submit
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata: { generateName: etl-from-upload- }
spec:
workflowTemplateRef: { name: nightly-etl }
arguments:
parameters:
- name: object-key
value: "{{upload-dep.body.detail.object.key}}"
Only when both upload-dep (a .parquet object key) and validate-dep
(status: passed) have each delivered a matching event does conditions: "upload-dep && validate-dep" become true and the nightly-etl Workflow
gets submitted — a non-parquet upload or a failed validation never
triggers the pipeline, and kubectl describe sensor upload-processor -n automation shows exactly which dependency is still pending if the
Workflow doesn't start when expected.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
argo-events, event-driven-automation, kubernetes, gitops, event-sources, sensors
11 skills in this plugin
/argocd-application-configurationConfigures Argo CD `Application` custom resources — sync policies (automated vs. manual, prune, self-heal), sync waves and hooks for ordered/multi-phase rollouts, and health checks for custom resource types. Use when the user asks to "write an Argo CD Application manifest," "enable auto-sync / self-heal / prune," "order resources with sync waves," "add a PreSync/PostSync hook," "fix an Application stuck OutOfSync or Progressing," or "define a custom health check for a CRD Argo CD doesn't understand natively."
/argocd-applicationset-patternsDesigns Argo CD `ApplicationSet` resources that template many `Application` objects from a single source using generators — List, Cluster, Git directory/file, and Matrix (combined generators). Use when the user asks to "generate an Application per cluster/environment/ directory," "avoid copy-pasting Argo CD Applications," "roll out a service to a fleet of clusters," "combine a cluster generator with a Git generator," or "debug an ApplicationSet producing unexpected or missing Applications."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin gitops-argo-skillsOther plugins' skills for the same job