<p>I was trying to submit a example job to k8s cluster from binary release of spark 2.3.0, the submit command is shown below. However, I have met an wrong master error all the time. I am really sure my k8s cluster is working fine. </p>

<pre><code>bin/spark-submit \
    --master k8s://https://&lt;k8s-master-ip&gt; \
    --deploy-mode cluster \
    --name spark-pi \
    --class org.apache.spark.examples.SparkPi \
    --conf spark.executor.instances=3 \
    --conf spark.kubernetes.container.image= &lt;image-built-from-dockerfile&gt; \
    --conf spark.kubernetes.driver.pod.name=spark-pi-driver \
    local:///opt/examples/jars/spark-examples_2.11-2.3.0.jar
</code></pre>

<p>and the error comes out</p>

<blockquote>
  <p>Error: Master must either be yarn or start with spark, mesos, local</p>
</blockquote>

<p>and this is the output of <code>kubectl cluster-info</code></p>

<pre><code>Kubernetes master is running at https://192.168.0.10:6443
KubeDNS is running at https://192.168.0.10:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
</code></pre>

<p>because i am not good at English. so maybe have some wrong grammar. but i will do my best to responds your question. my resolve method is check your $SPARK_HOME and change to your "apache-spark-on-k8s" file path.because spark-submit is default use "${SPARK_HOME}" to run your command.maybe you have two spark environment in the same machine just like me. so command always use your original spark.  hope this answer will help you.</p>
