Spark k8s driver fails without any specific error

4/29/2021

I'm trying to run a spark application on k8s and it fails immediately after container creation. No specific error. I see only error code 101

Container name: spark-kubernetes-driver
Container image: image URL
Container state: Terminated
Exit code: 101



Driver logs
    + CMD=("$SPARK_HOME/bin/spark-submit" --conf "spark.driver.bindAddress=$SPARK_DRIVER_BIND_ADDRESS" --deploy-mode client "$@")
    + exec /usr/bin/tini -s -- /opt/spark/bin/spark-submit --conf spark.driver.bindAddress=10.1.0.10 --deploy-mode client --properties-file /opt/spark/conf/spark.properties --class $className spark-internal args

Spark submit command

`bin/spark-submit  --class $className 
--master k8s://https://kubernetes.docker.internal:6443 
--deploy-mode cluster 
--name app-job 
--conf spark.kubernetes.authenticate.submission.oauthToken=$(kubectl get secret $(kubectl describe serviceaccount spark-sa --namespace=pipelines | grep Token | awk '{print $2}') -o jsonpath="{.data.token}" | base64 --decode) 
--conf spark.kubernetes.docker.image.pullPolicy=Always 
--conf spark.kubernetes.authenticate.driver.serviceAccountName=spark-sa 
--conf spark.executor.instances=2
--conf spark.kubernetes.namespace=pipelines 
--conf spark.kubernetes.executor.container.image=$imageURL 
--conf spark.network.timeout=500 
--conf spark.metrics.namespace=app-job 
--conf spark.kubernetes.driver.container.image=$imageURL $JARURL 10000` 
-- Sads
apache-spark
docker
kubernetes
scala
spark-streaming

0 Answers