其他分享
首页 > 其他分享> > spark on k8s

spark on k8s

作者:互联网

spark on k8s

quick start


./bin/docker-image-tool.sh -t 3.2.1.quickstart build


# 命名空间创建
kubectl create namespace spark
 
# 创建service账户以及绑定角色
kubectl create serviceaccount spark-serviceaccount --namespace spark
kubectl create clusterrolebinding spark-rolebinding --clusterrole=edit --serviceaccount=spark:spark-serviceaccount --namespace=spark


kubectl cluster-info


# 任务提交

./bin/spark-submit \
    --master k8s://https://127.0.0.1:8443 \
    --deploy-mode cluster \
    --name spark-pi \
    --class org.apache.spark.examples.SparkPi \
    --conf spark.executor.instances=10 \
    --conf spark.kubernetes.namespace=spark \
    --conf spark.kubernetes.authenticate.driver.serviceAccountName=spark-serviceaccount \
    --conf spark.kubernetes.container.image.pullPolicy=Always \
    --conf spark.kubernetes.container.image=spark:3.2.1.quickstart \
    local:///${SPARK_HOME}/examples/jars/spark-examples_2.11-2.4.7.jar

标签:kubectl,kubernetes,--,serviceaccount,conf,spark,k8s
来源: https://www.cnblogs.com/fishsun/p/15875626.html