GitHub user andrusha opened a pull request:

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

    [SPARK-23668][K8S] Add config option for passing through k8s 
Pod.spec.imagePullSecrets

    ## What changes were proposed in this pull request?
    
    Pass through the `imagePullSecrets` option to the k8s pod in order to allow 
user to access private image registries.
    
    See 
https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
    
    ## How was this patch tested?
    
    Unit tests + manual testing.
    
    Manual testing procedure:
    1. Have private image registry.
    2. Spark-submit application with no `spark.kubernetes.imagePullSecret` set. 
Do `kubectl describe pod ...`. See the error message: 
    ```
    Error syncing pod, skipping: failed to "StartContainer" for 
"spark-kubernetes-driver" with ErrImagePull: "rpc error: code = 2 desc = Error: 
Status 400 trying to pull repository rtdp/hyperconvergence: \"{\\n  
\\\"errors\\\" : [ {\\n    \\\"status\\\" : 400,\\n    \\\"message\\\" : 
\\\"Unsupported docker v1 repository request for '...'\\\"\\n  } ]\\n}\""
    ```
    3. Create secret `kubectl create secret docker-registry ...`
    4. Spark-submit with `spark.kubernetes.imagePullSecret` set to the new 
secret. See that deployment was successful.

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

    $ git pull https://github.com/andrusha/spark spark-23668-image-pull-secrets

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

    https://github.com/apache/spark/pull/20811.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 #20811
    
----
commit dc2c1852a5056a023de64855d1f3b1ce5fd050b9
Author: Andrew Korzhuev <andrew.korzhuev@...>
Date:   2018-03-13T14:05:58Z

    Add config option for passing through k8s Pod.spec.imagePullSecrets
    
    This will allow users to access images from private registries.

----


---

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

Reply via email to