title: SparkConf as Kubernetes ConfigMap
body: <p>I am playing with the <a href="https://github.com/GoogleCloudPlatform/spark-on-k8s-operator" rel="nofollow noreferrer">spark-on-k8s-operator</a>. I wondered upfront if anyone has good examples/manifests for providing spark conf via Kubernetes ConfigMaps?</p>
  
  <p>Appreciate some pointers.</p>
  
  <p>For now, I am using:<code>import com.typesafe.config.{Config, ConfigFactory}</code> and an explicit <code>application.conf</code> file in <code>src/main/resources</code></p>
  
  <pre><code>  @transient lazy val logger: Logger = LoggerFactory.getLogger(getClass)
    val config: Config                 = ConfigFactory.parseResources("application.conf")
    config.checkValid(ConfigFactory.defaultReference(), topicName)
    private val source: String = config.getString(s"${topicName}.source")
    private val topic: String =
      config.getString(s"${topicName}.topic")
    private val brokers: String =
      config.getString(s"${topicName}.kafka_bootstrap_servers")
    private val offsets: String =
      config.getString(s"${topicName}.auto_offset_reset")
    private val failOnLoss: String =
      config.getString(s"${topicName}.fail_on_data_loss")
  </code></pre>