title: Kerberos Auth With SparkLauncher - "Cannot locate KDC" Error
body: <p>We are trying to move from using spark-submit to a programmatic solution using SparkLauncher (Spark 2.4 running on Cloudera Hadoop), and have encountered this problem:</p>
  <pre><code>Exception javax.security.auth.login.LoginException: Cannot locate KDC 
  </code></pre>
  <p>on the error output stream of a job process after calling startApplication().</p>
  <p>The launcher is configured with the same settings as spark-submit, including setting &quot;spark.kerberos.principal&quot; and &quot;spark.kerberos.keytab&quot; (also tried using the spark.yarn prefix, and setting --principle and --keytab with setSparkArg() as well - but these properties are not the issue).</p>
  <p>Even though krb5.conf is in the default location on all machines and the driver, I tried setting</p>
  <pre><code>.setConf(&quot;spark.executor.extraJavaOptions&quot;, &quot;-Djava.security.krb5.conf=/etc/krb5.conf&quot;)
  .setConf(&quot;spark.driver.extraJavaOptions&quot;, &quot;-Djava.security.krb5.conf=/etc/krb5.conf&quot;)
  </code></pre>
  <p>as well, with the same result.</p>
  <p>There are no other auth/kerberos-related conf settings with the spark-submit call (only principal and keytab are set), and all other conf settings are replicated on the Launcher.</p>
  <p>The output from SparkLauncher confirms all Spark properties are set as expected.</p>
  <p>&quot;Cannot locate KDC&quot; indicates that the krb5.conf file is not found, but how can this be if it's in the default location and spark-submit evidently finds it?</p>