Created
May 4, 2018 14:07
-
-
Save mqasimsarfraz/ef9fcca485a39ab78ec31f92d19514b3 to your computer and use it in GitHub Desktop.
An example for submitting spark job from Kubernetes master in default namespaces.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
docker run --rm -it --net=host --entrypoint=/opt/spark/bin/spark-submit esailors/spark:2.3.0 \ | |
--master k8s://http://localhost:8080 \ | |
--deploy-mode cluster \ | |
--name spark-pi \ | |
--class org.apache.spark.examples.SparkPi \ | |
--conf spark.executor.instances=3 \ | |
--conf spark.kubernetes.container.image=esailors/spark:2.3.0 \ | |
--conf spark.kubernetes.driver.pod.name=spark-pi-driver \ | |
local:///opt/spark/examples/jars/spark-examples_2.11-2.3.0.jar | |
kubectl logs -f spark-pi-driver | |
kubectl delete pods spark-pi-driver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment