【发布时间】:2019-09-12 17:54:21
【问题描述】:
我正在尝试使用 SASL 对我的 Kafka 休息代理进行身份验证,但我无法将本地 docker compose 中的配置传输到 Kubernetes。
我正在使用 JAAS 配置来实现这一点。 我的 JAAS 文件如下所示。
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="rest"
password="rest-secret";
};
Client {
org.apache.zookeeper.server.auth.DigestLoginModule required
username="rest"
password="restsecret";
};
然后在我的 docker compose 中我已经完成了:
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/rest_jaas.conf
如何将相同的逻辑转移到 Kubernetes? 我试过像这样传递 env 变量:
env:
- name: KAFKA_OPTS
value: |
KafkaClient {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="rest"
password="rest-secret";
};
Client {
org.apache.zookeeper.server.auth.DigestLoginModule required
username="rest"
password="rest-secret";
};
但它仍然失败。这是我的日志所说的:
Error: Could not find or load main class KafkaClient
/bin/sh: 3: org.apache.kafka.common.security.plain.PlainLoginModule: not found
/bin/sh: 6: Syntax error: "}" unexpected
我们将非常感谢您的帮助。
【问题讨论】:
标签: docker kubernetes apache-kafka docker-compose