GitHub user liyinan926 opened a pull request:

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

    [SPARK-22953][K8S] Avoids adding duplicated secret volumes when 
init-container is used

    ## What changes were proposed in this pull request?
    
    User-specified secrets are mounted into both the main container and 
init-container (when it is used) in a Spark driver/executor pod, using the 
`MountSecretsBootstrap`. Because `MountSecretsBootstrap` always adds new secret 
volumes for the secrets to the pod, the same secret volumes get added twice, 
one when mounting the secrets to the main container, and the other when 
mounting the secrets to the init-container. This PR fixes the issue by 
separating `MountSecretsBootstrap.mountSecrets` out into two methods: 
`addSecretVolumes` for adding secret volumes to a pod and `mountSecrets` for 
mounting secret volumes to a container, respectively. `addSecretVolumes` is 
only called once for each pod, whereas `mountSecrets` is called individually 
for the main container and the init-container (if it is used).
    
    Ref: https://github.com/apache-spark-on-k8s/spark/issues/594. 
    
    ## How was this patch tested?
    Unit tested and manually tested.
    
    @vanzin This replaces https://github.com/apache/spark/pull/20148.
    @hex108 @foxish @kimoonkim


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

    $ git pull https://github.com/liyinan926/spark-k8s master

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

    https://github.com/apache/spark/pull/20159.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 #20159
    
----
commit c5d5a2d53fa75e0b590fc890f4e23de20f429087
Author: Yinan Li <liyinan926@...>
Date:   2018-01-04T06:20:01Z

    [SPARK-22953][K8S] Avoids adding duplicated secret volumes when 
init-container is used

----


---

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

Reply via email to