【问题标题】:How to connect Apache Spark to Cassandra cluster over SSL in Kubernetes如何在 Kubernetes 中通过 SSL 将 Apache Spark 连接到 Cassandra 集群
【发布时间】:2021-02-23 14:25:02
【问题描述】:

我们在一个部署在裸机/VM 上的应用程序中使用 Spark 和 Cassandra。为了将 Spark 连接到 Cassandra,我们使用以下属性来启用 SSL:

spark.cassandra.connection.ssl.keyStore.password
spark.cassandra.connection.ssl.keyStore.type
spark.cassandra.connection.ssl.protocol
spark.cassandra.connection.ssl.trustStore.path
spark.cassandra.connection.ssl.trustStore.password
spark.cassandra.connection.ssl.trustStore.type
spark.cassandra.connection.ssl.clientAuth.enabled

现在我正在尝试在 Kubernetes 中迁移相同的应用程序。我有以下问题:

  1. 是否需要更改上述属性才能将 spark 连接到 Kubernetes 中的 Cassandra 集群?
  2. 以上属性会起作用还是我错过了什么?
  3. 谁能指出一些可以帮助我的文档或链接?

【问题讨论】:

    标签: apache-spark ssl kubernetes spark-cassandra-connector


    【解决方案1】:

    是的,当您在 Kubernetes 上运行作业时,这些属性将继续起作用。您唯一需要考虑的是名称以.path 结尾的所有属性都需要指向具有信任和密钥存储的实际文件。在 Kubernetes 上,您需要注意将它们公开为秘密,mounted as files。首先,您需要创建一个秘密,如下所示:

    apiVersion: v1
    data:
     spark.truststore:  base64-encoded truststore
    kind: Secret
    metadata:
     name: spark-truststore
    type: Opaque
    

    然后在规范中,指向它:

        spec:
          containers:
          - image: nginx
            name: nginx
            volumeMounts:
              - mountPath: "/some/path"
                name: spark-truststore
                readOnly: true
          volumes:
            - name: spark-truststore
              secret:
                secretName: spark-truststore
    

    并将配置选项指向给定路径,例如:/some/path/spark.truststore

    【讨论】:

      猜你喜欢
      • 2015-06-15
      • 2019-03-11
      • 2021-02-10
      • 2013-10-24
      • 2023-03-14
      • 2021-12-16
      • 1970-01-01
      • 1970-01-01
      • 2018-12-30
      相关资源
      最近更新 更多