<p>I am trying to run a spark-submit to the Kubernetes cluster with spark 3.2.1 image and it is working. Now my question is, can I execute an init container along with the spark-submit? What am trying to achieve is that the init container check another service is up or not, is it up then spark-submit will run or it fail.</p>
<p>I can see that a conf parameter &quot;spark.kubernetes.initContainer.image&quot; for spark version 2.3 but not for 3.2.1 (<a href="https://spark.apache.org/docs/2.3.0/running-on-kubernetes.html" rel="nofollow noreferrer">https://spark.apache.org/docs/2.3.0/running-on-kubernetes.html</a>)</p>
<p>is there any mechanism that I can use to check other services are up or not before I submit a spark job?</p>
<p>I can see init container usage for the spark in the below links but it is not providing an accurate answer</p>
<p><a href="https://docs.bitnami.com/kubernetes/infrastructure/spark/configuration/configure-sidecar-init-containers/" rel="nofollow noreferrer">https://docs.bitnami.com/kubernetes/infrastructure/spark/configuration/configure-sidecar-init-containers/</a>
<a href="https://doc.lucidworks.com/spark-guide/11153/running-spark-on-kubernetes" rel="nofollow noreferrer">https://doc.lucidworks.com/spark-guide/11153/running-spark-on-kubernetes</a></p>
<p>any help will be much appreciated, thanks.</p>

<p>I found that the best way to submit a spark job is the sparkoperator, more details can be found in the <a href="https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/docs/user-guide.md#using-init-containers" rel="nofollow noreferrer">GitHub link</a></p>
<p>There is one option to include an init container and a sidecar container.</p>
