如何将 knative-eventing 连接到 RabbitMQ 外部源

问题描述 投票:0回答:4

我正在尝试将 Knative 与 Kubernetes 集群外的现有 RabbitMQ 队列连接,但在测试和查看文档后我不确定这是否可以完成,有没有人知道如何将 Knative-eventing 与外部 RabbitMQ 作为消息一起使用来源?

问候!

rabbitmq knative knative-eventing
4个回答
1
投票

Knative Eventing 源代码目录 中所列,社区正在开发和维护 RabbitMQ 源代码(主要是来自 VMware 和 RabbitMQ 团队的贡献者)。

文档和安装说明在这里;如果有错误,请在相关的回购中报告它们。


1
投票

嘿@Juan 你对我们的文档完全正确,在这里我将在审查和合并时留下一个 PR 修复它们的一部分,并提供一个关于使用外部 RabbitMQ 实例的清晰示例: https://github.com/knative-sandbox/eventing-rabbitmq/pull/786/files#diff-4fdb9e4eb3a1c9da58e4445d94aa5ce4573b5c8d005f20c41c767b07c09a2418

希望这有帮助 =),感谢您的反馈! 如果你发现任何不对的地方,你可以在 PR 上发表评论或在这里留言!


0
投票

谢谢@sameer 的回答,我想我没有正确理解你。

访问您给我的链接后,我启动了:

kubectl apply --filename https://github.com/knative-sandbox/eventing-rabbitmq/releases/latest/download/rabbitmq-source.yaml

要安装 rabbitmq 源并生成秘密:

kubectl create secret generic rabbitmqc-default-user -n knative-eventing --from-literal=user=root --from-file=password=/tmp/password

以及以下资源:

apiVersion: sources.knative.dev/v1alpha1
kind: RabbitmqSource
metadata:
  name: rabbitmq-source
  namespace: knative-eventing
spec:
  broker: "host.external.dns:5671/"
  connectionSecret:
    name: "rabbitmqc-default-user"
  user:
    secretKeyRef:
      name: "rabbitmqc-default-user"
      key: "username"
  password:
    secretKeyRef:
      name: "rabbitmqc-default-user"
      key: "password"
  exchangeConfig:
    name: "logs"
    type: "fanout"
    durable: true
    autoDelete: false
  queueConfig:
    name: "test"
    routingKey: ""
    durable: false
    autoDelete: false
  channelConfig:
    parallelism: 10
  sink:
    ref:
      apiVersion: v1
      kind: Service
      name: recorder

但是在生成资源后我得到了这些错误:

knative-sources/rabbitmq-controller-manager

│ W0524 11:45:04.108665       1 reflector.go:324] k8s.io/[email protected]/tools/cache/reflector.go:167: failed to list *v1beta1.Binding: the server could not find the requested resource (get bindings.rabbitmq.com)                                                                   │
│ E0524 11:45:04.108718       1 reflector.go:138] k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1beta1.Binding: failed to list *v1beta1.Binding: the server could not find the requested resource (get bindings.rabbitmq.com)                                 │
│ W0524 11:45:04.109915       1 reflector.go:324] k8s.io/[email protected]/tools/cache/reflector.go:167: failed to list *v1beta1.Queue: the server could not find the requested resource (get queues.rabbitmq.com)                                                                       │
│ E0524 11:45:04.109935       1 reflector.go:138] k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1beta1.Queue: failed to list *v1beta1.Queue: the server could not find the requested resource (get queues.rabbitmq.com)                                       │
│ W0524 11:45:04.109976       1 reflector.go:324] k8s.io/[email protected]/tools/cache/reflector.go:167: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                                                                 │
│ E0524 11:45:04.109985       1 reflector.go:138] k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1beta1.Exchange: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                              │
│ W0524 11:45:05.253806       1 reflector.go:324] k8s.io/[email protected]/tools/cache/reflector.go:167: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                                                                 │
│ E0524 11:45:05.254035       1 reflector.go:138] k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1beta1.Exchange: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                              │
│ W0524 11:45:05.443628       1 reflector.go:324] k8s.io/[email protected]/tools/cache/reflector.go:167: failed to list *v1beta1.Queue: the server could not find the requested resource (get queues.rabbitmq.com)

事实是,我已经搜索和搜索并没有找到关于如何将它连接到外部 RabbitMQ 到 Kubernetes 的信息,也许我没有很好地理解文档。


0
投票

这个报错说明当前k8s集群没有安装xxx.rabbitmq.com CRD

│ W0524 11:45:04.109915 1 reflector.go:324] k8s.io/[email protected]/tools/cache/reflector.go:167: 无法列出 *v1beta1.Queue: 服务器找不到请求的资源(get queues.rabbitmq.com)│

您需要安装 RabbitQA messaging-topology-operator 以添加缺少的 CRDS

文档中所述

注意:可以使用外部 RabbitMQ 实例,但如果你想 使用没有预先声明资源的源(特别是 Exchange and Queue),RabbitMQ Message Topology Operator 需要 与源安装在同一个 Kubernetes 集群中。

按照这个命令:

kubectl apply -f https://github.com/rabbitmq/messaging-topology-operator/releases/latest/download/messaging-topology-operator-with-certmanager.yaml
© www.soinside.com 2019 - 2024. All rights reserved.