如何在K8ssandra中为Cassandra配置节点间加密(即TLS)?
发布于 2022-01-06 16:24:07
K8ssandra 1.4.0包含了一些应该可以配置TLS的更改。作为参考,这是票证,这是对应的按下。
有图表属性cassandraYamlConfigMap,您可以用它指定包含自定义cassandra.yaml的ConfigMap。您提供的属性将与k8ssandra生成的属性合并,优先考虑您的属性。
注意,您的cassandra.yaml不需要是一个完整的配置文件。只指定您感兴趣的属性就足够了,因为它将与K8ssandra生成的基于配置文件合并。
由于需要指定密钥库和信任库机密,因此需要为节点间加密和客户端加密提供一些附加属性,以便可以创建卷挂载。请注意,您需要预先创建密钥库和信任库机密。
请参阅新图表属性这里的内联文档。
下面是一个演示新属性的示例图表属性文件:
cassandra:
version: 4.0.1
cassandraYamlConfigMap: cassandra-config
encryption:
keystoreSecret: keystore
keystoreMountPath: /mnt/keystore
truststoreSecret: truststore
truststoreMountPath: /mnt/truststore
heap:
size: 512M
datacenters:
- name: dc1
size: 1关于图表属性有几点需要注意。首先,keystoreSecret和truststoreSecret引用了应该存在于安装k8ssandra的同一个命名空间中的秘密。用户应该在安装(或升级k8ssandra)之前创建这些秘密。
其次,keystoreMountPath和truststoreMountPath指定这些秘密应该安装在卡桑德拉吊舱中的位置。必须指定这些属性,并且必须与cassandra.yaml中指定的属性匹配。
下面是一个包含自定义ConfigMap的cassandra.yaml示例:
apiVersion: v1
kind: ConfigMap
metadata:
name: cassandra-config
data:
cassandra.yaml: |-
server_encryption_options:
internode_encryption: all
keystore: /mnt/keystore/keystore.jks
keystore_password: cassandra
truststore: /mnt/truststore/truststore.jks
truststore_password: cassandraK8ssandra使用Cass算子来管理卡桑德拉。考虑到这一点,我建议进一步阅读以下内容:
https://stackoverflow.com/questions/70610253
复制相似问题