github.com/argoproj/argo-events@v1.9.1/docs/eventsources/setup/redis.md (about)

     1  # Redis
     2  
     3  Redis event-source subscribes to Redis publisher and helps sensor trigger workloads.
     4  
     5  ## Event Structure
     6  
     7  The structure of an event dispatched by the event-source over the eventbus looks like following,
     8  
     9          {
    10              "context": {
    11                "type": "type_of_event_source",
    12                "specversion": "cloud_events_version",
    13                "source": "name_of_the_event_source",
    14                "id": "unique_event_id",
    15                "time": "event_time",
    16                "datacontenttype": "type_of_data",
    17                "subject": "name_of_the_configuration_within_event_source"
    18              },
    19              "data": {
    20                 "channel": "Subscription channel",
    21                 "pattern": "Message pattern",
    22                 "body": "message body" // string
    23              }
    24          }
    25  
    26  ## Specification
    27  
    28  Redis event-source specification is available [here](https://github.com/argoproj/argo-events/blob/master/api/event-source.md#argoproj.io/v1alpha1.RedisEventSource).
    29  
    30  ## Setup
    31  
    32  1. Follow the [documentation](https://kubernetes.io/docs/tutorials/configuration/configure-redis-using-configmap/#real-world-example-configuring-redis-using-a-configmap) to set up Redis database.
    33  
    34  1. Create the event source by running the following command.
    35  
    36          kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/event-sources/redis.yaml
    37  
    38  1. Create the sensor by running the following command.
    39  
    40          kubectl apply -n argo-events -f https://raw.githubusercontent.com/argoproj/argo-events/stable/examples/sensors/redis.yaml
    41  
    42  1. Log into redis pod using `kubectl`.
    43  
    44          kubectl -n argo-events exec -it <redis-pod-name> -c <redis-container-name> -- /bin/bash
    45  
    46  1. Run `redis-cli` and publish a message on `FOO` channel.
    47  
    48          PUBLISH FOO hello
    49  
    50  1. Once a message is published, an argo workflow will be triggered. Run `argo list` to find the workflow.
    51  
    52  ## Troubleshoot
    53  
    54  Please read the [FAQ](https://argoproj.github.io/argo-events/FAQ/).