答案 0 :(得分:3)
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: hello-spark-
spec:
entrypoint: sparkapp
templates:
- name: sparkapp
container:
image: sparkimage
command: [sh]
args: [
"-c",
"sh /opt/spark/bin/spark-submit.sh \"--class\" \"org.apache.spark.examples.SparkPi\" \"/opt/spark/examples/jars/spark-examples_2.11-2.4.0.jar\" "
]
希望这会有所帮助!
答案 1 :(得分:0)
这里是运行Spark的Pi示例的示例,只需替换k8s api的图像,类和url的正确值
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: wf-spark-pi
namespace: spark
spec:
entrypoint: sparkapp
templates:
- name: sparkapp
container:
image: Spark-Image
imagePullPolicy: Always
command: [sh]
args:
- /opt/spark/bin/spark-submit
- --master
- k8s://https://<K8S_API_TCP_ADDR>:<K8S_API_TCP_PORT>
- --deploy-mode
- cluster
- --conf
- spark.kubernetes.namespace=spark
- --conf
- spark.kubernetes.container.image=Spark-Image
- --conf
- spark.kubernetes.driver.pod.name=spark
- --conf
- spark.executor.instances=2
- --class
- org.apache.spark.examples.SparkPi
- local:///opt/spark/examples/jars/spark-examples_2.11-2.4.5.jar
resources: {}
restartPolicy: OnFailure