
说明Apache Seatunnel在kunernetes环境部署。支持离线部署。采用Zeta(cluster mode) 模式。当前采用2.3.13版本后续随官网及时更新。参考资料https://seatunnel.apache.org/docs/2.3.13/getting-started/kubernetes/下载文件很重要必须下载https://atomgit.com/zhudev2026/apacheseatunnel-deploy/tree/main/kubernetes/zeta(cluster-mode)构建容器镜像仅用于有定制镜像需求时。Dockerfile内容FROM seatunnelhub/openjdk:8u342 ENVSEATUNNEL_VERSION2.3.13ENVSEATUNNEL_HOME/opt/seatunnelRUNwgethttps://dlcdn.apache.org/seatunnel/${SEATUNNEL_VERSION}/apache-seatunnel-${SEATUNNEL_VERSION}-bin.tar.gz RUNtar-xzvfapache-seatunnel-${SEATUNNEL_VERSION}-bin.tar.gz RUNmvapache-seatunnel-${SEATUNNEL_VERSION}${SEATUNNEL_HOME}RUNmkdir-p$SEATUNNEL_HOME/logs RUNcd${SEATUNNEL_HOME}shbin/install-plugin.sh${SEATUNNEL_VERSION}构建镜像dockerbuild-tseatunnel:2.3.13-fDockerfile.导出为文件dockersave-oseatunnel.tar seatunnel:2.3.13将镜像加载到k8s集群注意新版k8s只有ctr工具。ctr-nk8s.io imageimportseatunnel.tar创建namespacekubectl create namespace seatunnel创建配置文件当前目录已有所有文件。参考https://github.com/apache/seatunnel/blob/2.3.13-release/config/v2.streaming.conf.template创建配置kubectl create cm seatunnel-config --from-fileseatunnel.streaming.confseatunnel.streaming.conf-nseatunnel创建配置kubectl create configmap hazelcast-client --from-filehazelcast-client.yaml-nseatunnel kubectl create configmap hazelcast --from-filehazelcast.yaml-nseatunnel kubectl create configmap seatunnelmap --from-fileseatunnel.yaml-nseatunnel# 可选用于日志持久化kubectl create configmap log4j2.properties --from-filelog4j2.properties-nseatunnel kubectl create configmap log4j2-client.properties --from-filelog4j2_client.properties-nseatunnel创建reloader下载文件https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloader.yaml修改文件中的namespace部分为seatunnelkubectl apply-freloader.yaml-nseatunnel创建seatunnel集群注意默认三副本若调整副本数量需调整configmap的hazelcast和hazelcast-client中的成员的完整服务名字。kubectl apply-fseatunnel-cluster.yml-nseatunnel修改configmap此处可以优化到部署阶段一次部署完成。注意此处已经做优化不需要做编辑修改。不需要做修改。不需要做修改。我已经内置了配置。kubectl edit cm hazelcast-nseatunnel改为- seatunnel-0.seatunnel.default.svc.cluster.local - seatunnel-1.seatunnel.default.svc.cluster.local - seatunnel-2.seatunnel.default.svc.cluster.local这是seatunnel的完整服务名kubectl edit cm hazelcast-client改为- seatunnel-0.seatunnel.default.svc.cluster.local:5801 - seatunnel-1.seatunnel.default.svc.cluster.local:5801 - seatunnel-2.seatunnel.default.svc.cluster.local:5801服务名和端口。特殊配置说明业务需求。非通用配置。单独配置了8080端口通过web界面查看信息。单独配置了日志长期存储。配置了对接HDFS即Hadoop的namenode:9000配置了单独的端口转发服务。开启8080端口配置端口nodeport类型的服务。参考https://seatunnel.apache.org/docs/2.3.13/engines/zeta/web-ui查询验证# 查询资源状态kubectl get all-nseatunnel# 提交测试任务kubectlexec-it-nseatunnel seatunnel-0 -- /opt/seatunnel/bin/seatunnel.sh--config/data/seatunnel.streaming.conf-nseatunnel