如何在 K8ssandra 中為 Cassandra 配置節點間加密(即 TLS)?
uj5u.com熱心網友回復:
K8ssandra 1.4.0 包含一些應該可以配置 TLS 的更改。作為參考,這是ticket,這是對應的PR。
有一個圖表屬性,cassandraYamlConfigMap您可以使用它指定一個包含您的自定義的 ConfigMap cassandra.yaml。您提供的屬性將與 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。
下面是一個包含我的自定義 cassandra.yaml 的 ConfigMap 示例:
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: cassandra
K8ssandra 使用Cass Operator來管理 Cassandra。考慮到這一點,我推薦以下內容以供進一步閱讀:
- 該文章涵蓋配置TLS的CASS-運營管理集群中使用證書管理器。
- 此票證詳細說明了 Cass Operator 如何配置節點間加密。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/407248.html
標籤:
上一篇:集群不允許從容器注冊表中提取影像
