I'm new to apache spark and I'm trying to run a spark job using spark-submit on my Kubernetes cluster. I was wondering if there's a right way to stop spark jobs once the driver and executor pods are spawned? Would deleting the pods themselves be enough?
Thanks!
When you will delete executor
it will be recreated again and spark application will work. However if you will delete driver
pod it will stop application.
So killing driver pod is actually the way to stop the Spark Application during the execution.
As you are new to Spark
and you want to run it on Kubernetes, you should check this tutorial.
At present the only way to stop Spark job running on Kuberentes is to delete the Driver Pod (unless you have an app controlling Spark context which is able to manipulate it). Since all other job-related resources are linked to Spark Driver Pod with such as called ownerReference
s, they will be removed automatically by Kubernetes.
It should clean things up when the job completes automatically.