'AMQP - Argo-events: argo-workflow not triggered

I am trying to run an argo-workflow triggered by event-source that listens to messages published on RabbitMQ. I followed the exact steps in here: AMQP-Argo Events

The RabbitMQ controller pod is running:

eventbus-controller-7b5bd8b7fd-nggrc      1/1     Running   0          4h24m
events-webhook-6d4dc5b476-fnf6x           1/1     Running   0          4h24m
eventsource-controller-57b6cff5c8-xhfwd   1/1     Running   0          4h24m
rabbitmq-controller-949wp                 1/1     Running   0          178m
sensor-controller-6f5b54468-8ndft         1/1     Running   0          4h24m

When I publish a message on the exchange test using:

import pika
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
channel.basic_publish(exchange='test',
                      routing_key='hello',
                      body='{"message": "hello"}')

and log into the pod using

kubectl logs pod/<RABBITMQ-CONTROLLER-POD> -n argo-events

I get

2021-09-01 22:58:56.437190+00:00 [info] <0.3934.0> accepting AMQP connection <0.3934.0> (127.0.0.1:58396 -> 127.0.0.1:5672)
2021-09-01 22:58:56.442906+00:00 [info] <0.3934.0> connection <0.3934.0> (127.0.0.1:58396 -> 127.0.0.1:5672): user 'guest' authenticated and granted access to vhost '/'

Howerver I do not see any workflow listed when I view the workflows using

argo list -n argo-events

So it seems that the sensor is not triggered. Can someone suggest what I might be doing wrong?

Thanks!



Solution 1:[1]

I can only suggest (as someone who is still working on a basic dev implementation) to check that the template/example files are setup with appropriate credentials and service accounts - I was similarly baffled for a bit when I could not get the resource trigger working.

EDIT: You should also verify that the sensor has an appropriate service account (see https://argoproj.github.io/argo-events/service-accounts/), e.g.

apiVersion: v1
kind: ServiceAccount
metadata:
  name: operate-workflow-sa
---
# Similarly you can use a ClusterRole and ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: operate-workflow-role
rules:
  - apiGroups:
      - argoproj.io
    verbs:
      - "*"
    resources:
      - workflows
      - workflowtemplates
      - cronworkflows
      - clusterworkflowtemplates
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: operate-workflow-role-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: operate-workflow-role
subjects:
  - kind: ServiceAccount
    name: operate-workflow-sa

source: https://argoproj.github.io/argo-events/quick_start/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1