k8s提交spark应用消费kafka数据写入elasticsearch7

一、k8s集群环境

k8s 1.23版本,三个节点,容器运行时使用docker。

spark版本时3.3.3

k8s部署单节点的zookeeper、kafka、elasticsearch7

二、spark源码

https://download.csdn.net/download/TT1024167802/88509398

命令行提交方式

/opt/module/spark-3.3.3/bin/spark-submit --name KafkaSparkElasticsearch7 --verbose --master k8s://https://10.10.10.80:6443 --deploy-mode cluster --conf spark.network.timeout=300 --conf spark.executor.instances=3 --conf spark.driver.cores=1 --conf spark.executor.cores=1 --conf spark.driver.memory=1024m --conf spark.executor.memory=1024m --conf spark.kubernetes.namespace=apache-spark --conf spark.kubernetes.container.image.pullPolicy=IfNotPresent --conf spark.kubernetes.container.image=zhxl1989/spark-demo:3.3.3 --conf spark.kubernetes.authenticate.driver.serviceAccountName=spark-service-account --conf spark.kubernetes.authenticate.executor.serviceAccountName=spark-service-account --conf spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" --conf spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" --class com.example.cloud.KafkaSparkElasticsearch7 local:///opt/spark/examples/jars/KafkaSparkElasticsearch7-jar-with-dependencies.jar 3000
基于apache/spark:3.3.3镜像构建,将KafkaSparkElasticsearch7-jar-with-dependencies.jar添加到镜像容器的/opt/spark/examples/jars/目录下。

main类名

com.example.cloud.KafkaSparkElasticsearch7
k8s主节点入口

k8s://https://10.10.10.80:6443

设置响应的名称空间及account 、rule权限。

三、运行效果

相关推荐
2201_7611990412 小时前
k8s4部署
云原生·容器·kubernetes
小柏ぁ12 小时前
calico/node is not ready: BIRD is not ready: BGP not established with xxx
运维·docker·kubernetes
qq_4639448613 小时前
【Spark征服之路-2.2-安装部署Spark(二)】
大数据·分布式·spark
三劫散仙13 小时前
kubernetes jenkins pipeline优化拉取大仓库性能指定分支+深度
容器·kubernetes·jenkins
西京刀客13 小时前
k8s热更新-subPath 不支持热更新
云原生·容器·kubernetes·configmap·subpath
weixin_4349362814 小时前
k8S 命令
linux·容器·kubernetes
正在努力Coding14 小时前
kafka(windows)
分布式·kafka
nuczzz16 小时前
GPU虚拟化
docker·kubernetes·k8s·gpu·nvidia
Johny_Zhao17 小时前
2025年6月Docker镜像加速失效终极解决方案
linux·网络·网络安全·docker·信息安全·kubernetes·云计算·containerd·yum源·系统运维
藥瓿亭18 小时前
K8S认证|CKS题库+答案| 7. Dockerfile 检测
运维·ubuntu·docker·云原生·容器·kubernetes·cks