<ul>
<li>My Mac OS/X Version : 10.15.3</li>
<li>Minikube Version: 1.9.2</li>
</ul>

<p>I start the minikube use the following command without any extra configuration.</p>

<pre><code>minikube start --driver=virtualbox
--image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers' --cpus 4 --memory 4096 --alsologtostderr
</code></pre>

<p>And I download spark-2.4.5-bin-hadoop2.7 from the Spark official website and build spark images by the following command</p>

<pre><code>eval $(minikube docker-env)
./bin/docker-image-tool.sh -m -t 2.4.5 build
</code></pre>

<p>then I run Spark-pi using the follwing command within my local machine where store the Spark 2.4.5.</p>

<pre><code>
kubectl create serviceaccount spark
kubectl create clusterrolebinding spark-role --clusterrole=admin --serviceaccount=default:spark --namespace=default
./bin/spark-submit \
--master k8s://https://192.168.99.104:8443 \
--deploy-mode cluster \
--name spark-pi \
--class org.apache.spark.examples.SparkPi \
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark \
--conf spark.executor.instances=1 \
--conf spark.kubernetes.container.image=spark:2.4.5 \
local:///opt/spark/examples/jars/spark-examples_2.11-2.4.5.jar

</code></pre>

<p>I get the following error</p>

<p><a href="https://i.stack.imgur.com/Ho19T.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ho19T.jpg" alt="enter image description here"></a></p>

<p>the full log can be found at <a href="https://github.com/hzyfox/picture-share/blob/master/logs/log.txt" rel="nofollow noreferrer">full log</a></p>

<p>Can anyone explain this error and how to solve it?</p>

<p>Please check the Kubernetes version you launched with Minikube.</p>

<p>Spark <code>v2.4.5</code> fabric8 Kubernetes client <code>v4.6.1</code> is compatible with Kubernetes API up to <code>1.15.2</code> (refer <a href="https://stackoverflow.com/a/60052900/7947644">answer</a>).</p>

<p>You can launch the specific Kubernetes API version with Minikube by adding <code>--kubernetes-version</code> flag to <code>minikube start</code> command (refer <a href="https://minikube.sigs.k8s.io/docs/handbook/config/#selecting-a-kubernetes-version" rel="nofollow noreferrer">docs</a>).</p>

<p>Also the issue might be caused by OkHttp library bug described in the comment of <a href="https://stackoverflow.com/q/61565751/7947644">this</a> qustion.</p>
