Setting Custom TrustStore

This topic describes how to set custom trustStore for SSL encryption using Spark Operator.

A Java trustStore is a repository to store the certificates from Certified Authorities (CA). CA verifies the certificate presented by the server in an SSL connection.

To set the custom trustStore, add the following configuration options to driver and executor options of spec section of the Spark application configuration:
driver:
  javaOptions: "-Djavax.net.ssl.trustStore=<path-to-custom-trustStore>"
  volumeMounts:
    - name: truststore
      mountPath: <path-to-custom-truststore>
executor:
  javaOptions: "-Djavax.net.ssl.trustStore=<path-to-custom-trustStore>"
  volumeMounts:
    - name: truststore
      mountPath: <path-to-custom-truststore>
The sample path to custom trustStore is /opt/mapr/spark/spark-3.1.2/truststore.
For example: To access the Amazon S3 buckets using SSL, you must add the following configuration options in the spec section of the Spark application configuration. The default Java trustStore /etc/pki/java/cacerts contains Amazon CA.
driver:
  javaOptions: "-Djavax.net.ssl.trustStore=/etc/pki/java/cacerts"
executor:
  javaOptions: "-Djavax.net.ssl.trustStore=/etc/pki/java/cacerts"