<p>Im using kubernetes cluster on AWS to run spark jobs ,im using spark 2.3 ,now i want to run spark-submit from AWS lambda function to k8s master,would like to know if there is any REST interface to run Spark submit on k8s Master?</p>

<p>Unfortunately, it is not possible for Spark 2.3, in case you are using native Kubernetes support.</p>

<p>Based on description from deployment instruction, submission process contains several steps:</p>

<ul>
<li>Spark creates a Spark driver running within a Kubernetes pod.</li>
<li><p>The driver creates executors which are also running within Kubernetes pods</p></li>
<li><p>The driver connects to them, and executes application code</p></li>
</ul>

<p>When the application completes, executor pods terminate and are cleaned up, but the driver pod persists its logs and remains in “completed” state in the Kubernetes API until it’s eventually garbage collected or manually cleaned up.</p>

<p>So, in fact, you have no place to submit a job until you start a submission process, which will launch the first Spark's pod (driver) for you. Only once application completes, everything is terminated.</p>

<p>Please also see similar answer for this question under <a href="https://stackoverflow.com/questions/49263299/spark-submit-2-3-on-kubernetes-cluster-from-python/49347108#49347108">the link</a></p>
