Version/Environment (if relevant):
Applies to all versions of Domino.Issue:
When using Kerberos authentication with PySpark in a Domino Spark cluster to connect to a SQL Server, the following errors are encountered:kinit in the Spark driver (workspace) succeeds, and the token is visible via klist in the workspace logs:
klist fails on the executor Spark worker pods with the following error:
Root Cause:
There are two root causes:- Setting environment variables via
spark.executorEnv.ENVNAMEdoes not work. Environment variables must be set usingENVin the cluster environment’s Dockerfile. - When setting multiple
extraJavaOptionsparameters with one line per option, only the last parameter is applied at runtime — each new line overwrites the previous one.
Resolution:
1. Dockerfile Instructions Set the following environment variables in the executor cluster environment’s Dockerfile:ENV KRB5CCNAME=FILE:/mnt/data/workspace_name/krb5cc_12345ENV KRB5_CONFIG=/mnt/data/workspace_name/krb5.conf
ccache directory to a shared directory accessible by both the driver and executors, allowing executors to read the ccache generated by the driver during pre-run. Setting KRB5CCNAME via spark.executorEnv.KRB5CCNAME or any other method will not work — executors will always fall back to the default location /tmp/krb5cc_12345. Use ENV instead of ARG when setting KRB5_CONFIG.
2. Pre-Run Script
Run kinit in the Spark driver’s environment Pre-Run script to generate and cache the Kerberos token on the dataset so that executors can use it for authentication.
3. extraJavaOptions Parameters
Under Project Settings > Integrations > Apache Spark mode > Spark Configuration Options, setting multiple extraJavaOptions with one line per parameter will not work, as each line overwrites the previous:
spark.driver.extraJavaOptions parameters into a single line, separated by spaces:
Notes/Information:
Additional resources:- Apache Spark 3.0 — Kerberos ticket cache: By setting
spark.kerberos.renewal.credentialstoccache, the local Kerberos ticket cache will be used for authentication. The location can be customized via theKRB5CCNAMEenvironment variable. - Spark on Domino — Configure Prerequisites: Configure PySpark compute environments for workspaces and/or jobs connecting to your cluster.
- Domino Kerberos Authentication: Domino supports keytab-based Kerberos authentication at the project or user level. Once configured, runs will automatically execute
kinitand retrieve the ticket for authentication.