<p>I have successfully installed a Kubernetes cluster and can verify this by:</p>

<pre><code>C:\windows\system32&gt;kubectl cluster-info
        Kubernetes master is running at https://&lt;ip&gt;:&lt;port&gt;
        KubeDNS is running at https://&lt;ip&gt;:&lt;port&gt;/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
</code></pre>

<p>Then I am trying to run the SparkPi with the Spark I downloaded from <a href="https://spark.apache.org/downloads.html" rel="nofollow noreferrer">https://spark.apache.org/downloads.html</a> . </p>

<pre><code>spark-submit --master k8s://https://192.168.99.100:8443 --deploy-mode cluster --name spark-pi --class org.apache.spark.examples.SparkPi --conf spark.executor.instances=2 --conf spark.kubernetes.container.image=gettyimages/spark c:\users\&lt;username&gt;\Desktop\spark-2.4.0-bin-hadoop2.7\examples\jars\spark-examples_2.11-2.4.0.jar
</code></pre>

<p>I am getting this error:</p>

<pre><code>Error: Master must either be yarn or start with spark, mesos, local
Run with --help for usage help or --verbose for debug output
</code></pre>

<p>I tried versions 2.4.0 and 2.3.3. I also tried </p>

<pre><code>spark-submit --help
</code></pre>

<p>to see what I can get regarding the <strong>--master</strong> property. This is what I get:</p>

<pre><code>--master MASTER_URL         spark://host:port, mesos://host:port, yarn, or local.
</code></pre>

<p>According to the documentation [<a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html]" rel="nofollow noreferrer">https://spark.apache.org/docs/latest/running-on-kubernetes.html]</a> on running Spark workloads in Kubernetes, spark-submit does not even seem to recognise the k8s value for master. [ included in possible Spark masters: <a href="https://spark.apache.org/docs/latest/submitting-applications.html#master-urls" rel="nofollow noreferrer">https://spark.apache.org/docs/latest/submitting-applications.html#master-urls</a> ]</p>

<p>Any ideas? What would I be missing here?</p>

<p>Thanks</p>

and_apo
<p>Issue was my CMD was recognising a previous spark-submit version I had installed(2.2) even though i was running the command from the bin directory of spark installation.</p>
