I'm learning spark, and I'm get confused about running docker which contains spark code on Kubernetes cluster.
I read that
sparkget utilized multiple nodes (servers) and it can run code on different nodes, in order to get complete jobs faster (and get used the memory of each node, when the data is too big)On the other side, I read that Kubernetes pod (which contains dockers/containers) run on one node.
For example, I'm running the following spark code from docker:
num = [1, 2, 3, 4, 5]
num_rdd = sc.parallelize(num)
double_rdd = num_rdd.map(lambda x: x * 2)
Some notes and reminders (from my understanding):
- When using the
mapcommand, each value of thenumarray maps to different spark node (slave worker) k8spod run on one node
- So I'm confused how spark utilized multiple nodes when the pod run on one node ?
- Does the
spark slave workersruns on different nodes, and this is how the pod which run the code above can communicate with those nodes in order to utilize the spark framework ?