我在尝试通过 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
Run Code Online (Sandbox Code Playgroud)
然而,这种容忍永远不会被添加到启动的驱动程序窗格中。目前有办法解决这个问题吗?
作为参考,这里是完整的 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 …Run Code Online (Sandbox Code Playgroud)