【问题标题】:Kafka Strimzi on AKS: How to config PLAIN listeners when external listeners(ScramSha512, TLS encryption) & ACL is already configuredAKS 上的 Kafka Strimzi:如何在外部侦听器(ScramSha512、TLS 加密)和 ACL 已配置时配置 PLAIN 侦听器
【发布时间】:2020-11-27 13:57:22
【问题描述】:

我已经按如下方式配置了外部侦听器和 ACL(这些都是功能性的)

listeners:
 plain: {}
 external:
  type: loadbalancer
  tls: true
  authentication:
   type: scram-sha-512
authorization:
 type: simple

这托管在 AKS 群集上。从本地消费它确实已经工作并且也从集群内部生产,但使用 publicIP:9094 作为引导服务器。

我想在集群中添加一个生产者并使用 9092 端口(我想像这个 BootstrapServers = "my-cluster-kafka-bootstrap:9092"),但需要付出最少的努力(即使可能没有 ACL,也没有任何身份验证,没有任何加密)。

有什么推荐的?

提前谢谢你!

【问题讨论】:

    标签: apache-kafka strimzi


    【解决方案1】:

    感谢来自 Strimzi https://github.com/scholzj 的 Jakub,这是最小的配置

    listeners:
      plain:
        authentication:
          type: scram-sha-512
      external:
        type: loadbalancer
        tls: true
        authentication:
          type: scram-sha-512
    authorization:
      type: simple
    

    C# 客户端看起来像这样

            var conf = new ProducerConfig
            {
                BootstrapServers = "my-cluster-kafka-bootstrap:9092",
                SecurityProtocol = SecurityProtocol.SaslPlaintext,
                SaslMechanism = SaslMechanism.ScramSha512,
                SaslUsername = "admin",
                SaslPassword = "xxx",
            };
    

    解释是:

    Kafka 整个集群只有一个授权配置。所以 它对所有听众都打开或关闭。普通的听众是 没有加密,但如果您需要外部授权 侦听器,您将需要在那里启用身份验证(因为没有 身份验证授权将拒绝一切)。

    【讨论】:

      猜你喜欢
      • 2016-06-14
      • 2017-08-17
      • 2021-11-12
      • 2011-08-16
      • 2014-03-29
      • 2013-11-07
      • 2021-12-01
      • 1970-01-01
      • 2021-02-09
      相关资源
      最近更新 更多