rabbitmq AMQP -Argo事件:未触发argo-workflow

4ktjp1zp  于 2022-11-08  发布在  RabbitMQ
关注(0)|答案(1)|浏览(184)

我正在尝试运行一个由事件源触发的argo-workflow,它监听RabbitMQ上发布的消息。我按照下面的步骤操作:AMQP-Argo Events
RabbitMQ控制器pod正在运行:

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

当我在Exchange上发布消息时,测试使用:

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

并使用以下命令登录Pod

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

我得到

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 '/'

但是,当我使用查看工作流时,没有看到列出任何工作流

argo list -n argo-events

所以看起来传感器没有被触发。有人能建议我可能做错了什么吗?
谢谢你!

yxyvkwin

yxyvkwin1#

我只能建议(作为一个仍在进行基本开发实现的人)检查模板/示例文件是否设置了适当的凭据和服务帐户a-当我无法使资源触发器工作时,我也同样感到困惑。
编辑:您还应验证传感器是否具有适当的服务帐户(请参阅https://argoproj.github.io/argo-events/service-accounts/),例如

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

来源:https://argoproj.github.io/argo-events/quick_start/

相关问题