Github user mccheah commented on a diff in the pull request: https://github.com/apache/spark/pull/20669#discussion_r174638065 --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientApplication.scala --- @@ -180,6 +184,31 @@ private[spark] class Client( originalMetadata.setOwnerReferences(Collections.singletonList(driverPodOwnerReference)) } } + + // Build a Config Map that will house both the properties and the java options in a single file + private def buildConfigMap( + configMapName: String, + conf: SparkConf, + driverJavaOps: String): ConfigMap = { + val properties = new Properties() + conf + .remove(org.apache.spark.internal.config.DRIVER_JAVA_OPTIONS) + .getAll.foreach { case (k, v) => + properties.setProperty(k, v) + } + val propertiesWriter = new StringWriter() + properties.store(propertiesWriter, + s"Java properties built from Kubernetes config map with name: $configMapName") + + val namespace = conf.get(KUBERNETES_NAMESPACE) + new ConfigMapBuilder() + .withNewMetadata() + .withName(configMapName) + .withNamespace(namespace) + .endMetadata() + .addToData(SPARK_CONF_FILE_NAME, propertiesWriter.toString + driverJavaOps) --- End diff -- Ah I think I was misreading the code here - just putting `spark.driver.extraJavaOptions` in the properties works. See https://github.com/apache/spark/blob/cfcd746689c2b84824745fa6d327ffb584c7a17d/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java#L268 Sorry about that - @ifilonenko think just adding `spark.driver.extraJavaOptions` as-is to the properties file will suffice.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org