This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.6.2.2. Knative Kafka 的安全配置
Kafka 集群通常使用 TLS 或 SASL 身份验证方法进行保护。您可以使用 TLS 或 SASL 将 Kafka 代理或频道配置为针对受保护的 Red Hat AMQ Streams 集群进行操作。
注意
红帽建议您同时启用 SASL 和 TLS。
6.2.2.1. 为 Kafka 代理配置 TLS 身份验证 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Apache Kafka 客户端和服务器使用 传输层安全性 (TLS)来加密 Knative 和 Kafka 之间的流量,以及用于身份验证。TLS 是 Knative Kafka 唯一支持的流量加密方法。
先决条件
- 在 OpenShift Container Platform 上具有集群管理员权限。
-
OpenShift Serverless Operator、Knative Eventing 和
KnativeKafka
CR 已安装在 OpenShift Container Platform 集群中。 - 您已创建了一个项目,或者具有适当的角色和权限访问项目,以便在 OpenShift Container Platform 中创建应用程序和其他工作负载。
-
您有一个 Kafka 集群 CA 证书存储为一个
.pem
文件。 -
您有一个 Kafka 集群客户端证书,并存储为
.pem
文件的密钥。 -
安装 OpenShift CLI(
oc
)。
流程
在
knative-eventing
命名空间中创建证书文件作为 secret:oc create secret -n knative-eventing generic <secret_name> \ --from-literal=protocol=SSL \ --from-file=ca.crt=caroot.pem \ --from-file=user.crt=certificate.pem \ --from-file=user.key=key.pem
$ oc create secret -n knative-eventing generic <secret_name> \ --from-literal=protocol=SSL \ --from-file=ca.crt=caroot.pem \ --from-file=user.crt=certificate.pem \ --from-file=user.key=key.pem
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 重要使用密钥名称
ca.crt
、user.crt
和user.key
。不要更改它们。编辑
KnativeKafka
CR,并在broker
spec 中添加对 secret 的引用:Copy to Clipboard Copied! Toggle word wrap Toggle overflow