【发布时间】:2019-09-30 14:16:27
【问题描述】:
我在尝试通过 Kubernetes 调度程序启动 Spark 作业时遇到了一些问题。
我希望我的所有驱动程序/执行程序 pod 都生成到具有一定污点的节点上。因此,我想指定将直接注入到 pod 配置文件中的容忍度。目前,没有直接来自spark-submit 命令的默认方式
根据this和this,用户应该可以指定一个pod模板,可以使用以下参数进行设置:spark.kubernetes.driver.podTemplateFile和spark.kubernetes.executor.podTemplateFile。
我尝试使用以下文件在spark-submit 命令中指定这些参数:
pod_template.template
apiVersion: v1
kind: Pod
spec:
tolerations:
- effect: NoSchedule
key: dedicated
operator: Equal
value: test
但是,这种容忍度永远不会添加到已启动的驱动程序 pod 中。目前有办法解决这个问题吗?
作为参考,这里是完整的 spark-submit 命令:
/opt/spark/bin/spark-submit --name spark-pi --class org.apache.spark.examples.SparkPi --conf spark.kubernetes.executor.volumes.persistentVolumeClaim.persistent.options.claimName=pvc-storage --conf spark.kubernetes.executor.volumes.persistentVolumeClaim.persistent.mount.subPath=test-stage1/spark --conf spark.executor.memory=1G --conf spark.executor.instances=1 --conf spark.kubernetes.driver.volumes.persistentVolumeClaim.persistent.mount.subPath=test-stage1/spark --conf spark.kubernetes.executor.limit.cores=1 --conf spark.kubernetes.authenticate.driver.serviceAccountName=spark --conf spark.kubernetes.namespace=test-stage1 --conf spark.kubernetes.driver.volumes.persistentVolumeClaim.persistent.mount.path=/persistent --conf spark.kubernetes.driver.limit.memory=3G --conf spark.kubernetes.executor.volumes.persistentVolumeClaim.persistent.mount.path=/persistent --conf spark.submit.deployMode=cluster --conf spark.kubernetes.container.image=<SPARK IMAGE> --conf spark.master=k8s://https://kubernetes.default.svc --conf spark.kubernetes.driver.limit.cores=1 --conf spark.executor.cores=1 --conf spark.kubernetes.driver.volumes.persistentVolumeClaim.persistent.options.claimName=pvc-storage --conf spark.kubernetes.container.image.pullPolicy=Always --conf spark.kubernetes.executor.podTemplateFile=//opt/pod_template.template --conf spark.kubernetes.driver.podTemplateFile=//opt/pod_template.template local:///opt/spark/examples/src/main/python/pi.py 100
【问题讨论】:
标签: apache-spark kubernetes pyspark kubernetes-pod