I've been trying to submit applications to a Kubernetes. I have followed the tutorial in https://spark.apache.org/docs/latest/running-on-kubernetes.html such as building the spark image and etc.
But whenever I tried to run the command spark-submit, the pod always throw error. This is the logs from the command: kubectl logs <spark-driver-pods>:
Error: Unable to initialize main class org.apache.spark.deploy.SparkSubmit
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/spi/Filter
I have tried to use something like:
spark-submit
...
--jars $(echo /opt/homebrew/Caskroom/miniforge/base/lib/python3.9/site-packages/pyspark/jars/*.jar | tr ' ' ',')
...
But that also still throw error.
Some notes related to my development environment:
- I use Kubernetes built-in the Docker desktop
- I use pyspark in conda environment, and yes I have activated the environment. That's why I can use
pysparkin the terminal.
Anything else I should do? Or forget to do?