【问题标题】:Integrating Hono and Enmasse整合 Hono 和 Enmasse
【发布时间】:2021-04-27 10:52:47
【问题描述】:

我正在尝试使用 enmasse 部署 hono。为此,我已经安装了 enmasse 并在 repository 之后创建了地址空间和地址。

如 artifacthub 上的 hono-doc 所述。首先我创建了一个秘密。

my_secret.yaml

apiVersion: v1
kind: Secret
metadata:
  name: mysecret
stringData:
  amqp-credentials.properties: |
    username: hono
    password: HONO

并将其应用到荣誉命名空间:

kubectl apply -f ./hono/my_secret.yaml -n hono

之后,我创建了自己的 values.yaml 文件来覆盖 hono 默认值, 如"Integrating with an existing AMQP Messaging Network" 中所述。

my_values.yaml

amqpMessagingNetworkExample:
  enabled: false

adapters:
  extraSecretMounts:
  - amqpNetwork:
      secretName: "mysecret"
      mountPath: "/etc/custom"

  amqpMessagingNetworkSpec:
    host: messaging-5355a0a.enmasse-infra
    port: 5672
    credentialsPath: /etc/custom/amqp-credentials.properties

  commandAndControlSpec:
    host: messaging-5355a0a.enmasse-infra
    port: 5672
    credentialsPath: /etc/custom/amqp-credentials.properties

  amqp:
    enabled: false

deviceRegistryExample:
  enabled: true
  type: mongodb
  addExampleData: false

mongodb:
  createInstance: true

grafana:
  enabled: false

prometheus:
  createInstance: false

至少我用以下方式安装了hono:

helm install -n hono -f ./hono/my_values.yaml c2e eclipse-iot/hono

但不幸的是,我收到错误并且 pod 运行不正常,特别是我从所有尝试连接到 enmasse-Amqp 网络的 pod 中收到这些错误:

  1. 安装错误:秘密文件“amqp-credentials.properties”未安装: pod 的日志文件显示“没有这样的文件或目录”:

10:47:45.645 [vert.x-eventloop-thread-0] 警告 o.e.h.config.ClientConfigProperties - 无法加载客户端 [messaging-5355a0a.enmasse-infra:5672,角色:命令和 控制]来自文件 [/etc/custom/amqp-credentials.properties] java.io.FileNotFoundException:/etc/custom/amqp-credentials.properties (没有这样的文件或目录)

  1. 错误的 AMQP 连接:出于某种原因,所有 pod 都尝试通过“amqps”连接到 enmasse,尽管我明确表示他们应该通过端口号使用“amqp”而不提供 crt-keys!我错了吗?

我在这里做错了什么?

另外,如果有人能提供一个示例性的“Hono+Enmasse”集成存储库,那就太好了。

谢谢

【问题讨论】:

    标签: amqp eclipse-hono eclipse-iot


    【解决方案1】:

    您不能在adapters 级别指定额外的秘密挂载。您需要为 each 适配器单独指定 extraSecretMounts 属性,例如对于 HTTP 和 MQTT 适配器:

    adapters:
      http:
        extraSecretMounts:
          amqpNetwork:
            secretName: "mysecret"
            mountPath: "/etc/custom"
      mqtt:
        extraSecretMounts:
          amqpNetwork:
            secretName: "mysecret"
            mountPath: "/etc/custom"
    

    还要注意extraSecretMounts 值不是数组而是对象,即amqpNetwork 属性之前不能有- 字符。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-10
      • 1970-01-01
      • 1970-01-01
      • 2017-09-16
      • 2019-10-11
      • 1970-01-01
      相关资源
      最近更新 更多