<p>I am running Spark on Kubernetes and need to monitor the Spark Job in runtime.<br />
How can I access the SparkUI page of my job while it's running?</p>

<ol>
<li>Enable port forwarding for the Spark driver pod:</li>
</ol>
<pre class="lang-sh prettyprint-override"><code>kubectl port-forward &lt;driver-pod-name&gt; 4040:4040
</code></pre>
<ol start="2">
<li>Access the SparkUI from your web via <code>http://localhost:4040</code></li>
</ol>
<hr />
<p>You can also make sure SparkUI is running by looking for the relevant log:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl logs &lt;driver-pod-name&gt; | grep SparkUI
</code></pre>
<p>Example output:</p>
<blockquote>
<p>21/11/22 09:50:21 INFO Utils: Successfully started service 'SparkUI'
on port 4040. 21/11/22 09:50:21 INFO SparkUI: Bound SparkUI to
0.0.0.0, and started at <a href="http://spark-xxxxxxxxxxxxxxxx-driver-svc.spark.svc:4040" rel="nofollow noreferrer">http://spark-xxxxxxxxxxxxxxxx-driver-svc.spark.svc:4040</a></p>
</blockquote>
