Redis¶
Redis event-source subscribes to Redis publisher and helps sensor trigger workloads.
Event Structure¶
The structure of an event dispatched by the event-source over the eventbus looks like following,
{
"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": {
"channel": "Subscription channel",
"pattern": "Message pattern",
"body": "message body" // string
}
}
Specification¶
Redis event-source specification is available here.
Setup¶
-
Follow the documentation to set up Redis database.
-
Create the event source by running the following command.
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/redis.yaml
-
Create the sensor by running the following command.
kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/redis.yaml
-
Log into redis pod using
kubectl
.kubectl -n argo-events exec -it <redis-pod-name> -c <redis-container-name> -- /bin/bash
-
Run
redis-cli
and publish a message onFOO
channel.PUBLISH FOO hello
-
Once a message is published, an argo workflow will be triggered. Run
argo list
to find the workflow.
Troubleshoot¶
Please read the FAQ.