You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by onursatici <gi...@git.apache.org> on 2018/08/20 01:23:04 UTC

[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

GitHub user onursatici opened a pull request:

    https://github.com/apache/spark/pull/22146

    [WIP][SPARK-24434][K8S] pod template files

    ## What changes were proposed in this pull request?
    
    New feature to pass podspec files for driver and executor pods.
    
    ## How was this patch tested?
    
    
    TODO:
    - [ ] tests
    - [ ] convetion to change container name


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/onursatici/spark pod-template

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/22146.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #22146
    
----
commit e2e7223667becab04f4ec3160a32756e60c31c44
Author: Onur Satici <os...@...>
Date:   2018-08-17T12:16:34Z

    add spec template configs

commit ea4dde6e3733e092160143c781afa627b084a1b8
Author: Onur Satici <os...@...>
Date:   2018-08-17T14:09:56Z

    start from template for driver

commit 4f088dbacdfa34593a4d2dcccb03bb32ad58b0f7
Author: Onur Satici <os...@...>
Date:   2018-08-17T15:09:20Z

    start from template for executor

commit f2f9a4410cc4907f4c935bc50e96887f687d38bd
Author: Onur Satici <os...@...>
Date:   2018-08-17T15:34:48Z

    wip

commit 368d0a4b73b9d6d3f4b5a30bb77d7bdd1b46c689
Author: Onur Satici <os...@...>
Date:   2018-08-17T20:57:35Z

    volume executor podspec template

commit 0005ea5b69faccc20df20faccb6909429b87f736
Author: Onur Satici <os...@...>
Date:   2018-08-17T21:18:08Z

    move logic to apply functions

commit dda5cc9429eb3c92d1c12d41aafc0781e48fdbd8
Author: Onur Satici <os...@...>
Date:   2018-08-17T21:30:39Z

    find containers

commit d0f41aa18318a35fdcf6f2fbdd969ad3d5ad04da
Author: Onur Satici <os...@...>
Date:   2018-08-17T21:33:34Z

    style

commit c4c1231f4c1545a01243c4f3c4d195af9dacee43
Author: Onur Satici <os...@...>
Date:   2018-08-17T21:33:54Z

    remove import

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by onursatici <gi...@git.apache.org>.
Github user onursatici commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @tnachen I have added a test for additional volumes here: https://github.com/apache/spark/pull/22146/commits/8b8aa48927aa35ba3683ea7eaed093a570721143 and this seems to pass locally.
    Templates should allow you to both modify spark containers and add new containers, the convention we have decided is that the first container in the pod template will be used as a basis for the spark container, both while building the driver and executors


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95277/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2741/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by ifilonenko <gi...@git.apache.org>.
Github user ifilonenko commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    retest this please


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2649/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98223/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95414 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95414/testReport)** for PR 22146 at commit [`fd503db`](https://github.com/apache/spark/commit/fd503dbbcc313f64bec6ce6468406e0014f82968).
     * This patch passes all tests.
     * This patch **does not merge cleanly**.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213612172
  
    --- Diff: resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/PodTemplateSuite.scala ---
    @@ -0,0 +1,64 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.integrationtest
    +
    +import java.io.File
    +
    +import io.fabric8.kubernetes.api.model.Pod
    +
    +import org.apache.spark.deploy.k8s.integrationtest.KubernetesSuite.k8sTestTag
    +
    +private[spark] trait PodTemplateSuite { k8sSuite: KubernetesSuite =>
    +
    +  import PodTemplateSuite._
    +
    +  test("Start pod creation from template", k8sTestTag) {
    --- End diff --
    
    We need to add more tests here with yaml files having more properties.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by shaneknapp <gi...@git.apache.org>.
Github user shaneknapp commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    test this please


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4609/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95163 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95163/testReport)** for PR 22146 at commit [`7f4ff5a`](https://github.com/apache/spark/commit/7f4ff5a10df2de6d60481f1816051e9cd7c22a34).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    To pick this up, I think we need to reach an agreement on which way to go for selecting the Spark container in the pod. I agree that it's clearer to use a configuration option to specifically select the container that is the driver. With that, we need to make a decision on if the selector should be the container name or the index in the container list. @mccheah @erikerlandson .


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4604/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2614/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95442/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2747/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2451/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2530/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r229024855
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -799,4 +815,168 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by either the configured or default spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td><code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccountName</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccountName</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumes</td>
    +  <td>Adds volumes from <code>spark.kubernetes.{driver,executor}.volumes.[VolumeType].[VolumeName].mount.path</code></td>
    +  <td>
    +    Spark will add volumes as specified by the spark conf, as well as additional volumes necessary for passing
    --- End diff --
    
    One way we can avoid conflicting volumes entirely is by randomizing the name of the volumes added by features, e.g. appending some UUID or at least some large integer. I think keeping running documentation on all volumes we add from features is too much overhead. If we run into these conflicts often then we can do this, but I think it's fine not to block merging on that.
    
    Either way though I think again, the validation piece can be done separately from this PR. I wouldn't consider that documentation as blocking on this merging. Thoughts?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by shaneknapp <gi...@git.apache.org>.
Github user shaneknapp commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @mccheah fixed.  for some reason, and on this build node only, that dir owner was set to root:root.  this is fixed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98233 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98233/testReport)** for PR 22146 at commit [`80b56c1`](https://github.com/apache/spark/commit/80b56c1200e2674afe911ba7c0cfec7d85777cd6).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4594/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4609/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2554/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95442 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95442/testReport)** for PR 22146 at commit [`ece7a7c`](https://github.com/apache/spark/commit/ece7a7ca6accd9a5828fadd90523f60cc4ee2c4c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95414/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r214118624
  
    --- Diff: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/PodTemplateConfigMapStepSuite.scala ---
    @@ -0,0 +1,96 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import java.io.{File, PrintWriter}
    +import java.nio.file.Files
    +
    +import io.fabric8.kubernetes.api.model.ConfigMap
    +import org.mockito.Mockito
    +import org.scalatest.BeforeAndAfter
    +
    +import org.apache.spark.{SparkConf, SparkFunSuite}
    +import org.apache.spark.deploy.k8s._
    +
    +class PodTemplateConfigMapStepSuite extends SparkFunSuite with BeforeAndAfter {
    +  private var sparkConf: SparkConf = _
    +  private var kubernetesConf : KubernetesConf[_ <: KubernetesRoleSpecificConf] = _
    +  private var templateFile: File = _
    +
    +  before {
    +    sparkConf = Mockito.mock(classOf[SparkConf])
    +    kubernetesConf = KubernetesConf(
    +      sparkConf,
    +      KubernetesDriverSpecificConf(
    +        None,
    +        "app-name",
    +        "main",
    +        Seq.empty),
    +      "resource",
    +      "app-id",
    +      Map.empty,
    +      Map.empty,
    +      Map.empty,
    +      Map.empty,
    +      Map.empty,
    +      Nil,
    +      Seq.empty[String])
    +    templateFile = Files.createTempFile("pod-template", "yml").toFile
    +    templateFile.deleteOnExit()
    +    Mockito.doReturn(Option(templateFile.getAbsolutePath)).when(sparkConf)
    +      .get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE)
    +  }
    +
    +  test("Mounts executor template volume if config specified") {
    --- End diff --
    
    Ok as long as there is a test its ok.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212470424
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    I'm leaning towards agreeing with @erikerlandson. If we setup the convention that the first container in case of multiple containers in the pod template is the one running the Spark driver/executor, it makes more sense to me to just specify and use the name of the container in the pod template.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by onursatici <gi...@git.apache.org>.
Github user onursatici commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @mccheah @erikerlandson @skonto should we keep the container selection logic here, or should we revert back to having a configuration value for pinning spark container names, either by name of index?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95211/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95424/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2554/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @yifeih can we also modify `docs/running-on-kubernetes.md` and have a section specific to using this feature? Mark it as experimental also.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by aditanase <gi...@git.apache.org>.
Github user aditanase commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r223493848
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -185,6 +185,22 @@ To use a secret through an environment variable use the following options to the
     --conf spark.kubernetes.executor.secretKeyRef.ENV_NAME=name:key
     ```
     
    +## Pod Template
    +Kubernetes allows defining pods from [template files](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates).
    +Spark users can similarly use template files to define the driver or executor pod configurations that Spark configurations do not support.
    +To do so, specify the spark properties `spark.kubernetes.driver.podTemplateFile` and `spark.kubernetes.executor.podTemplateFile`
    +to point to local files accessible to the `spark-submit` process. To allow the driver pod access the executor pod template
    --- End diff --
    
    Have you considered a single config map created at submission time, from which both driver and executors pull their appropriate templates?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95442 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95442/testReport)** for PR 22146 at commit [`ece7a7c`](https://github.com/apache/spark/commit/ece7a7ca6accd9a5828fadd90523f60cc4ee2c4c).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    retest this please


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98273 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98273/testReport)** for PR 22146 at commit [`3707e6a`](https://github.com/apache/spark/commit/3707e6a411cdb8410365cde8e79b8d3ec01a7fee).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95277 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95277/testReport)** for PR 22146 at commit [`f2720a5`](https://github.com/apache/spark/commit/f2720a583389cf712093d5cf7b174c3afc343ace).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95255/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2676/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211800379
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesDriverBuilder.scala ---
    @@ -96,3 +112,25 @@ private[spark] class KubernetesDriverBuilder(
         spec
       }
     }
    +
    +private[spark] object KubernetesDriverBuilder extends Logging {
    +  def apply(kubernetesClient: KubernetesClient, conf: SparkConf): KubernetesDriverBuilder = {
    +    conf.get(Config.KUBERNETES_DRIVER_PODTEMPLATE_FILE)
    +      .map(new File(_))
    +      .map(file => new KubernetesDriverBuilder(provideInitialSpec = conf => {
    +        try {
    +          val sparkPod = KubernetesUtils.loadPodFromTemplate(
    +            kubernetesClient,
    +            file,
    +            Constants.DRIVER_CONTAINER_NAME)
    --- End diff --
    
    You may `import org.apache.spark.deploy.k8s.Constants._` at the top of the file and then not need the `Constants` prefix here.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212396608
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/PodTemplateConfigMapStep.scala ---
    @@ -0,0 +1,71 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import java.io.File
    +import java.nio.charset.StandardCharsets
    +
    +import com.google.common.io.Files
    +import io.fabric8.kubernetes.api.model.{Config => _, _}
    +
    +import org.apache.spark.deploy.k8s._
    --- End diff --
    
    Do not wildcard import the package.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95255 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95255/testReport)** for PR 22146 at commit [`f2720a5`](https://github.com/apache/spark/commit/f2720a583389cf712093d5cf7b174c3afc343ace).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by aditanase <gi...@git.apache.org>.
Github user aditanase commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r223673773
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -799,4 +815,168 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by either the configured or default spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td><code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccountName</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccountName</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumes</td>
    +  <td>Adds volumes from <code>spark.kubernetes.{driver,executor}.volumes.[VolumeType].[VolumeName].mount.path</code></td>
    +  <td>
    +    Spark will add volumes as specified by the spark conf, as well as additional volumes necessary for passing
    --- End diff --
    
    I have done exactly that even w/o this feature - I was trying to use the spark operator to mount a config map and accidentally hit upon the spark config volume on my first try :)
    https://github.com/apache/spark/blob/ba84bcb2c4f73baf63782ff6fad5a607008c7cd2/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Constants.scala#L64


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212469389
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    I'm having mixed feelings about utility of convention vs configuration on this. Mostly just because the purpose of the PR is to prevent further spark configurations. If the feature leans on convention that first container in the list is to be the spark driver/executor, how confusing is that likely to be?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by ifilonenko <gi...@git.apache.org>.
Github user ifilonenko commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213061625
  
    --- Diff: resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/PodTemplateSuite.scala ---
    @@ -0,0 +1,108 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.integrationtest
    +
    +import java.nio.file.Files
    +
    +import com.fasterxml.jackson.databind.ObjectMapper
    +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
    +import io.fabric8.kubernetes.api.model.{Pod, PodBuilder}
    +
    +private[spark] trait PodTemplateSuite { k8sSuite: KubernetesSuite =>
    +
    +  import PodTemplateSuite._
    +
    +  test("Start pod creation from template") {
    +    createPodTemplateFiles()
    +    sparkAppConf
    +      .set("spark.kubernetes.driver.podTemplateFile", DRIVER_TEMPLATE_FILE.getAbsolutePath)
    +      .set("spark.kubernetes.executor.podTemplateFile", EXECUTOR_TEMPLATE_FILE.getAbsolutePath)
    +    runSparkPiAndVerifyCompletion(
    +      driverPodChecker = (driverPod: Pod) => {
    +        checkDriverPod(driverPod)
    +      },
    +      executorPodChecker = (executorPod: Pod) => {
    +        checkExecutorPod(executorPod)
    +      }
    +    )
    +  }
    +
    +  private def checkDriverPod(pod: Pod): Unit = {
    +    assert(pod.getMetadata.getName === driverPodName)
    +    assert(pod.getSpec.getContainers.get(0).getImage === image)
    +    assert(pod.getSpec.getContainers.get(0).getName === DRIVER_CONTAINER_NAME)
    +    assert(pod.getMetadata.getLabels.containsKey(LABEL_KEY))
    +    assert(pod.getMetadata.getLabels.get(LABEL_KEY) === DRIVER_LABEL_VALUE)
    +  }
    +
    +  private def checkExecutorPod(pod: Pod): Unit = {
    +    assert(pod.getMetadata.getName === "template-pod")
    +    assert(pod.getSpec.getContainers.get(0).getImage === image)
    +    assert(pod.getSpec.getContainers.get(0).getName === EXECUTOR_CONTAINER_NAME)
    +    assert(pod.getMetadata.getLabels.containsKey(LABEL_KEY))
    +    assert(pod.getMetadata.getLabels.get(LABEL_KEY) === EXECUTOR_LABEL_VALUE)
    +  }
    +
    +  private def createPodTemplateFiles(): Unit = {
    +    val objectMapper = new ObjectMapper(new YAMLFactory())
    +    val driverTemplatePod = new PodBuilder()
    +      .withApiVersion("1")
    --- End diff --
    
    just a couple NITS. Could you reformat throughout, as such, for easier readability, to keep consistent with the rest of the code-base
    ```
        val driverTemplatePod = new PodBuilder()
          .withApiVersion("1")
          .withKind("Pod")
          .withNewMetadata()
              .addToLabels(LABEL_KEY, DRIVER_LABEL_VALUE)
              .endMetadata()
          .withNewSpec()
              .addNewContainer()
                  .withName(DRIVER_CONTAINER_NAME)
                  .withImage("will-be-overwritten")
                  .endContainer()
              .endSpec()
          .build()
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95163/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212424515
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -775,4 +787,183 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.containerName</code></td>
    +  <td><code>"spark-kubernetes-driver"</code></td>
    +  <td>
    +   This sets the driver container name. If you are specifying a driver [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.containerName</code></td>
    +  <td><code>"spark-kubernetes-executor"</code></td>
    +  <td>
    +   This sets the executor container name. If you are specifying a an executor [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by this spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td></code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of </code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    --- End diff --
    
    similar Q to namespace: if no spark-conf is set, will spark's conf default override here as well?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2676/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2586/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95112 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95112/testReport)** for PR 22146 at commit [`8ef756e`](https://github.com/apache/spark/commit/8ef756e907d8791ea6179960a809f40cc110f3af).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95553 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95553/testReport)** for PR 22146 at commit [`140e89c`](https://github.com/apache/spark/commit/140e89ca8c19049f7852d7f1105bf55022900ddf).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98227/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @mccheah integration testing is passing with the latest container selection policy, good to merge?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98219 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98219/testReport)** for PR 22146 at commit [`83087eb`](https://github.com/apache/spark/commit/83087eb55dde12ecf3a16523f8802c6fd3f8cc1b).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95417 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95417/testReport)** for PR 22146 at commit [`eeb2492`](https://github.com/apache/spark/commit/eeb2492e9721475518c8b861d07611fd6ab70f0a).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95392 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95392/testReport)** for PR 22146 at commit [`f3b6082`](https://github.com/apache/spark/commit/f3b60822e688a6a16404f5e983e953e3da99ffba).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @skonto @erikerlandson 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r215451113
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala ---
    @@ -59,5 +66,28 @@ private[spark] object KubernetesUtils {
         }
       }
     
    +  def loadPodFromTemplate(
    +      kubernetesClient: KubernetesClient,
    +      templateFile: File): SparkPod = {
    +    try {
    +      val pod = kubernetesClient.pods().load(templateFile).get()
    +      pod.getSpec.getContainers.asScala.toList match {
    --- End diff --
    
    Ah actually because we're extracting first and rest this implementation is probably cleaner.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4612/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Ok I'm going to merge this into master. Thanks everyone for the feedback. Follow up discussions around validation can be addressed in follow up patches.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98205/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r226643416
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -799,4 +815,168 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by either the configured or default spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td><code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccountName</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccountName</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumes</td>
    +  <td>Adds volumes from <code>spark.kubernetes.{driver,executor}.volumes.[VolumeType].[VolumeName].mount.path</code></td>
    +  <td>
    +    Spark will add volumes as specified by the spark conf, as well as additional volumes necessary for passing
    +    spark conf and pod template files.
    +  </td>
    +</tr>
    +</table>
    +
    +### Container spec
    +
    +The following affect the driver and executor containers. All other containers in the pod spec will be unaffected.
    +
    +<table class="table">
    +<tr><th>Container spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>env</td>
    +  <td>Adds env variables from <code>spark.kubernetes.driverEnv.[EnvironmentVariableName]</code></td>
    +  <td>
    +    Spark will add driver env variables from <code>spark.kubernetes.driverEnv.[EnvironmentVariableName]</code>, and
    +    executor env variables from <code>spark.executorEnv.[EnvironmentVariableName]</code>.
    +  </td>
    +</tr>
    +<tr>
    +  <td>image</td>
    +  <td>Value of <code>spark.kubernetes.{driver,executor}.container.image</code></td>
    +  <td>
    +    The image will be defined by the spark configurations.
    +  </td>
    +</tr>
    +<tr>
    +  <td>imagePullPolicy</td>
    +  <td>Value of <code>spark.kubernetes.container.image.pullPolicy</code></td>
    +  <td>
    +    Spark will override the pull policy for both driver and executors.
    +  </td>
    +</tr>
    +<tr>
    +  <td>name</td>
    +  <td>See description.</code></td>
    +  <td>
    +    The container name will be assigned by spark ("spark-kubernetes-driver" for the driver container, and
    +    "executor" for each executor container) if not defined by the pod template. If the container is defined by the
    +    template, the template's name will be used.
    +  </td>
    +</tr>
    +<tr>
    +  <td>resources</td>
    +  <td>See description</td>
    +  <td>
    +    The cpu limits are set by <code>spark.kubernetes.{driver,executor}.limit.cores</code>. The cpu is set by
    +    <code>spark.{driver,executor}.cores</code>. The memory request and limit are set by summing the values of
    +    <code>spark.{driver,executor}.memory</code> and <code>spark.{driver,executor}.memoryOverhead</code>.
    +
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumeMounts</td>
    +  <td>Add volumes from <code>spark.kubernetes.driver.volumes.[VolumeType].[VolumeName].mount.{path,readOnly}</code></td>
    --- End diff --
    
    @aditanase that was the purpose of the design doc: https://docs.google.com/document/d/1pcyH5f610X2jyJW9WbWHnj8jktQPLlbbmmUwdeK4fJk capture what behavior we want for each case. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @mccheah @erikerlandson given that banch-2.4 has already been cut, we have more flexibility in terms of timing of getting this in, as well as more space for thoughts to get this right. I don't strongly oppose the idea of using a config option to explicitly select the driver/executor container from possible more than one containers in the pod. An alternative is to have a config option for the index of the driver/executor container in the container list. This approach is similar to using a json path, e.g., `.spec.containers[0]`. This to me is easier for end-users as they don't need to spell the container name twice. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212423082
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -775,4 +787,183 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.containerName</code></td>
    +  <td><code>"spark-kubernetes-driver"</code></td>
    +  <td>
    +   This sets the driver container name. If you are specifying a driver [pod template](#pod-template), you can match this name to the
    --- End diff --
    
    What does "match this name to the name set in the template" mean?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98219/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by yifeih <gi...@git.apache.org>.
Github user yifeih commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212760156
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    Wait, I don't think there's an existing configuration option. I believe the container name is currently just hard coded in `Constants`. 
    
    However, I see your concern about using `spark.kubernetes.driver.containerName` for multiple purposes. In that case, it's definitely easier to reason about with fewer moving pieces, and it sounds like simplest is best. I'll remove the container name configuration and just stick with first container = driver container. This just means that the only way to configure the container name will be through a pod template. I'll also clarify in the docs


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95211 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95211/testReport)** for PR 22146 at commit [`da5dff5`](https://github.com/apache/spark/commit/da5dff5f61c28193b20d085f5b38c3dc722b6355).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95542/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2530/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2842/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2738/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2528/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r215450600
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala ---
    @@ -59,5 +66,28 @@ private[spark] object KubernetesUtils {
         }
       }
     
    +  def loadPodFromTemplate(
    +      kubernetesClient: KubernetesClient,
    +      templateFile: File): SparkPod = {
    +    try {
    +      val pod = kubernetesClient.pods().load(templateFile).get()
    +      pod.getSpec.getContainers.asScala.toList match {
    --- End diff --
    
    I think you can use `headOption` here to get an `Option` object and use `map`, `getOrElse`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98227 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98227/testReport)** for PR 22146 at commit [`80b56c1`](https://github.com/apache/spark/commit/80b56c1200e2674afe911ba7c0cfec7d85777cd6).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4632/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95277 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95277/testReport)** for PR 22146 at commit [`f2720a5`](https://github.com/apache/spark/commit/f2720a583389cf712093d5cf7b174c3afc343ace).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95209 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95209/testReport)** for PR 22146 at commit [`95f8b8b`](https://github.com/apache/spark/commit/95f8b8b8f3260f4fad2fa78a933c88c6aadf28c2).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2687/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98216 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98216/testReport)** for PR 22146 at commit [`c8077dc`](https://github.com/apache/spark/commit/c8077dcd4e74cbfd5d50605c5174662ed23a497f).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98231/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @shaneknapp can we get help diagnosing the permission denied error on the Jenkins box?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    k8s integration test failure appears repeatable:
    ```
    Downloading from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/3.9.1/okhttp-3.9.1.jar
    [WARNING] Failed to write tracking file /home/jenkins/.m2/repository/com/squareup/okhttp3/okhttp/3.9.1/okhttp-3.9.1.jar.lastUpdated
    java.io.FileNotFoundException: /home/jenkins/.m2/repository/com/squareup/okhttp3/okhttp/3.9.1/okhttp-3.9.1.jar.lastUpdated (Permission denied)
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2842/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98227 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98227/testReport)** for PR 22146 at commit [`80b56c1`](https://github.com/apache/spark/commit/80b56c1200e2674afe911ba7c0cfec7d85777cd6).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4605/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2697/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212364915
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    Is there any way to do this via the `containers` container array from the pod template?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2747/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95209/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95542 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95542/testReport)** for PR 22146 at commit [`1ed95ab`](https://github.com/apache/spark/commit/1ed95ab30eeb833af078af8a7e9beccfb0066bde).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r214177723
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -185,6 +185,21 @@ To use a secret through an environment variable use the following options to the
     --conf spark.kubernetes.executor.secretKeyRef.ENV_NAME=name:key
     ```
     
    +## Pod Template
    +Kubernetes allows defining pods from [template files](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates).
    +Spark users can similarly use template files to define the driver or executor pod configurations that Spark configurations do not support.
    +To do so, specify the spark properties `spark.kubernetes.driver.podTemplateFile` and `spark.kubernetes.executor.podTemplateFile`
    +to point to local files accessible to the `spark-submit` process. To allow the driver pod access the executor pod template
    +file, the file will be automatically mounted onto a volume in the driver pod when it's created.
    +
    +It is important to note that Spark is opinionated about certain pod configurations so there are values in the
    +pod template that will always be overwritten by Spark. Therefore, users of this feature should note that specifying
    +the pod template file only lets Spark start with a template pod instead of an empty pod during the pod-building process.
    +For details, see the [full list](#pod-template-properties) of pod template values that will be overwritten by spark.
    +
    +Pod template files can also define multiple containers. In such cases, Spark will always assume that the first container in
    +the list will be the driver or executor container.
    --- End diff --
    
    Having a first container empty looks ugly to me.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95308 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95308/testReport)** for PR 22146 at commit [`4b3950d`](https://github.com/apache/spark/commit/4b3950d394b803f30c8fd6525c58554f334579e5).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95547/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2649/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2451/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by yifeih <gi...@git.apache.org>.
Github user yifeih commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211999160
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesDriverBuilder.scala ---
    @@ -51,7 +57,13 @@ private[spark] class KubernetesDriverBuilder(
         provideJavaStep: (
           KubernetesConf[KubernetesDriverSpecificConf]
             => JavaDriverFeatureStep) =
    -    new JavaDriverFeatureStep(_)) {
    +    new JavaDriverFeatureStep(_),
    +    provideTemplateVolumeStep: (KubernetesConf[_ <: KubernetesRoleSpecificConf]
    +      => TemplateVolumeStep) =
    +    new TemplateVolumeStep(_),
    +    provideInitialSpec: KubernetesConf[KubernetesDriverSpecificConf]
    --- End diff --
    
    It's because we need the kubernetesClient now to load from the pod spec, and not just the KubernetesConf parameter


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2614/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by aditanase <gi...@git.apache.org>.
Github user aditanase commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r223491915
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -799,4 +815,168 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by either the configured or default spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td><code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccountName</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccountName</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumes</td>
    +  <td>Adds volumes from <code>spark.kubernetes.{driver,executor}.volumes.[VolumeType].[VolumeName].mount.path</code></td>
    +  <td>
    +    Spark will add volumes as specified by the spark conf, as well as additional volumes necessary for passing
    +    spark conf and pod template files.
    +  </td>
    +</tr>
    +</table>
    +
    +### Container spec
    +
    +The following affect the driver and executor containers. All other containers in the pod spec will be unaffected.
    +
    +<table class="table">
    +<tr><th>Container spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>env</td>
    +  <td>Adds env variables from <code>spark.kubernetes.driverEnv.[EnvironmentVariableName]</code></td>
    +  <td>
    +    Spark will add driver env variables from <code>spark.kubernetes.driverEnv.[EnvironmentVariableName]</code>, and
    +    executor env variables from <code>spark.executorEnv.[EnvironmentVariableName]</code>.
    +  </td>
    +</tr>
    +<tr>
    +  <td>image</td>
    +  <td>Value of <code>spark.kubernetes.{driver,executor}.container.image</code></td>
    +  <td>
    +    The image will be defined by the spark configurations.
    +  </td>
    +</tr>
    +<tr>
    +  <td>imagePullPolicy</td>
    +  <td>Value of <code>spark.kubernetes.container.image.pullPolicy</code></td>
    +  <td>
    +    Spark will override the pull policy for both driver and executors.
    +  </td>
    +</tr>
    +<tr>
    +  <td>name</td>
    +  <td>See description.</code></td>
    +  <td>
    +    The container name will be assigned by spark ("spark-kubernetes-driver" for the driver container, and
    +    "executor" for each executor container) if not defined by the pod template. If the container is defined by the
    +    template, the template's name will be used.
    +  </td>
    +</tr>
    +<tr>
    +  <td>resources</td>
    +  <td>See description</td>
    +  <td>
    +    The cpu limits are set by <code>spark.kubernetes.{driver,executor}.limit.cores</code>. The cpu is set by
    +    <code>spark.{driver,executor}.cores</code>. The memory request and limit are set by summing the values of
    +    <code>spark.{driver,executor}.memory</code> and <code>spark.{driver,executor}.memoryOverhead</code>.
    +
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumeMounts</td>
    +  <td>Add volumes from <code>spark.kubernetes.driver.volumes.[VolumeType].[VolumeName].mount.{path,readOnly}</code></td>
    --- End diff --
    
    Just checking, is it add or replace? I'm hoping one could use this to mount unsupported volume types, like config maps or secrets, in addition to those managed by spark.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95391 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95391/testReport)** for PR 22146 at commit [`ec04323`](https://github.com/apache/spark/commit/ec043234d47b63435dd82b8931c03458a08f7361).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2676/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211800127
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/TemplateVolumeStep.scala ---
    @@ -0,0 +1,51 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import io.fabric8.kubernetes.api.model.{Config => _, _}
    +
    +import org.apache.spark.deploy.k8s._
    +
    +private[spark] class TemplateVolumeStep(
    +   conf: KubernetesConf[_ <: KubernetesRoleSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +  def configurePod(pod: SparkPod): SparkPod = {
    +    require(conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).isDefined)
    +    val podTemplateFile = conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).get
    +    val podWithVolume = new PodBuilder(pod.pod)
    +      .editSpec()
    --- End diff --
    
    Match the indentation here with the indentation style down below.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212396719
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/PodTemplateConfigMapStep.scala ---
    @@ -0,0 +1,71 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import java.io.File
    +import java.nio.charset.StandardCharsets
    +
    +import com.google.common.io.Files
    +import io.fabric8.kubernetes.api.model.{Config => _, _}
    --- End diff --
    
    Instead of doing this, just import `Config`, then, do this import: `import org.apache.spark.deploy.k8s.Config._`. Also, wildcard-import constants: `import org.apache.spark.deploy.k8s.Constants._`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212068140
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/TemplateVolumeStep.scala ---
    @@ -0,0 +1,51 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import io.fabric8.kubernetes.api.model.{Config => _, _}
    +
    +import org.apache.spark.deploy.k8s._
    +
    +private[spark] class TemplateVolumeStep(
    +   conf: KubernetesConf[_ <: KubernetesRoleSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +  def configurePod(pod: SparkPod): SparkPod = {
    +    require(conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).isDefined)
    +    val podTemplateFile = conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).get
    +    val podWithVolume = new PodBuilder(pod.pod)
    +      .editSpec()
    +      .addNewVolume()
    +      .withName(Constants.POD_TEMPLATE_VOLUME)
    +      .withHostPath(new HostPathVolumeSource(podTemplateFile))
    --- End diff --
    
    Can we also change the name of this class to something like `PodTemplateConfigMapStep` to make it clear that is uses a ConfigMap to ship the template file?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211802430
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/TemplateVolumeStep.scala ---
    @@ -0,0 +1,51 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import io.fabric8.kubernetes.api.model.{Config => _, _}
    +
    +import org.apache.spark.deploy.k8s._
    +
    +private[spark] class TemplateVolumeStep(
    --- End diff --
    
    So this pushes the pod spec yml from the spark-submit process's local disk up to the driver pod. It may be worthwhile to support specifying the file as a location in the driver pod that hasn't been mounted by spark-submit, but I think doing it this way is fine for now.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2738/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r229013267
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -799,4 +815,168 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by either the configured or default spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td><code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccountName</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccountName</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumes</td>
    +  <td>Adds volumes from <code>spark.kubernetes.{driver,executor}.volumes.[VolumeType].[VolumeName].mount.path</code></td>
    +  <td>
    +    Spark will add volumes as specified by the spark conf, as well as additional volumes necessary for passing
    +    spark conf and pod template files.
    +  </td>
    +</tr>
    +</table>
    +
    +### Container spec
    +
    +The following affect the driver and executor containers. All other containers in the pod spec will be unaffected.
    +
    +<table class="table">
    +<tr><th>Container spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>env</td>
    +  <td>Adds env variables from <code>spark.kubernetes.driverEnv.[EnvironmentVariableName]</code></td>
    +  <td>
    +    Spark will add driver env variables from <code>spark.kubernetes.driverEnv.[EnvironmentVariableName]</code>, and
    +    executor env variables from <code>spark.executorEnv.[EnvironmentVariableName]</code>.
    +  </td>
    +</tr>
    +<tr>
    +  <td>image</td>
    +  <td>Value of <code>spark.kubernetes.{driver,executor}.container.image</code></td>
    +  <td>
    +    The image will be defined by the spark configurations.
    +  </td>
    +</tr>
    +<tr>
    +  <td>imagePullPolicy</td>
    +  <td>Value of <code>spark.kubernetes.container.image.pullPolicy</code></td>
    +  <td>
    +    Spark will override the pull policy for both driver and executors.
    +  </td>
    +</tr>
    +<tr>
    +  <td>name</td>
    +  <td>See description.</code></td>
    +  <td>
    +    The container name will be assigned by spark ("spark-kubernetes-driver" for the driver container, and
    +    "executor" for each executor container) if not defined by the pod template. If the container is defined by the
    +    template, the template's name will be used.
    +  </td>
    +</tr>
    +<tr>
    +  <td>resources</td>
    +  <td>See description</td>
    +  <td>
    +    The cpu limits are set by <code>spark.kubernetes.{driver,executor}.limit.cores</code>. The cpu is set by
    +    <code>spark.{driver,executor}.cores</code>. The memory request and limit are set by summing the values of
    +    <code>spark.{driver,executor}.memory</code> and <code>spark.{driver,executor}.memoryOverhead</code>.
    +
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumeMounts</td>
    +  <td>Add volumes from <code>spark.kubernetes.driver.volumes.[VolumeType].[VolumeName].mount.{path,readOnly}</code></td>
    --- End diff --
    
    Volumes should be additive. If names are duplicated though I'd expect K8s to throw an error.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by tnachen <gi...@git.apache.org>.
Github user tnachen commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    I've been looking to mount additional volumes to the executor containers and just tried out the PR.
    It doesn't seem possible since if you add the container in the pod template, BasicExecutorFeatureStep still adds another executor container and then it becomes a invalid pod spec.
    I think it's worth considering if we want pod templates to have the ability to modify or add existing elements that the code adds to the pod spec, or this is only for adding additional attributes than what the code already does.
    It seems like the latter is simplest, but just throwing out here that for features like adding volumes to executor this won't work.



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Retest this please


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98231 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98231/testReport)** for PR 22146 at commit [`80b56c1`](https://github.com/apache/spark/commit/80b56c1200e2674afe911ba7c0cfec7d85777cd6).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95461/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212395959
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    I prefer to make it explicit, rather than e.g. "pick the first container in the list".


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Jenkins, ok to test


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98213/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212400281
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesClusterManager.scala ---
    @@ -81,13 +88,17 @@ private[spark] class KubernetesClusterManager extends ExternalClusterManager wit
           .build[java.lang.Long, java.lang.Long]()
         val executorPodsLifecycleEventHandler = new ExecutorPodsLifecycleManager(
           sc.conf,
    -      new KubernetesExecutorBuilder(),
    +      KubernetesExecutorBuilder(kubernetesClient, sc.conf),
    --- End diff --
    
    I double checked and I don't think we use this variable inside `ExecutorPodsLifecycleManager`, can you remove it?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by yifeih <gi...@git.apache.org>.
Github user yifeih commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212636275
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    I generally prefer being more explicit about selecting the container name. Selecting the first container has the danger of silent failures. Especially since we currently hardcode the container name right now, somebody might write their pod templates with a driver container name `spark-kubernetes-driver` but not list it as the first, and then be confused why their spark applications are failing? But I can see how this could be confusing because it assumes a strong relationship between the spark conf and the template. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2586/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212668742
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    I'm sensing some confusion over the purpose of `spark.kubernetes.driver.containerName` - is it to select the container out of the `containers` array in the template, or is it to *set* that name? Since this PR is creating `containerName` spark conf, I'm assuming it is no longer hard-coded, and we're exposing it to user control.
    
    IIUC, the current concept is that the user *must* declare a container name, *and* also must specify it via `spark.kubernetes.driver.containerName`; If not, I'm not sure what the default behavior is.
    
    I agree that leaning on convention (spark container is the first one) can cause problems, although the same problems would happen if they specify the wrong container name in the config. Clear documentation would be important regardless.  In general, user supplied templates are a "power-user" feature, and some increased opportunities for error are inherent here.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95424 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95424/testReport)** for PR 22146 at commit [`36a70ad`](https://github.com/apache/spark/commit/36a70ad1584ec8a08135759f2d4eaeacb9cce162).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95553/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95346/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98205 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98205/testReport)** for PR 22146 at commit [`5faea62`](https://github.com/apache/spark/commit/5faea6277c2581844786f4367f04b0355e3d9788).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Latest container selection w/ default to first LGTM


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4597/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4612/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by yifeih <gi...@git.apache.org>.
Github user yifeih commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @onursatici is also away this week, so I discussed with him and have taken over the PR
    
    This v0 implementation simply starts with the pod template instead of an empty pod, applying any sparkConf overrides, either user-specified or default values, on top of the template. It currently doesn't warn upon overriding anything that's also specified in the pod template


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4632/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98233 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98233/testReport)** for PR 22146 at commit [`80b56c1`](https://github.com/apache/spark/commit/80b56c1200e2674afe911ba7c0cfec7d85777cd6).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95308 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95308/testReport)** for PR 22146 at commit [`4b3950d`](https://github.com/apache/spark/commit/4b3950d394b803f30c8fd6525c58554f334579e5).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Thanks @onursatici!
    Can you please resolve merge conflicts (rebase?), so CI can build it?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Can one of the admins verify this patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2562/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2507/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2562/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212761597
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    You are right. We were confusing the one for driver pod name with this one.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211800821
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesDriverBuilder.scala ---
    @@ -51,7 +57,13 @@ private[spark] class KubernetesDriverBuilder(
         provideJavaStep: (
           KubernetesConf[KubernetesDriverSpecificConf]
             => JavaDriverFeatureStep) =
    -    new JavaDriverFeatureStep(_)) {
    +    new JavaDriverFeatureStep(_),
    +    provideTemplateVolumeStep: (KubernetesConf[_ <: KubernetesRoleSpecificConf]
    +      => TemplateVolumeStep) =
    +    new TemplateVolumeStep(_),
    +    provideInitialSpec: KubernetesConf[KubernetesDriverSpecificConf]
    --- End diff --
    
    Why not `provideInitialPod` to be consistent with the executor builder?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r229367166
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Constants.scala ---
    @@ -74,8 +74,16 @@ private[spark] object Constants {
       val ENV_R_PRIMARY = "R_PRIMARY"
       val ENV_R_ARGS = "R_APP_ARGS"
     
    +  // Pod spec templates
    +  val EXECUTOR_POD_SPEC_TEMPLATE_FILE_NAME = "pod-spec-template.yml"
    +  val EXECUTOR_POD_SPEC_TEMPLATE_MOUNTHPATH = "/opt/spark/pod-template"
    +  val POD_TEMPLATE_VOLUME = "podspec-volume"
    --- End diff --
    
    Ping here


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by ifilonenko <gi...@git.apache.org>.
Github user ifilonenko commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213064103
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesDriverSpec.scala ---
    @@ -24,8 +24,9 @@ private[spark] case class KubernetesDriverSpec(
         systemProperties: Map[String, String])
     
     private[spark] object KubernetesDriverSpec {
    -  def initialSpec(initialProps: Map[String, String]): KubernetesDriverSpec = KubernetesDriverSpec(
    -    SparkPod.initialPod(),
    -    Seq.empty,
    -    initialProps)
    +  def initialSpec(initialConf: KubernetesConf[KubernetesDriverSpecificConf]): KubernetesDriverSpec =
    +    KubernetesDriverSpec(
    +      SparkPod.initialPod(),
    +      Seq.empty,
    --- End diff --
    
    NIT: For clarity can you write as: 
    ```
        KubernetesDriverSpec(
          SparkPod.initialPod(),
          driverKubernetesResources = Seq.empty,
          initialConf.sparkConf.getAll.toMap)
    ```



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2697/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2651/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95679/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213604900
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Constants.scala ---
    @@ -74,8 +74,16 @@ private[spark] object Constants {
       val ENV_R_PRIMARY = "R_PRIMARY"
       val ENV_R_ARGS = "R_APP_ARGS"
     
    +  // Pod spec templates
    +  val EXECUTOR_POD_SPEC_TEMPLATE_FILE_NAME = "pod-spec-template.yml"
    +  val EXECUTOR_POD_SPEC_TEMPLATE_MOUNTHPATH = "/opt/spark/pod-template"
    +  val POD_TEMPLATE_VOLUME = "podspec-volume"
    --- End diff --
    
    nit: s/podspec-volume/podtemplate-volume
    You are passing the whole template right?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by ifilonenko <gi...@git.apache.org>.
Github user ifilonenko commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213060443
  
    --- Diff: resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/PodTemplateSuite.scala ---
    @@ -0,0 +1,108 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.integrationtest
    +
    +import java.nio.file.Files
    +
    +import com.fasterxml.jackson.databind.ObjectMapper
    +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
    +import io.fabric8.kubernetes.api.model.{Pod, PodBuilder}
    +
    +private[spark] trait PodTemplateSuite { k8sSuite: KubernetesSuite =>
    +
    +  import PodTemplateSuite._
    +
    +  test("Start pod creation from template") {
    --- End diff --
    
    `test("Start pod creation from template") {`
    should be 
    `test("Start pod creation from template", k8sTestTag) {`
    for the test to be run


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95391 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95391/testReport)** for PR 22146 at commit [`ec04323`](https://github.com/apache/spark/commit/ec043234d47b63435dd82b8931c03458a08f7361).
     * This patch **fails RAT tests**.
     * This patch **does not merge cleanly**.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r215450800
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Constants.scala ---
    @@ -74,8 +74,16 @@ private[spark] object Constants {
       val ENV_R_PRIMARY = "R_PRIMARY"
       val ENV_R_ARGS = "R_APP_ARGS"
     
    +  // Pod spec templates
    +  val EXECUTOR_POD_SPEC_TEMPLATE_FILE_NAME = "pod-spec-template.yml"
    +  val EXECUTOR_POD_SPEC_TEMPLATE_MOUNTHPATH = "/opt/spark/pod-template"
    --- End diff --
    
    Spelling, think we want `EXECUTOR_POD_SPEC_TEMPLATE_MOUNTPATH`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2666/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4592/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2666/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98273 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98273/testReport)** for PR 22146 at commit [`3707e6a`](https://github.com/apache/spark/commit/3707e6a411cdb8410365cde8e79b8d3ec01a7fee).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98213 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98213/testReport)** for PR 22146 at commit [`9e6a4b2`](https://github.com/apache/spark/commit/9e6a4b2db16daad02d4c51d25b5e4ae1f4582292).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95424 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95424/testReport)** for PR 22146 at commit [`36a70ad`](https://github.com/apache/spark/commit/36a70ad1584ec8a08135759f2d4eaeacb9cce162).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2651/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by tnachen <gi...@git.apache.org>.
Github user tnachen commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    The PR works for me now as well for adding volumes to executors.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212721068
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    Similarly, what if the user gives the driver container name in the driver template but forgets to specify `spark.kubernetes.driver.containerName`? Requiring users to set the container name explicitly and additionally through another config key sounds a bit awkward to me, particularly when there's only the Spark container itself.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2492/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4612/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211799242
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala ---
    @@ -59,5 +65,23 @@ private[spark] object KubernetesUtils {
         }
       }
     
    +  def loadPodFromTemplate(kubernetesClient: KubernetesClient,
    +                          templateFile: File,
    +                          containerName: String): SparkPod = {
    +    try {
    +      val pod = kubernetesClient.pods().load(templateFile).get()
    +      val container = pod.getSpec.getContainers.asScala
    +        .filter(_.getName == containerName)
    --- End diff --
    
    Can use `require(...exists)`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by onursatici <gi...@git.apache.org>.
Github user onursatici commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213846434
  
    --- Diff: resource-managers/kubernetes/core/src/test/scala/org/apache/spark/deploy/k8s/features/PodTemplateConfigMapStepSuite.scala ---
    @@ -0,0 +1,96 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import java.io.{File, PrintWriter}
    +import java.nio.file.Files
    +
    +import io.fabric8.kubernetes.api.model.ConfigMap
    +import org.mockito.Mockito
    +import org.scalatest.BeforeAndAfter
    +
    +import org.apache.spark.{SparkConf, SparkFunSuite}
    +import org.apache.spark.deploy.k8s._
    +
    +class PodTemplateConfigMapStepSuite extends SparkFunSuite with BeforeAndAfter {
    +  private var sparkConf: SparkConf = _
    +  private var kubernetesConf : KubernetesConf[_ <: KubernetesRoleSpecificConf] = _
    +  private var templateFile: File = _
    +
    +  before {
    +    sparkConf = Mockito.mock(classOf[SparkConf])
    +    kubernetesConf = KubernetesConf(
    +      sparkConf,
    +      KubernetesDriverSpecificConf(
    +        None,
    +        "app-name",
    +        "main",
    +        Seq.empty),
    +      "resource",
    +      "app-id",
    +      Map.empty,
    +      Map.empty,
    +      Map.empty,
    +      Map.empty,
    +      Map.empty,
    +      Nil,
    +      Seq.empty[String])
    +    templateFile = Files.createTempFile("pod-template", "yml").toFile
    +    templateFile.deleteOnExit()
    +    Mockito.doReturn(Option(templateFile.getAbsolutePath)).when(sparkConf)
    +      .get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE)
    +  }
    +
    +  test("Mounts executor template volume if config specified") {
    --- End diff --
    
    Because we need a kubernetesClient to be able to load a yaml file (not ideal design decision from fabric8 for this case), I think we can only test that in integration tests


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4604/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4632/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98226 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98226/testReport)** for PR 22146 at commit [`a46b885`](https://github.com/apache/spark/commit/a46b885f63e352ab5b34fe371b16ce642ea5b1ae).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:
      * `case class Average(child: Expression) extends DeclarativeAggregate with ImplicitCastInputTypes `
      * `case class Count(children: Seq[Expression]) extends DeclarativeAggregate `


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by onursatici <gi...@git.apache.org>.
Github user onursatici commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @mccheah @erikerlandson @liyinan926 @ifilonenko @skonto this pr is ready for a final review. I am only planning to add one integration test for malformed templates, if I can find a non intrusive way to check for STDERR for the spark submit process.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98237 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98237/testReport)** for PR 22146 at commit [`80b56c1`](https://github.com/apache/spark/commit/80b56c1200e2674afe911ba7c0cfec7d85777cd6).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by yifeih <gi...@git.apache.org>.
Github user yifeih commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212017571
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesDriverBuilder.scala ---
    @@ -51,7 +57,13 @@ private[spark] class KubernetesDriverBuilder(
         provideJavaStep: (
           KubernetesConf[KubernetesDriverSpecificConf]
             => JavaDriverFeatureStep) =
    -    new JavaDriverFeatureStep(_)) {
    +    new JavaDriverFeatureStep(_),
    +    provideTemplateVolumeStep: (KubernetesConf[_ <: KubernetesRoleSpecificConf]
    +      => TemplateVolumeStep) =
    +    new TemplateVolumeStep(_),
    +    provideInitialSpec: KubernetesConf[KubernetesDriverSpecificConf]
    --- End diff --
    
    I think it's because we need the `KubernetesDriverSpec` object instead of just the pod? which includes things like the entire sparkConf map


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2651/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4592/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4604/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95392/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2528/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95391/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95679 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95679/testReport)** for PR 22146 at commit [`838c2bd`](https://github.com/apache/spark/commit/838c2bdb8606a6dceec6805682ad95afd4d2b22f).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2741/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2697/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95553 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95553/testReport)** for PR 22146 at commit [`140e89c`](https://github.com/apache/spark/commit/140e89ca8c19049f7852d7f1105bf55022900ddf).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213600630
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -775,4 +787,183 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.containerName</code></td>
    +  <td><code>"spark-kubernetes-driver"</code></td>
    +  <td>
    +   This sets the driver container name. If you are specifying a driver [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.containerName</code></td>
    +  <td><code>"spark-kubernetes-executor"</code></td>
    +  <td>
    +   This sets the executor container name. If you are specifying a an executor [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    --- End diff --
    
    It should be the default namespace.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/95180/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211800176
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/TemplateVolumeStep.scala ---
    @@ -0,0 +1,51 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import io.fabric8.kubernetes.api.model.{Config => _, _}
    +
    +import org.apache.spark.deploy.k8s._
    +
    +private[spark] class TemplateVolumeStep(
    +   conf: KubernetesConf[_ <: KubernetesRoleSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +  def configurePod(pod: SparkPod): SparkPod = {
    +    require(conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).isDefined)
    +    val podTemplateFile = conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).get
    +    val podWithVolume = new PodBuilder(pod.pod)
    +      .editSpec()
    +      .addNewVolume()
    +      .withName(Constants.POD_TEMPLATE_VOLUME)
    +      .withHostPath(new HostPathVolumeSource(podTemplateFile))
    +      .endVolume()
    +      .endSpec()
    +      .build()
    +
    +    val containerWithVolume = new ContainerBuilder(pod.container)
    +        .withVolumeMounts(new VolumeMountBuilder()
    --- End diff --
    
    `addNewVolumeMount()`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4588/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by erikerlandson <gi...@git.apache.org>.
Github user erikerlandson commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212438850
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala ---
    @@ -225,6 +225,18 @@ private[spark] object Config extends Logging {
             "Ensure that major Python version is either Python2 or Python3")
           .createWithDefault("2")
     
    +  val KUBERNETES_DRIVER_CONTAINER_NAME =
    +    ConfigBuilder("spark.kubernetes.driver.containerName")
    --- End diff --
    
    @mccheah it raises interesting question: a user might use this feature to add containers, e.g. side-car proxies, service mesh, etc. In fact, I'd want users to be able to do this. If there *are* multiple containers defined, we may need a convention for identifying which one is driver/executor. Alternatives might include additive-only, like labels, or disallowing, but supporting this seems very desirable.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98213 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98213/testReport)** for PR 22146 at commit [`9e6a4b2`](https://github.com/apache/spark/commit/9e6a4b2db16daad02d4c51d25b5e4ae1f4582292).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by yifeih <gi...@git.apache.org>.
Github user yifeih commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212633621
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -775,4 +787,183 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.containerName</code></td>
    +  <td><code>"spark-kubernetes-driver"</code></td>
    +  <td>
    +   This sets the driver container name. If you are specifying a driver [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.containerName</code></td>
    +  <td><code>"spark-kubernetes-executor"</code></td>
    +  <td>
    +   This sets the executor container name. If you are specifying a an executor [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by this spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td></code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of </code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    --- End diff --
    
    I'm pretty sure this does not: https://github.com/apache/spark/blob/master/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverKubernetesCredentialsFeatureStep.scala#L74. I'll update the docs to clarify!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212126595
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesDriverBuilder.scala ---
    @@ -51,7 +57,13 @@ private[spark] class KubernetesDriverBuilder(
         provideJavaStep: (
           KubernetesConf[KubernetesDriverSpecificConf]
             => JavaDriverFeatureStep) =
    -    new JavaDriverFeatureStep(_)) {
    +    new JavaDriverFeatureStep(_),
    +    provideTemplateVolumeStep: (KubernetesConf[_ <: KubernetesRoleSpecificConf]
    +      => TemplateVolumeStep) =
    +    new TemplateVolumeStep(_),
    +    provideInitialSpec: KubernetesConf[KubernetesDriverSpecificConf]
    --- End diff --
    
    You can make the initial pod and wrap it in the `KubernetesDriverSpec` object.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @rvesse is it reasonable to defer the validation piece of this for a second patch?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r226642833
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -799,4 +815,168 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    +    be replaced by either the configured or default spark conf value.
    +  </td>
    +</tr>
    +<tr>
    +  <td>labels</td>
    +  <td>Adds the labels from <code>spark.kubernetes.{driver,executor}.label.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +<tr>
    +  <td>annotations</td>
    +  <td>Adds the annotations from <code>spark.kubernetes.{driver,executor}.annotation.*</code></td>
    +  <td>
    +    Spark will add additional labels specified by the spark configuration.
    +  </td>
    +</tr>
    +</table>
    +
    +### Pod Spec
    +
    +<table class="table">
    +<tr><th>Pod spec key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>imagePullSecrets</td>
    +  <td>Adds image pull secrets from <code>spark.kubernetes.container.image.pullSecrets</code></td>
    +  <td>
    +    Additional pull secrets will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>nodeSelector</td>
    +  <td>Adds node selectors from <code>spark.kubernetes.node.selector.*</code></td>
    +  <td>
    +    Additional node selectors will be added from the spark configuration to both executor pods.
    +  </td>
    +</tr>
    +<tr>
    +  <td>restartPolicy</td>
    +  <td><code>"never"</code></td>
    +  <td>
    +    Spark assumes that both drivers and executors never restart.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccount</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccount</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>serviceAccountName</td>
    +  <td>Value of <code>spark.kubernetes.authenticate.driver.serviceAccountName</code></td>
    +  <td>
    +    Spark will override <code>serviceAccountName</code> with the value of the spark configuration for only
    +    driver pods, and only if the spark configuration is specified. Executor pods will remain unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>volumes</td>
    +  <td>Adds volumes from <code>spark.kubernetes.{driver,executor}.volumes.[VolumeType].[VolumeName].mount.path</code></td>
    +  <td>
    +    Spark will add volumes as specified by the spark conf, as well as additional volumes necessary for passing
    --- End diff --
    
    +1. As I mentioned before we need to know the implications of whatever property we expose. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2669/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212396387
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/KubernetesUtils.scala ---
    @@ -59,5 +65,21 @@ private[spark] object KubernetesUtils {
         }
       }
     
    +  def loadPodFromTemplate(kubernetesClient: KubernetesClient,
    --- End diff --
    
    IDEs don't handle this indentation properly I think - you want this:
    
    ```
    def loadPodFromTemplate(
        kubernetesClient: KubernetesClient,
        templateFile: File,
        containerName: String): SparkPod = {
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by onursatici <gi...@git.apache.org>.
Github user onursatici commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @ifilonenko I would like to get this merged as well, I think the only blocker for that is for us to decide how to specify the spark container in the pod template. @erikerlandson  @mccheah 
    Current state of this pr assumes the first container in the containers list of the pod template is the spark pod. Happy to change after we come into a conclusion.
    
    We also have this PR in our fork, and has been running successfully for the last month.
    



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98216/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98216 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98216/testReport)** for PR 22146 at commit [`c8077dc`](https://github.com/apache/spark/commit/c8077dcd4e74cbfd5d50605c5174662ed23a497f).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95547 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95547/testReport)** for PR 22146 at commit [`a4fde0c`](https://github.com/apache/spark/commit/a4fde0cdc4dc5b64fd3f888244656371eb76f837).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by yifeih <gi...@git.apache.org>.
Github user yifeih commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212631423
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -775,4 +787,183 @@ specific to Spark on Kubernetes.
        This sets the major Python version of the docker image used to run the driver and executor containers. Can either be 2 or 3. 
       </td>
     </tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.containerName</code></td>
    +  <td><code>"spark-kubernetes-driver"</code></td>
    +  <td>
    +   This sets the driver container name. If you are specifying a driver [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.containerName</code></td>
    +  <td><code>"spark-kubernetes-executor"</code></td>
    +  <td>
    +   This sets the executor container name. If you are specifying a an executor [pod template](#pod-template), you can match this name to the
    +   driver container name set in the template.
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.driver.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the driver [pod template](#pod-template). For example
    +   <code>spark.kubernetes.driver.podTemplateFile=/path/to/driver-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +<tr>
    +  <td><code>spark.kubernetes.executor.podTemplateFile</code></td>
    +  <td>(none)</td>
    +  <td>
    +   Specify the local file that contains the executor [pod template](#pod-template). For example
    +   <code>spark.kubernetes.executor.podTemplateFile=/path/to/executor-pod-template.yaml`</code>
    +  </td>
    +</tr>
    +</table>
    +
    +#### Pod template properties
    +
    +See the below table for the full list of pod specifications that will be overwritten by spark.
    +
    +### Pod Metadata
    +
    +<table class="table">
    +<tr><th>Pod metadata key</th><th>Modified value</th><th>Description</th></tr>
    +<tr>
    +  <td>name</td>
    +  <td>Value of <code>spark.kubernetes.driver.pod.name</code></td>
    +  <td>
    +    The driver pod name will be overwritten with either the configured or default value of
    +    <code>spark.kubernetes.driver.pod.name</code>. The executor pod names will be unaffected.
    +  </td>
    +</tr>
    +<tr>
    +  <td>namespace</td>
    +  <td>Value of <code>spark.kubernetes.namespace</code></td>
    +  <td>
    +    Spark makes strong assumptions about the driver and executor namespaces. Both driver and executor namespaces will
    --- End diff --
    
    It will also be replaced with the spark conf's default value. I'll update this description to match that of `name` right above this


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211801962
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/TemplateVolumeStep.scala ---
    @@ -0,0 +1,51 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import io.fabric8.kubernetes.api.model.{Config => _, _}
    +
    +import org.apache.spark.deploy.k8s._
    +
    +private[spark] class TemplateVolumeStep(
    +   conf: KubernetesConf[_ <: KubernetesRoleSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +  def configurePod(pod: SparkPod): SparkPod = {
    +    require(conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).isDefined)
    +    val podTemplateFile = conf.get(Config.KUBERNETES_EXECUTOR_PODTEMPLATE_FILE).get
    +    val podWithVolume = new PodBuilder(pod.pod)
    +      .editSpec()
    +      .addNewVolume()
    +      .withName(Constants.POD_TEMPLATE_VOLUME)
    +      .withHostPath(new HostPathVolumeSource(podTemplateFile))
    --- End diff --
    
    `hostPath` is not the correct volume type here. Instead, do the following:
    
    - Override `getAdditionalKubernetesResources()` with the following:
        1. Load the contents of the template file from this process's local disk into a UTF-8 String
        2. Create and return a  `ConfigMap` object containing the contents of that config map, with some given key
    - In `configurePod`, add the config map as a volume in the pod spec, and add a volume mount pointing to that volume as done here.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2669/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4609/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r212068833
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Constants.scala ---
    @@ -74,8 +74,15 @@ private[spark] object Constants {
       val ENV_R_PRIMARY = "R_PRIMARY"
       val ENV_R_ARGS = "R_APP_ARGS"
     
    +  // Pod spec templates
    +  val EXECUTOR_POD_SPEC_TEMPLATE_FILE_NAME = "podSpecTemplate.yml"
    --- End diff --
    
    Can we not use camel case for the file name? This looks inconsistent with other conf files. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r213047538
  
    --- Diff: docs/running-on-kubernetes.md ---
    @@ -185,6 +185,21 @@ To use a secret through an environment variable use the following options to the
     --conf spark.kubernetes.executor.secretKeyRef.ENV_NAME=name:key
     ```
     
    +## Pod Template
    +Kubernetes allows defining pods from [template files](https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates).
    +Spark users can similarly use template files to define the driver or executor pod configurations that Spark configurations do not support.
    +To do so, specify the spark properties `spark.kubernetes.driver.podTemplateFile` and `spark.kubernetes.executor.podTemplateFile`
    +to point to local files accessible to the `spark-submit` process. To allow the driver pod access the executor pod template
    +file, the file will be automatically mounted onto a volume in the driver pod when it's created.
    +
    +It is important to note that Spark is opinionated about certain pod configurations so there are values in the
    +pod template that will always be overwritten by Spark. Therefore, users of this feature should note that specifying
    +the pod template file only lets Spark start with a template pod instead of an empty pod during the pod-building process.
    +For details, see the [full list](#pod-template-properties) of pod template values that will be overwritten by spark.
    +
    +Pod template files can also define multiple containers. In such cases, Spark will always assume that the first container in
    +the list will be the driver or executor container.
    --- End diff --
    
    is it possible to use only extra containers and not Spark specific? Could we have a naming convention or a less error prone convention?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2507/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by rvesse <gi...@git.apache.org>.
Github user rvesse commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @mccheah I was taking that as a given


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2669/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4601/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22146: [WIP][SPARK-24434][K8S] pod template files

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22146#discussion_r211800415
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesDriverBuilder.scala ---
    @@ -16,11 +16,17 @@
      */
     package org.apache.spark.deploy.k8s.submit
     
    -import org.apache.spark.deploy.k8s.{KubernetesConf, KubernetesDriverSpec, KubernetesDriverSpecificConf, KubernetesRoleSpecificConf}
    -import org.apache.spark.deploy.k8s.features.{BasicDriverFeatureStep, DriverKubernetesCredentialsFeatureStep, DriverServiceFeatureStep, EnvSecretsFeatureStep, LocalDirsFeatureStep, MountSecretsFeatureStep, MountVolumesFeatureStep}
    +import java.io.File
    +
    +import io.fabric8.kubernetes.client.KubernetesClient
    +
    +import org.apache.spark.{SparkConf, SparkException}
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.features._
    --- End diff --
    
    Undo these import changes. Keep the ordering correct, but import each class individually.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98226/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95209 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95209/testReport)** for PR 22146 at commit [`95f8b8b`](https://github.com/apache/spark/commit/95f8b8b8f3260f4fad2fa78a933c88c6aadf28c2).
     * This patch **fails Scala style tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #98226 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98226/testReport)** for PR 22146 at commit [`a46b885`](https://github.com/apache/spark/commit/a46b885f63e352ab5b34fe371b16ce642ea5b1ae).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by skonto <gi...@git.apache.org>.
Github user skonto commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    @onursatici I tried the PR and it works so far. We can keep the convention let's hope users will be careful.Would it possible to add some tests like sidecar tests to examine containers setup etc.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/2554/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    **[Test build #95180 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/95180/testReport)** for PR 22146 at commit [`9b1418a`](https://github.com/apache/spark/commit/9b1418aaee1e1457a7e807d7996e9719e3827fa4).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4601/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22146: [SPARK-24434][K8S] pod template files

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22146
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/2614/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org